I am new to Rstudio and Stack and am trying to calculate the AIC for my model with 8 variables (One dummy) but only 10 observations (Not sure if this is the issue). The code I have run so far is:
library("MASS")
energy_data <- read.table('energy.txt', header = T)
full <- lm(y~., data = energy_data)
Following this, I get the warning
Warning messages:
1: In model.response(mf, "numeric") :
using type = "numeric" with a factor response will be ignored
2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
I have looked at other forum threads but I am not sure if they apply in my case.
I have also tried to run this as a CSV file but in this case I get the error:
Error in model.frame.default(formula = y ~ ., data = Energy, drop.unused.levels = TRUE) : variable lengths differ (found for 'GSP') where GSP is x1
Again this has been asked before but I am unsure how to address in my case.txt data CSV data
Thanks in advance!