Joe Moore
2006-Apr-19 17:46 UTC
[R] Can't run code from "Mixed Effects Models in S and S-plus" #2
Dear R-users: I run the following code from "Mixed Effects Models in S and S-plus" with R 2.2.1 on windows XP. library( nlme ) options( width = 65, digits = 5 ) options( contrasts = c(unordered = "contr.helmert", ordered = "contr.poly") ) # Chapter 5 Extending the Basic Linear Mixed-Effects Models # 5.1 General Formulation of the Extended Model data( Orthodont ) vf2Ident <- varIdent( form = ~ 1 | Sex, fixed = c(Female = 0.5)) vf2Ident <- Initialize( vf2Ident, Orthodont ) varWeights( vf2Ident ) Get the results: Male Male Male Male Male Male Male Male Male 1 1 1 1 1 1 1 1 1 ...... Female Female Female Female Female Female Female Female Female 1 1 1 1 1 1 1 1 1 But the results should be Male Male Male Male Male Male Male Male Male 1 1 1 1 1 1 1 1 1 ...... Female Female Female Female Female Female Female Female Female 2 2 2 2 2 2 2 2 2 Could anyone help me solve this discrpency? Thanks