Skip to content
Prev 277628 / 398506 Next

package installtion

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:
?
?????????????? macpred<-rmultinom(n2,1,c(.1031,.1482,.2385,.4404,.0698)) 
?????????????? x[,3]<-macpred[1,][l2id]
?????????????? x[,4]<-macpred[2,][l2id]
?????????????? x[,5]<-macpred[3,][l2id]
?????????????? x[,6]<-macpred[4,][l2id]

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.
?

----- Original Message -----
From: Uwe Ligges <ligges at statistik.tu-dortmund.de>
To: r-help at r-project.org
Cc: Scott Raynaud <scott.raynaud at yahoo.com>
Sent: Wednesday, November 16, 2011 1:01 PM
Subject: Re: [R] package installtion
On 16.11.2011 17:37, Scott Raynaud wrote:
Then you really have to describe your problem much better: If you most 
important predictor is really all zero, then you have a real problem .....

Uwe Ligges