Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug in the stepwise selection functions #56

Closed
wants to merge 1 commit into from

Conversation

gregorsteiner
Copy link
Collaborator

@gregorsteiner gregorsteiner commented Jun 6, 2023

Theresa made me aware of a bug in backward(), see e.g. the following code:

data(sex2)

data_curr = sex2
FU_fit = logistf(formula = as.formula("case ~ age+oc+vic+vicl+vis+dia"), data = data_curr, flic = TRUE, model = TRUE)
backward(FU_fit)
rm(data_curr)

data_curr = data.frame()

f1 = function() {
  data_curr = sex2
  FU_fit = logistf(formula = as.formula("case ~ age+oc+vic+vicl+vis+dia"), data = data_curr, flic = TRUE, model = TRUE)
  backward(FU_fit)
}

f1()

This causes an error in the eval step because the dataset is not found in the parent environment (if it is also in the global environment, there is no problem). However, I think the eval step is not necessary, so in backward() and forward(), I removed the model.frame() and eval() step. This seems to solve the issue, but might have some unintended consequences elsewhere. So, I will do some more testing before merging this.

In backward() and forward(), I removed the model.frame() and eval() step. This seems to solve the issue but might have some unintended consequences elsewhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant