Shirley, Well, you picked the type of contrast that proves my statement wrong. The interface in the contrast package (and the Design package) may not be well suited for the type that you are interested in (or other types, such as SAS's "lsmeans" type contrasts).
The good news is that the function contrast:::contrastCalc currently does most of the work for all types of models. A modified version of that function can be used for your situation. The top part of the function works to generate two objects: xa and xb. Looking at the limma documentation, this might correspond to vectors given for WT.SvsU and Mu.SvsU. I'll attach the modified version in an off-list email with an lme example. (and I'll think about how to let the contrasts be specified by the coefficient vectors for a future release) Max -----Original Message----- From: shirley zhang [mailto:[EMAIL PROTECTED] Sent: Monday, July 09, 2007 11:50 AM To: Kuhn, Max Cc: [email protected] Subject: Re: [R] similar limma's contrasts.fit() for lme (mixed effect model)object Hi Max, Thanks for your prompt reply. Actually I have already checked contrast package, but I still could not figure out how to set the contrast matrix for a 2x2 factorial design. I would like to set a contrast exactly similar to the limma's user guide, 8.7 Factorial Designs (page 45). For example, after a mixed linear model fit with the default contr.treatment, I want to compute an estimated coefficient as the sum of the third and fourth coefficients of the original lme model (2x2 factorial design). Could you give me an example how to implement this using the contrast package? Thanks, Shirley On 7/9/07, Kuhn, Max <[EMAIL PROTECTED]> wrote: > Shirley, > > The contrast package can do this. The method of specifying the contrast > conditions/coefficients is different (and I think easier). > > Max > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of shirley zhang > Sent: Monday, July 09, 2007 11:16 AM > To: [email protected] > Subject: [R] similar limma's contrasts.fit() for lme (mixed effect > model)object > > Dear R help, > > In limma package, contrasts.fit() function is very useful. I am > wondering whether there is a similar function for lme object, which > means given a mixed linear model fit, compute estimated coefficients > and standard errors for a given set of contrasts. > > Thanks, > Shirley > > ______________________________________________ > [email protected] 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. > > ---------------------------------------------------------------------- > LEGAL NOTICE > Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. > ______________________________________________ [email protected] 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.
