Hi Community,
I have an error my code and error is as follows
> Best_Subset <-
+ regsubsets(LOFVOL~.,
+ data =QMean,
+ nbest = 1, # 1 best model for each number of predictors
+ nvmax = NULL, # NULL for no limit on number of variables
+ force.in = NULL, force.out = NULL,
+ method = "exhaustive")
> summary_best_subset <- summary(regsubsets.out)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'object' in selecting a method for function 'summary': object 'regsubsets.out' not found
seems like you are trying to summarise something you didnt make (regsubsets.out).
immediately before the summary() you made something called Best_Subset (which is not regsubsets.out)
at step 3. Regsubsets()
Run the regsubsets() function on all variables.
Best_Subset <-
regsubsets(area~.,
data =fires.clean1,
nbest = 1, # 1 best model for each number of predictors
nvmax = NULL, # NULL for no limit on number of variables
force.in = NULL, force.out = NULL,
method = "exhaustive")
summary_best_subset <- summary(regsubsets.out)
as.data.frame(summary_best_subset$outmat)