Hi again! I have a data.frame with the columns y, x1, x2, x3. I would like to fit linear models with one variable at a time, then 2 variables at a time, and then 3. Makes me think of a power set. Anyhow, is there a function to produce the right hand side of the formulas, please? thanks, Laura Holt mailto: lauraholt_983 at hotmail.com R Version 2.1.0 Windows
Power set
4 messages · Laura Holt, Frank E Harrell Jr, Spencer Graves +1 more
Laura Holt wrote:
Hi again! I have a data.frame with the columns y, x1, x2, x3. I would like to fit linear models with one variable at a time, then 2 variables at a time, and then 3. Makes me think of a power set.
Makes me think of irreproducible results if you use the output to select a single model :-) Frank Harrell
Anyhow, is there a function to produce the right hand side of the formulas, please? thanks, Laura Holt mailto: lauraholt_983 at hotmail.com R Version 2.1.0 Windows
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
Hi, Laura: Have you considered "regsubsets" in library(leaps)? Also, have you done an R site search "www.r-project.org" -> search -> "R site search" for something like "all subsets regression"? Consistent with Frank Harrell's comment, comments, I suggest you randomly permute your response variable a hundred or a thousand times and count how many times the procedure finds a non-null model. This might help you calibrate the procedure. The archives include an email from Frank Harrell citing two relevant articles. Hope this helps. spencer graves
Frank E Harrell Jr wrote:
Laura Holt wrote:
Hi again! I have a data.frame with the columns y, x1, x2, x3. I would like to fit linear models with one variable at a time, then 2 variables at a time, and then 3. Makes me think of a power set.
Makes me think of irreproducible results if you use the output to select a single model :-) Frank Harrell
Anyhow, is there a function to produce the right hand side of the formulas, please? thanks, Laura Holt mailto: lauraholt_983 at hotmail.com R Version 2.1.0 Windows
Spencer Graves wrote:
Hi, Laura:
Have you considered "regsubsets" in library(leaps)? Also, have
you done an R site search "www.r-project.org" -> search -> "R site
search" for something like "all subsets regression"?
Or much simpler if you are running R-2.1.0, use RSiteSearch("all subsets
regression")
Best,
Jim
James W. MacDonald Affymetrix and cDNA Microarray Facility University of Michigan Comprehensive Cancer Center 1500 E. Medical Center Drive Ann Arbor MI 48109