I'm trying to look for simple patterns in weather data. Here's a simplified version of what I'm working with.
day <- c(4, 5, 6, 8) temp <- c(97, 100, 98, 80) humidity <- c(62, 46, 50, 55)
Suppose I wanted to predict the temperature on day 7 and day 9 (neither are listed) using the following factors. Which R command would I use to do this?
I know how do predictions using 2 variables.
(updated using Greg Snow's answer)
fit <- lm(temp ~ day) newdat <- data.frame( day=c(7,9) ) predict(fit, newdat)
But how would I go about using more than 2?
Your help would be greatly appreciated.