I have only very basic R skills. I got stuck at one point in the chapter 2.8.6 from the R book from Michael Crowley
The code supplied is:
sapdecay <- read.table("c:\\temp\\sapdecay.txt",header=T)
attach(sapdecay)
names(sapdecay)
sumsq <- function(a,xv=x,yv=y)
{ yf <- exp(-a*xv)
sum((yv-yf)^2) }
sumsq
lm(log(y)~x)
lm
But after I type this:
lm(log(y)~x)
I get this:
Error in model.frame.default(formula = log(y) ~ x, drop.unused.levels = TRUE) :
variable lengths differ (found for 'x')