The follwing is a code snippet from a power simulation program that I'm using: ? estbeta<-fixef(fitmodel) ?sdebeta<-sqrt(diag(vcov(fitmodel))) ? for(l in 1:betasize) ? {? ?? cibeta<-estbeta[l]-sgnbeta[l]*z1score*sdebeta[l] ??? if(beta[l]*cibeta>0)????????????? powaprox[[l]]<-powaprox[[l]]+1 ????? sdepower[l,iter]<-as.numeric(sdebeta[l]) ? } ? Estbeta recovers the fixed effects from a model fitted using lmer. Beta is defined elsewhere and is a user specified input that relates the?data generated in the simulation to an oucome.? So, it seems pretty clear that the third line from the bottom is a clever test of whether the confidence interval traps 0.? My question is why use beta[l]*cibeta>0 rather than estbeta[l]*cibeta>0.? Is that because in the long run the model parameter etimates tend toward the betas specified by the user??? In other words, what really matters is the standard errors, right?
Yakamu Yakamu
2012-Feb-01 19:38 UTC
[R] how can i calculate the mean of my data which is only bigger than 75?
hi, I have a dataset with more than 15000 data and would like to calculate the mean for only those that is bigger than and equal to 75 for all variables (x,y,z1,z2,u,v,w z1 and z2). my dataset is (for example) as follows : x y z1 z2 u v w1 w2 95 83 57 50 59 39 90 48 100 92 83 82 93 92 50 50 39 40 59 68 59 49 60 89 80 80 79 57 70 79 50 79 78 88 98 67 79 89 79 90 and so on... any help would be appreciated, big thanks in advance, Yakamu [[alternative HTML version deleted]]