Regression of a Data Frame with multiple factor groupings
问题 I am working on a regression script. I have a data.frame with roughly 130 columns, of which I need to do a regression for one column (lets call it X column) against all the other ~100 numeric columns. Before the regression is calculated, I need to group the data by 4 factors: myDat$Recipe , myDat$Step , myDat$Stage , and myDat$Prod while still keeping the other ~100 columns and row data attached for the regression. Then I need to do a regression of each column ~ X column and print out the R^2