I'm new to R and I cannot figure out the following:
mydata <- read.table("<PATH>", header=TRUE )
mydata has 3 columns, N, Age and Expenditures.
I've tried:
predict(mydata$Expenditure, data.frame(Age=c(50, 25)))
predict(mydata, data.frame(Age=c(50, 25)))
It's a simple linear regression, and I'm trying to predict Expenditure with Age 50 and 25. But it keeps returning
no applicable method for 'predict' applied to an object of class "data.frame"
I figured that this shouldn't be this hard in R, what's going wrong?