Skip to content

ols_step_forward_p(...) problem using many potential predictors #199

@hirscht

Description

@hirscht

I´m using a large number of potential predictors (larger than the number of predictand values used) with ols_step_forward_p(...) to select the predictors that fulfill the condition set by the p value. This works for most of the cases when p is set to a relatively low value but sometimes I have an error:

Error in Anova.lm(m) :
residual sum of squares is 0 (within rounding error)

This happens when too many potential predictors fulfill the condition set by the p-value, resulting in being selected by the method, which eventially leads to the residual sum of sqaures being zero (Rsquared=1.000). In this case, I only get the Error message above and the result of the selection before the error is lost (not stored in a ols_step_forward_p class object).
Would it be possible to store the calculated values even if there is this error? What I would need the most is the list of the selected predictors (in the order of the selection).

FwMod <- ols_step_forward_p(LinMod, pent = 0.1, progress=TRUE, details=TRUE )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions