[R] modelling and R misconceptions; was: package installtion
scott.raynaud at yahoo.com
Thu Nov 17 19:45:49 CET 2011
My responses are in brackets below, plus a final note after the main text.
----- Original Message -----
From: Uwe Ligges <ligges at statistik.tu-dortmund.de>
To: Scott Raynaud <scott.raynaud at yahoo.com>
Cc: "r-help at r-project.org" <r-help at r-project.org>
Sent: Thursday, November 17, 2011 9:16 AM
Subject: Re: [R] modelling and R misconceptions; was: package installtion
This is hopeless [That's a matter of perception-even concentration camp prisoners
found a way to hope (see Viktor Frankl)], since you never [never is a strong word
and many times leads to cognitive errors] seem to listen to our
advice [It's possible that I misunderstood your recommedations (more likely),
or that you communicated poorly (less likely)],
therefore this will be my very last try:
So you actually need local advice [Yes I need advice-that's why I post here!],
both for statistical concepts and R related [I don't claim to be a statistical genius,
but I can hold my own. Now, R is a different matter]. No statistics software
can estimate effects of variables that you observed to be constant (e.g. 0)
all the time [I think you misuderstood my intentions-I never wanted to estimate
effects that are 0 all of the time]. If any software does,
please delete it a once from your machine.
Instead, ask a local statistician for advice on your problem. You
certainly want to show the data and your model to the local expert -
since you don't show us. [I gave a detailed explanation in a previous post which I repeat here:
|OK, I'm using William Browne's MLPowSim to create an R script which will simulate samples for estimation of sample size in mixed models. I have subjects
| nested in hospitals with hospitals treated as random and all of my covariates at level 1. My outcome is death, so it's binary and I'll have a fixed and
|random intercept. My interest is in the relation of the covariates to the outcome.
|My most important variable is gestational age (GA) which my investigators divide thusly: 23-24, 25-26, 27-28, 29-30 and 31-32. I have recoded the
| dummies for GA in the script according to the MLPowSim instructions to a random multinomial variable:
|GA 23-24 is the reference with p=.0698. I started with a structured sampling scheme of 20, 60, 100, 120 and 140 level 2 units. My level 2 units have
|different sizes. So at 20 I had 5 hospitals with 100 patients, 4 with 280, 3 with 460, 3 with 640, 3 with 820 and 2 with 1000. Thus, at 60 hospitals, I have 15,
|12, 9, 9, 9, 6 with the same cell sample sizes.
|According to the MLPowSim documentation, with small probablities it's possible to have a column of zeroes in the X matrix if there are not many units in
|the random factor. R will choke on this but MLWin sets the associated fixed effects to 0. When R choked, I increased from 20 to 60 as my minimum as
|suggested in the MLPowSim documentation. Still no luck.
Since this is a simulation, I assume once and a while that by chance a coefficient could be 0.
In fact, Browne mentions as much in his documentation. There is a bit more to my simulation,
but I thought I'd try to keep it as simple as possible, at least at the outset.]
And then you want to ask for local R course
since reading the documentation seems not to help [You got that right!]. Applying mtrace() in
a non exiting object shows this straight away.
Apparently I misuderstood the prupose of mtrace after reading the documentation-I thought it was
to debug problems of the sort I've encountered. Michael Weylandt provided appropriate direction
in the previous post for which I am grateful.
Not all of us can be intellectual superstars. That's why we ask for help. This much I did read and understand
from the R posting guide:
Responding to other posts:
* Rudeness and ad hominem comments are not acceptable. Brevity is OK.
It's a good lesson to learn.
On 17.11.2011 15:49, Scott Raynaud wrote:
> I believe the problem is a column of zeroes in my x matrix. I have tried the suggestions in the documentation,
> so now to try to confirm the probelm I'd like to run debug. Here's where I think the problem is:
> ###~~~~~~~~~~ Fitting the model using lmer funtion ~~~~~~~~~~###
> (fitmodel<- lmer(modelformula,data,family=binomial(link=logit),nAGQ=1))
> I added the mtrace to catch the error, but get the following:
> Error in mtrace(fitmodel) : Can't find fitmodel
> How can I debug this?
> ----- Original Message -----
> From: Rolf Turner<rolf.turner at xtra.co.nz>
> To: Scott Raynaud<scott.raynaud at yahoo.com>
> Cc: "r-help at r-project.org"<r-help at r-project.org>
> Sent: Wednesday, November 16, 2011 6:04 PM
> Subject: Re: [R] package installtion
> On 17/11/11 05:37, Scott Raynaud wrote:
>> That might be an option if it weren't my most important predictor. I'm thinking my best bet is to use MLWin for the estimation since it will properly set fixed effects
>> to 0. All my other sample size simulation programs use SAS PROC IML which I don't have/can't afford. I like R since it's free, but I can't work around the problem
>> I'm currently having.
> This is the ``push every possible button until you get a result and to hell with what
> anything actually means'' approach to statistics. The probability of getting a
> *meaningful* result from this approach is close to zero.
> Why don't you try to *understand* what is going on, rather than wildly throwing
> every possible piece of software at the problem until one such piece runs?
> Rolf Turner
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help