What you need is a mixed effects model (lme) which is held in library(nlme).



I suggest you do some basic research on the web or check out Mixed-Effects
Models in S and S-Plus. 

Regards

Wayne




-----Original Message-----
From: J Fresen [mailto:[EMAIL PROTECTED]
Sent: 26 March 2004 06:47
To: [EMAIL PROTECTED]
Subject: [R] model fitting


I am trying to fit a normal linear model with response y and predictor x and
two factors sex and group.
I would like each combination of sex and group to have individual slopes and
then subsequently have parallel slopes.
I tried the model y ~ x*sex*group and it seemed to work for the first case..
Is this how it is supposed to be done?  For the second the model y ~ sex +
group seems to work.
 
In a similar vein I wish to fit a logistic model to a binary response "last"
is terms of two predictors, education and age, and factors "region", "ccm",
"ever", and "diss".  First allowing education and age to have different
slopes at all factor levels.  Secondly, to have parallel slopes at all
factor levels.  We wish to compare the models using AIC, BIC etc.  How do I
specify these models in R?
 
Help would be most appreciated.  I am a relatively new user.
 
John
 
Prof John Fresen (PhD)
Department of Mathematics and Statistics
Medical University of Southern Africa
PO Box 107
MEDUNSA
0204
South Africa
e-mail: [EMAIL PROTECTED]
tel: +27 12 521 4420
 

        [[alternative HTML version deleted]]

______________________________________________
[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


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040       Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]                http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

______________________________________________
[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

Reply via email to