Displaying 1 result from an estimated 1 matches for "zongtestlin".
2010 Apr 27
3
Problem calculating multiple regressions on a data frame.
....fail,
na.exclude... all give the same error message)
I have also tried to follow the approach suggested by Charles Sharpsteen
(http://www.mail-archive.com/r-help@r-project.org/msg74759.html) with
similar results.
The code is as follows:
theModels <- by( theTestLineal, list( theTestLineal$ids,
zongTestLineal$variable), function( dataSlice ){
linMod <- lm( value ~ seqMonth, data = dataSlice )
# Slope and intercept may be recovered from the output of the coef()
function:
intercept <- coef( linMod )[1]
slope <- coef( linMod )[2]
# The R-Squared value is returned by the summary() function:
rs...