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.
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" <ok at cs.otago.ac.nz> > Date: Wed, 4 Oct 2006 18:36:55 +1300 (NZDT) > To: <r-help at 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 at 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.
Dear Richard, This looks like a latent-variable structural-equation model of the kind that one can fit with the sem package. If, however, both of the Y's affect all of the Z's, then the model isn't identified. (You also don't say what you assume about the errors from different equations -- are they correlated?) I hope this helps, John -------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox --------------------------------> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > Richard A. O'Keefe > Sent: Wednesday, October 04, 2006 12:37 AM > To: r-help at 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 at 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.
Apparently Analagous Threads
- WDI package commands timing out and not working
- compare two data frames of different dimensions and only keep unique rows
- simtest for Dunnett's test
- Running libvirtd outside of a shell results in qemu defunct processes
- WDI package commands timing out and not working