s-news
[Top] [All Lists]

Removing Intercept in lme

To: Splus Mailing list <s-news@lists.biostat.wustl.edu>
Subject: Removing Intercept in lme
From: Carole Birrell <cbirrell@uow.edu.au>
Date: Fri, 25 Jul 2003 11:03:46 +1000
Dear all,
I have been trying to remove the column of 1's which are automatically generated in the model matrix
for the fixed effects terms in the lme procedure.  Referring to book by Pinheiro and Bates, "Mixed Effects
models in Splus", page18  says to put a "-1" in the fixed effects formula statement. This seems to change
the first coefficient name from intercept to my named variable "sfd" but it doesn't  seem to change the
underlying model matrix and hence values of the fixed effects remain the same.

Alternatively, is there any way I can specify the model matrix directly?

I am using Splus 6.1 with WindowsXP.  My model formula is shown below with the relevant output.

contrasts(dataD$sfd) <- contr.sum(4)
cont.survey <- matrix(c(0, 1), 2, 1)
contrasts(dataD$survey) <- cont.survey

simD1 <- lme(org1 ~ sfd/survey-1, data="" random = ~sfd-1 | grp1/survey)

G1 <- dataD[dataD$grp1 =="1", ]
G2 <- G1[G1$year=="1",]
mm1 <- model.matrix(org1 ~sfd/survey-1 , G2)
print(mm1)
> print(mm1)
     sfd1 sfd2 sfd3 sfd4 sfd1survey sfd2survey sfd3survey sfd4survey
   1    1    1    0    0          0          0          0          0
  51    1    0    1    0          0          0          0          0
 101    1    0    0    1          0          0          0          0
 151    1   -1   -1   -1          0          0          0          0
2001    1    1    0    0          1          0          0          0
2051    1    0    1    0          0          1          0          0
2101    1    0    0    1          0          0          1          0
2151    1   -1   -1   -1          0          0          0          1

> print(fixef(simD1))
        sfd1       sfd2       sfd3       sfd4 sfd1survey  sfd2survey sfd3survey  sfd4survey
 0.006943758 -0.1510105 0.08799171 -0.1411481 0.02165393 0.005542556 0.03256895 -0.05884115

I would be grateful if anyone could help.

Carole Birrell
 
 
 
 
 

Attachment: cbirrell.vcf
Description: Card for Carole Birrell

<Prev in Thread] Current Thread [Next in Thread>
  • Removing Intercept in lme, Carole Birrell <=