Error in h(simpleError(msg, call)) : error in evaluating the argument 'object' in selecting a method for function

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

Please help me out and thanks in advance

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)

Thanks for your response
I was trying to find the best model for my variables to predict the response by regression.
I was following the script from the following using "leaps"package
https://medium.com/towards-data-science/selecting-the-best-predictors-for-linear-regression-in-r-f385bf3d93e9

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)

I have resolved thanks for your help with the script which I am referring was wrong

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.