Skip to content
Prev 172626 / 398506 Next

Regressão linear

Sueli Rodrigues <srodrigu <at> esalq.usp.br> writes:
You're more likely to get a response if you post to the list
in English (even fractured English).

 Based on what Google translator thinks you said (you want
to perform linear regressions on 6-line subsets of a data set?),
here's a starting point (assuming your data are in a data frame
mydata, and have column names x and y):

splitdat <- split(mydata,rep(1:6,length.out=nrow(mydata))
linfits <- lapply(splitdata,lm,formula=y~x)
coefs <- sapply(linfits,coef)

or something like that.

  Ben Bolker