Richard, I'm not sure I fully understand your question but the flexmix package does mixtures of linear models which may be what you want. Hth, Ingmar
> From: "Richard A. O'Keefe" <[EMAIL PROTECTED]> > Date: Wed, 4 Oct 2006 18:36:55 +1300 (NZDT) > To: <r-help@stat.math.ethz.ch> > Subject: [R] Linear model with hidden variables > > > I have some data on a moving vehicle where, amongst other things, > it looks as though it would be informative to fit a model with the > following structure: > > Z = B.Y + errorz > Y = C.X + errorz > > The X variables are observed predictor variables; > 6 of the variables look promising (on the basis of what they mean). > > The Z variables are observed response variables; > there are 4 of them. > > There is a priori reason to believe, and scatterplots to suggest, > that the Z variables are really essentially two-dimensional, so > > the Y variables are "hidden" intermediate variables. > There should be 2 of them. There are actually two physical candidates > for what they might be, but they happen not to have been measured. > > There are 800 cases. (More precisely, there are 14 periods, each with > about 800 samples, and I am interested in fitting a separate model in > each period.) > > A simple least squares fit for this model would minimise the sum of > error squares for the Zs. Oh, I do mean there to be constant terms. > > I suppose I could go back to first principles and work it all out, > but has anyone ever done something like this in R? There seems to > be every imaginable variation on lm and some that I find unimaginable, > so presumably a means to do this is already around somewhere. > > ______________________________________________ > R-help@stat.math.ethz.ch 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. ______________________________________________ R-help@stat.math.ethz.ch 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.