I have created a linear model with the R program. And I have predicted a new variable using the model. Running the model, it will print the output of prediction 600 times! (the number of variables we have in the data set). Here is the code:
load(sports)
summary (sports)
ls(sports)
fit = lm(sport_score ~ sport_votes + sport_rating , data = sports)
summary(fit)
newdata = data.frame( sport_vote = 80, sport_rating = 7.7)
predict(fit, newdata, interval="predict")
How can I print the output just once?