# Using lm() with just one variable in R

I've got some baseball stats, RBIs by season, let's say:

player      s1  s2  s3
Brian_Giles 66  68  70
Joe_Thomas  71  72  71
Robin_Yount 71  69  68
Jim_Jones   66  66  65


And I want to do a simple linear regression using lm() on this data to predict their RBI #s in a 4th season. Would I need another variable here to create my formula? How would I most simply complete this linear regression?

I'm trying to work off of this tutorial (http://www.r-bloggers.com/wp-content/uploads/2009/11/simpleLinRegExample1.txt), which seems like I might need a second variable, (I'm new to linear regressions, obviously) but I can't figure out what it should be. The slope of a best-fit line for those three seasons of data?

• Is there a reason not to use each player's average as your prediction for the next season? – dsaxton Jul 27 '15 at 14:52
• I mean, yeah, that makes the most sense, but I'm actually just trying to wrap my head around basic linear regressions and how they're implemented in R. If it means anything, another reason I want to use lm() is because I envision this type of linear model being ideal for golf scores, heading into the 4th round, for example -- the idea being if they're playing well, they'll only play better in that 4th round. Obviously flawed, but interesting, perhaps. – skathan Jul 27 '15 at 15:04
• You will want to read about "regression to the mean" before you do that golf analysis! – whuber Jul 27 '15 at 15:53