Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:34:38+00:00 2026-06-09T01:34:38+00:00

I am trying to get the final model using backward elimination with R but

  • 0

I am trying to get the final model using backward elimination with R but I got the following error message when I ran the code. Could anyone please help me this?

base<-lm(Eeff~NDF,data=phuong)
fullmodel<-lm(Eeff~NDF+ADF+CP+NEL+DMI+FCM,data=phuong)
 step(full, direction = "backward", trace=FALSE )

> Error in step(full, direction = "backward", trace = FALSE) : 
number of rows in use has changed: remove missing values?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:34:40+00:00Added an answer on June 9, 2026 at 1:34 am

    When comparing different submodels, it is necessary that they be fitted to the same set of data — otherwise the results just don’t make sense. (Consider the extreme situation where you have two predictors A and B, which are each measured on only half of your observations — then the model y~A+B will be fitted to all the data, but the models y~A and y~B will be fitted to non-overlapping subsets of the data.) Thus, step won’t allow you to compare submodels that (because of automatic removal of cases containing NA values) are using different subsets of the original data set.

    Using na.omit on the original data set should fix the problem.

    fullmodel <- lm(Eeff ~ NDF + ADF + CP + NEL + DMI + FCM, data = na.omit(phuong))
    step(fullmodel, direction = "backward", trace=FALSE ) 
    

    However, if you have a lot of NA values in different predictors, you may end up losing a lot of your data set — in an extreme case you could lose the entire data set. If this happens you have to reconsider your modeling strategy …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to consume a .net web service, and get the following error
I got this error when trying to access 'model' and 'CRUD' generator in gii.
I'm trying to instantiate a generic class in Spring, but I get following exception:
I'm trying to get a real equivalent for Java's public static final in Scala
I am trying get all html links within a string and replace them using
I am trying get all html links within a string and replace them using
I am trying get Struts 2 and Tiles to work and I am using
I am using jboss-as-7.1.0.Final-SNAPSHOT and trying to set up custom login module that uses
How to get Order No. at event sales_order_place_after using event-observer model? I want to
I'm using JSF2.0 with Spring Webflow 2.3 . I've been trying to get information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.