How to effectively remove Outliers from a binary logistic regression in R
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
"Marcus Tullius" <tull... @europe.com>
Date: Wed, 05 Sep 2012 03:40:56 -0400
Local: Wed, Sep 5 2012 3:40 am
Subject: [R] How to effectively remove Outliers from a binary logistic regression in R
Hallo there,
greetings from Germany.
I have a simple question for you.
I have run a binary logistic model, but there are lots of outliers distorting the real results.
I have tried to get rid of the outliers using the following commands:
remove = -c(56, 303, 365, 391, 512, 746, 859, 940, 1037, 1042, 1138, 1355)
MIGRATION.rebuild <- glm(MIGRATION, subset=remove)
influence(MIGRATION.rebuild) influence.measures(MIGRATION.rebuild)
BUT it did not work.
My question is:
*Do you know a simple R-command which erases outliers and rebuilds the model without them?*
I am including my model below so that you may have an idea of how I am trying to do it.
Thanks in advance for your help.
Francisco M. da Rocha
[[alternative HTML version deleted]]
______________________________________________
R-h... @r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Jim Lemon <j... @bitwrit.com.au>
Date: Wed, 05 Sep 2012 20:15:09 +1000
Local: Wed, Sep 5 2012 6:15 am
Subject: Re: [R] How to effectively remove Outliers from a binary logistic regression in R
On 09/05/2012 05:40 PM, Marcus Tullius wrote:
> Hallo there,
> greetings from Germany.
> I have a simple question for you.
> I have run a binary logistic model, but there are lots of outliers distorting the real results.
> I have tried to get rid of the outliers using the following commands:
> remove = -c(56, 303, 365, 391, 512, 746, 859, 940, 1037, 1042, 1138, 1355)
> MIGRATION.rebuild<- glm(MIGRATION, subset=remove)
> influence(MIGRATION.rebuild)
> influence.measures(MIGRATION.rebuild)
> BUT it did not work.
> My question is:
> *Do you know a simple R-command which erases outliers and rebuilds the model without them?*
> I am including my model below so that you may have an idea of how I am trying to do it.
Hi Francisco,
Your model didn't make it to the help list, but I think that the problem is in your attempt to use the "subset" argument in glm. The vector is supposed to include the indices of the values that you _want_ in the analysis, and it looks like you are trying to remove the values that you _don't_ want. Say you have 2000 rows in your data frame in the model. The "subset" argument should look something like this:
glm(MIGRATION,
subset=!(1:2000 %in% c(56,303,365,391,512,746,859,940,1037,1042,1138, 1355))
Jim
______________________________________________
R-h... @r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
You must
Sign in before you can post messages.
You do not have the permission required to post.