[R] negative variances
Dear R experts, I had a question which may not be directly relevant to R but I will be grateful if you can give me some advices. I ran a two-level multilevel model for data with repeated measurements over time, i.e. level-1 the repeated measures and level-2 subjects. I could not get convergence using lme(), so I tried MLwiN, which eventually showed the level-2 variances (random effects for the intercept and slope) were negative values. I know this is known as Heywood cases in the structural equation modeling literature, but the only discussion on this problem in the literature of multilevel models and random effects models I can find is in the book by Prescott and Brown. Any suggestion on how to solve this problem will be highly appreciated. Many thanks. With best regards, Yu-Kang __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] selections of data by one variable
Dear R experts, My problem is as follows: Suppose I have a data frame d comprising two variable a-c(1:10) b-c(11:20). I now want to select a subgroup according the values of b. I know if I just want to select, say, b=17, I can use f-d[d$b==17] and R will give me f a b 7 7 17 However, if now I want to select a subgroup according to b==e-c(13,15,17), then the same syntx doesn't work. What is the correct way to do it? My data have more than one million subjects, and I want to select part of them according to their id numbers. Your help will be highly appreciated. Best regards, Yu-Kang __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] how to install yags in R
Dear R users, I search the R archives and noted that the same problem has been posted but without solution. I know there IS instructions by the author of yags, but I just couldn't figured out. I know gee and geepack can also perform generalized estimating equation, but the reason why I need yags is I want to perform a Small Sample Adjustments by Michael P. Fay and Barry I. Graubard in Biometrics, 2001, 57: 1198-1206. I'm working on some dental data (I'm a dentist) with repeat measurements on relatively small sample sizes (around 20 to 50 teeth), and GEE seems to be quite ineffient (i.e. less powerful) compared to other methods. I wonder it is really due to the sample size is too small, and GEE should not be used? Many thanks in advance. best regards, Yu-Kang http://match.msn.com.tw __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] how to cite a library
Dear R users, I used the multivariate random numbers generation function in MASS for my study. I wonder what is an approriate way to cite the library and its authors in my publication to express my gratefulness? best regards, Yu-Kang __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] extracting standard error from lme output
Dear R experts, I want to extract standard error from the output of lme, but I found fix.effects() does not include SE of the coefficients. Many thanks in advance. Best regards, Yu-Kang _ MSN __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] extracting p value from GEE
Hi, Many thanks for your kind help. best regards, Yu-Kang From: Emmanuel Paradis [EMAIL PROTECTED] To: Tu Yu-Kang [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [R] extracting p value from GEE Date: Fri, 05 Dec 2003 15:48:41 +0100 At 11:53 04/12/2003 +, vous avez rit: Dear R users, If anyone can tell me how to extract the p values from the output of gee? They are easily computed from the output of summary(gee(...)) which prints either a z or a t depending in the family option. z follows, under the null hypothesis, a normal distribution N(0, 1), you have the corresponding P-value with (for a two-tailed test): 2 * (1 - pnorm(abs(z))) t follows a 'Student' distribution with df degrees of freedom given by N- k - 1, where N is the number of observations, and k is the number of estimated paramaters. I think, but am not definitely sure, that N is counted among all clusters, and k is the number of parameters in the GLM eventually included the estimated scale (correlation parameters are not counted). As above, you have the P-value with: 2 * (1 - pnorm(abs(t), df)) HTH Emmanuel Paradis Many thanks in advance. Yu-Kang _ MSN __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help _ MSN eShop http://msn.com.tw/eshop __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] extracting p value from GEE
Dear R users, If anyone can tell me how to extract the p values from the output of gee? Many thanks in advance. Yu-Kang _ MSN http://www.msn.com.tw/english/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] p value in MANOVA
Dear R users, Can anyone tell me how to get the p value out of the output from summary.manova? I tried all the methods I can think of, but failed. Many thanks Yu-Kang _ MSN Mobile MSN Hotmail http://msn.com.tw/msnmobile __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] error message in simulation
Dear R-users, I am a dentist (so forgive me if my question looks stupid) and came across a problem when I did simulations to compare a few single level and two level regressions. The simulations were interrupted and an error message came out like 'Error in MEestimate(lmeSt, grps) : Singularity in backsolve at level 0, block 1'. My collegue suggested that this might be due to my codes was not efficient and ran out of memory. If this is the reason, could you please help me improve my codes writing. However, as I slightly changed the parameters, it ran well. So I suspect memory is problem. I use R 1.8.0 and Windows XP professional. My computer has a Pentium 4 2.4 with 512 MB memory. Thanks in advance. best regards, Yu-Kang Tu Clinical Research Fellow Leeds Dental Institute University of Leeds ## change scores simulation close.screen(all=TRUE) split.screen(c(3,3)) nitns-1 nsims-100 r-0.1 param1-c(1:nitns) param2-c(1:nitns) param3-c(1:nitns) param4-c(1:nitns) param5-c(1:nitns) param6-c(1:nitns) param7-c(1:nitns) param8-c(1:nitns) param9-c(1:nitns) param10-c(1:nitns) param11-c(1:nitns) param12-c(1:nitns) param13-c(1:nitns) param14-c(1:nitns) for(itn in 1:nitns){ g-rbinom(nsims,1,0.5) b-rnorm(nsims,0,1)*10 rn-rnorm(nsims,0,1)*10 a-b*r+rn*(1-r^2)^0.5 a-round(a)+50 a-a-g*5 b-round(b)+50 abs.2-function(x) ifelse(x1,1,x) b-abs.2(b) c-b-a p-c/b lm1-lm(a~g) lm2-lm(c~g) lm3-lm(p~g) lm4-lm(a~b+g) gr-c(g,g) occasion-rep(0:1,c(nsims,nsims)) occ-occasion-0.5 ppd-c(b,a) h-rep(0,nsims) mb-mean(b) bppd-b-mb bappd-c(h,bppd) occgr-occ*gr subject-c(1:nsims) sub-c(subject,subject) library(nlme) lm5-lme(ppd~occ+gr+occgr,random=~1|sub) lm5f-fixed.effects(lm5) lm5c-as.matrix(lm5f) lm5a-anova(lm5) lm6-lme(ppd~occ+gr+occgr,random=~1|sub,method=ML) lm6f-fixed.effects(lm6) lm6c-as.matrix(lm6f) lm6a-anova(lm6) lm7-lme(ppd~occ+gr+occgr+bappd,random=~1|sub,method=ML) lm7f-fixed.effects(lm7) lm7c-as.matrix(lm7f) lm7a-anova(lm7) param1[itn]-coef(summary(lm1))[2,1] param2[itn]-coef(summary(lm2))[2,1] param3[itn]-coef(summary(lm3))[2,1] param4[itn]-coef(summary(lm4))[3,1] param5[itn]-lm5c[4,1] param6[itn]-lm6c[4,1] param7[itn]-lm7c[4,1] param8[itn]-coef(summary(lm1))[2,4] param9[itn]-coef(summary(lm2))[2,4] param10[itn]-coef(summary(lm3))[2,4] param11[itn]-coef(summary(lm4))[3,4] param12[itn]-lm5a[4,4] param13[itn]-lm6a[4,4] param14[itn]-lm7a[4,4] } #the error message came out here. #But if I change some of the variables to: b-rnorm(nsims,0,1)*2 rn-rnorm(nsims,0,1)*2 a-b*r+rn*(1-r^2)^0.5 a-round(a)+7 a-a-g*2 b-round(b)+9 abs.1-function(x) ifelse(x5,5,x) b-abs.1(b) abs.2-function(x) ifelse(x1,1,x) a-abs.2(a) There is no poblem to complete the simulations. _ MSN http://msn.com.tw __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help