[R-sig-ME] glmmPQL inquiry
Ken Beath
kjbeath at kagi.com
Fri Dec 7 10:30:15 CET 2007
On 07/12/2007, at 7:58 PM, kennedy otwombe wrote:
> Hi Sundar/Ken,
> I would like to clarify my inquiry. The data structure i gave was
> just a sample of my data. I actually have 50 subjects each with
> three binary observations (hence 150 observations). So the error i
> initially gave emanates from the analysis involving all the 50
> subjects. It just turns out that for the sample i gave, the first
> two subjects have only 0 as their entries but this varies as you
> look through the data.
> I am using the latest version of R i.e 2.6.1 and i downloaded the
> nlme version currently available on the CRAN website. I am aslo
> assuming my random part is the intercept.
> Hope this clarifies my inquiry.
>
If I modify your code to include better values for y, using code
library(MASS)
navs<-data.frame(matrix(c(1,1,1,0,0,1,1,
2,1,0,0,1,0,1,
3,1,0,0,1,0,1,
1,2,1,0,0,1,0,
2,2,1,1,1,1,0,
3,2,0,1,1,1,0),nrow=6,byrow=T))
names(navs) <- c("t","id","y","x0","x1","x2","x3")
fit<-glmmPQL(y~x1+x2+x3, random=~1|id, family=binomial, data=navs)
summary(fit)
the results are fine, except for some problems due to not having
enough subjects, as in the following output.
Ken
> library(MASS)
> navs<-data.frame(matrix(c(1,1,1,0,0,1,1,
+ 2,1,0,0,1,0,1,
+ 3,1,0,0,1,0,1,
+ 1,2,1,0,0,1,0,
+ 2,2,1,1,1,1,0,
+ 3,2,0,1,1,1,0),nrow=6,byrow=T))
>
> names(navs) <- c("t","id","y","x0","x1","x2","x3")
>
> fit<-glmmPQL(y~x1+x2+x3, random=~1|id, family=binomial, data=navs)
iteration 1
iteration 2
iteration 3
iteration 4
iteration 5
iteration 6
iteration 7
iteration 8
iteration 9
iteration 10
> summary(fit)
Linear mixed-effects model fit by maximum likelihood
Data: navs
AIC BIC logLik
NA NA NA
Random effects:
Formula: ~1 | id
(Intercept) Residual
StdDev: 8.009601e-05 0.5773503
Variance function:
Structure: fixed weights
Formula: ~invwt
Fixed effects: y ~ x1 + x2 + x3
Value Std.Error DF t-value p-value
(Intercept) 0.000353 6171979 2 5.700000e-11 1
x1 -30.566351 2631792 2 -1.161427e-05 1
x2 30.565997 4161051 2 7.345739e-06 1
x3 -0.000071 3721849 0 -1.900000e-11 NaN
Correlation:
(Intr) x1 x2
x1 -0.853
x2 -0.944 0.632
x3 -0.905 0.707 0.894
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.732051e+00 -5.451298e-17 8.078053e-16 1.506878e-15 1.732051e+00
Number of Observations: 6
Number of Groups: 2
Warning message:
In pt(q, df, lower.tail, log.p) : NaNs produced
More information about the R-sig-mixed-models
mailing list