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: jfresen@medunsa.ac.za tel: +27 12 521 4420 [[alternative HTML version deleted]]
Dear R users, I would like to know if R has any tools to estimate a finite mixture model. Many thanks, Joao Pedro
On Fri, 26 Mar 2004, Joao Pedro W. de Azevedo wrote:> I would like to know if R has any tools to estimate a finite mixture model.It has several. It is strange you did not want to know what they are, but for the sake of others who may be intrigued: See script ch16 in MASS for bivariate mixtures. See package mclust of multivariate normal mixtures. See package flexmix for mixtures of regression models. See package mda for use in discriminant analysis. Also packages fpc, moc, nor1mix, wle (and maybe more). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
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:jfresen@medunsa.ac.za] Sent: 26 March 2004 06:47 To: r-help@stat.math.ethz.ch 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: jfresen@medunsa.ac.za tel: +27 12 521 4420 [[alternative HTML version deleted]] ______________________________________________ R-help@stat.math.ethz.ch 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:kssg@kssg.com http://www.kssg.com The information in this Internet email is confidential and m...{{dropped}}