I have a question regarding regression analysis on a dataset were the input values generate different results over time:


1 2
2 2
3 5
4 1
2 5
3 8

How would I go about doing the regression on such a dataset, since the values change?


What do you mean by "the input values generate different results over time?" This happens a lot in regression analysis, and isn't typically a problem.

You could start by loading your data into R, and running a simple linear model.




In the case of your example data, a simple linear model is terrible. Can you be more specific about what you're trying to do?

/edit: In response to suncoolso: once you've fit a simple linear model, you can use the "gls" command from the "nlme" package to fit a simple linear model with an autoregressive correlation structure.

  • $\begingroup$ I think aeWiardll is implying that there is a correlation (or some similar structure) in the data. Therefore, the simple assumption of independence of lm is probably not what @eWizardll is looking for. I hope the answer to your question would make things clearer. $\endgroup$ – suncoolsu Jan 22 '11 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.