Re: [R] Logistic Regression output baseline (reference) category

2016-03-25 Thread David Winsemius

> On Mar 25, 2016, at 10:19 PM, Michael Artz  wrote:
> 
> Hi,
>  I have now read an introductory text on regression and I think I do
> understand what the intercept is doing.  However, my original question is
> still unanswered.  I understand that the intercept term is the constant
> that each other term is measured against.  I think baseline is a good word
> for it.  However, it does not represent any one of the x variables by
> itself.

It represents all of the X variables at their reference levels. There are no 
individual intercepts on a variable-by-variable basis. You accepted the notion 
of "baseline" You cannot parcel out single variable intercepts. What would they 
actually mean anyhow?



>  Is there a way in R, to extrapolate the individual x variable
> intercepts from the equation somehow.

If you describe the process by which that could be calculated, we might have 
basis for discussion, but as it is I think you still need to be studying the 
theory more. I don't intend any further resspones on R-help where these 
questions are off-topic, so you should direct any further questions to 
stats.stackexchange.com

> 
> 
> On Tue, Mar 15, 2016 at 8:26 PM, David Winsemius 
> wrote:
> 
>> 
>>> On Mar 15, 2016, at 1:27 PM, Michael Artz 
>> wrote:
>>> 
>>> Hi,
>>>  I am trying to use the summary from the glm function as a data source.
>> I
>>> am using the call sink() then
>>> summary(logisticRegModel)$coefficients then sink().
>> 
>> Since it's a matrix you may need to locate a function that write matrices
>> to files. I seem to remember that the MASS package has one.
>> 
>>> The independent
>>> variables are categorical and thus there is always a baseline value for
>>> every category that is omitted from the glm output.
>> 
>> Well, it's not really omitted, so much as shared among all variables. For
>> further reading in the halp pages consult:
>> 
>> ?model.matrix
>> ?contrasts
>> ?contr.treatment
>> 
>> But you probably need to supplement that with an introductory text that
>> covers R regression defaults.
>> 
>>> I am interested in how
>>> to get the Z column for all of the categorical values.
>> 
>> The Z column? You meant the "z value" column. Again, since it's a matrix
>> you need to use column indexing with "["
>> 
>> summary(logisticRegModel)$coefficients[  , "z value"]
>> 
>> Read up on the summary function for glm objects at:
>> 
>> ?summary.glm
>> 
>> 
>>> I don't see any row
>>> for the reference category.
>> 
>> What do you imagine the (Intercept) row to be doing? If you are having
>> difficulty understanding this (which is not really an R-specific issue)
>> there are probably already several explanations to similar questions on:
>> 
>> http://stats.stackexchange.com/
>> 
>> 
>>> 
>>> How can I get this Z value in the output?
>> 
>> Asked and answered.
>> 

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Logistic Regression output baseline (reference) category

2016-03-25 Thread Michael Artz
Hi,
  I have now read an introductory text on regression and I think I do
understand what the intercept is doing.  However, my original question is
still unanswered.  I understand that the intercept term is the constant
that each other term is measured against.  I think baseline is a good word
for it.  However, it does not represent any one of the x variables by
itself.  Is there a way in R, to extrapolate the individual x variable
intercepts from the equation somehow.


On Tue, Mar 15, 2016 at 8:26 PM, David Winsemius 
wrote:

>
> > On Mar 15, 2016, at 1:27 PM, Michael Artz 
> wrote:
> >
> > Hi,
> >   I am trying to use the summary from the glm function as a data source.
> I
> > am using the call sink() then
> > summary(logisticRegModel)$coefficients then sink().
>
> Since it's a matrix you may need to locate a function that write matrices
> to files. I seem to remember that the MASS package has one.
>
> >  The independent
> > variables are categorical and thus there is always a baseline value for
> > every category that is omitted from the glm output.
>
> Well, it's not really omitted, so much as shared among all variables. For
> further reading in the halp pages consult:
>
> ?model.matrix
> ?contrasts
> ?contr.treatment
>
> But you probably need to supplement that with an introductory text that
> covers R regression defaults.
>
> >  I am interested in how
> > to get the Z column for all of the categorical values.
>
> The Z column? You meant the "z value" column. Again, since it's a matrix
> you need to use column indexing with "["
>
> summary(logisticRegModel)$coefficients[  , "z value"]
>
> Read up on the summary function for glm objects at:
>
> ?summary.glm
>
>
> >  I don't see any row
> > for the reference category.
>
> What do you imagine the (Intercept) row to be doing? If you are having
> difficulty understanding this (which is not really an R-specific issue)
> there are probably already several explanations to similar questions on:
>
> http://stats.stackexchange.com/
>
>
> >
> > How can I get this Z value in the output?
>
> Asked and answered.
>
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> David Winsemius
> Alameda, CA, USA
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Logistic Regression output baseline (reference) category

2016-03-15 Thread David Winsemius

> On Mar 15, 2016, at 1:27 PM, Michael Artz  wrote:
> 
> Hi,
>   I am trying to use the summary from the glm function as a data source. I
> am using the call sink() then
> summary(logisticRegModel)$coefficients then sink().

Since it's a matrix you may need to locate a function that write matrices to 
files. I seem to remember that the MASS package has one. 

>  The independent
> variables are categorical and thus there is always a baseline value for
> every category that is omitted from the glm output.

Well, it's not really omitted, so much as shared among all variables. For 
further reading in the halp pages consult:

?model.matrix
?contrasts
?contr.treatment

But you probably need to supplement that with an introductory text that covers 
R regression defaults.

>  I am interested in how
> to get the Z column for all of the categorical values.

The Z column? You meant the "z value" column. Again, since it's a matrix you 
need to use column indexing with "["

summary(logisticRegModel)$coefficients[  , "z value"]

Read up on the summary function for glm objects at:

?summary.glm


>  I don't see any row
> for the reference category.

What do you imagine the (Intercept) row to be doing? If you are having 
difficulty understanding this (which is not really an R-specific issue) there 
are probably already several explanations to similar questions on:

http://stats.stackexchange.com/

 
> 
> How can I get this Z value in the output?

Asked and answered.

> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Logistic Regression output baseline (reference) category

2016-03-15 Thread Bert Gunter
The reference category is aliased with the constant term in the
default contr.treatment contrasts.

See ?contr.treatment , ?C, ?contrasts

If you don't know what this means, you should probably consult a local
statistical resource or ask about linear model contrasts at a
statistical help website like stats.stackexchange.com. This list is
for R programming questions.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Mar 15, 2016 at 1:27 PM, Michael Artz  wrote:
> Hi,
>I am trying to use the summary from the glm function as a data source. I
> am using the call sink() then
> summary(logisticRegModel)$coefficients then sink().  The independent
> variables are categorical and thus there is always a baseline value for
> every category that is omitted from the glm output.  I am interested in how
> to get the Z column for all of the categorical values.  I don't see any row
> for the reference category.  How can I get this Z value in the output?
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.