Subscribe Bookmark RSS Feed

Weights and frequencies in logistic regression

ron_horne

Super User

Joined:

Jun 23, 2011

I came across this situation where the logistic regression outcome is identical when using weights or frequencies. I find it surprising since this would not be the case for linear regression at all. Weights and frequencies have different meaning as in this link: http://blogs.sas.com/content/iml/2013/09/13/frequencies-vs-weights-in-regression.html

Does anyone know the reason for the identical outcome? Shouldn’t some parts of the estimation be different by definition? 

Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window("weighs and Freq",

     H List Box(

           Fit Model(

                Freq( :age ),

                Y( :sex ),

                Effects( :weight ),

                Personality( Nominal Logistic ),

                Run( Likelihood Ratio Tests( 1 ), Wald Tests( 1 ), Odds Ratios( 1 ), Confidence Intervals( 1 ) )

           ),

           Fit Model(

                Weight( :age ),

                Y( :sex ),

                Effects( :weight ),

                Personality( Nominal Logistic ),

                Run( Likelihood Ratio Tests( 1 ), Wald Tests( 1 ), Odds Ratios( 1 ), Confidence Intervals( 1 ) )

           )

     )

);

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

In platforms that are not using least squares or a normal distribution model, weights are treated in an identical fashion to frequencies. (We could probably make that more clear in the first documentation link you listed.)

In the case of logistic regression, the weight variable is treated the same way as if it were specified as a frequency. If a frequency column and a weight column are both specified, the analysis proceeds as if there are frequencies replaced by the frequency column multiplied by the weight column.

Hope that helps,

Michael

Michael Crotty
Sr Statistical Writer
JMP Development
7 REPLIES
ron_horne

Super User

Joined:

Jun 23, 2011

this is what the documentation says about it:

Launch the Fit Model Platform

Frequencies

but i still wouldn't expect to get the exact same results replacing between weights and frequencies.

would be thankful for any help on this.

Solution

In platforms that are not using least squares or a normal distribution model, weights are treated in an identical fashion to frequencies. (We could probably make that more clear in the first documentation link you listed.)

In the case of logistic regression, the weight variable is treated the same way as if it were specified as a frequency. If a frequency column and a weight column are both specified, the analysis proceeds as if there are frequencies replaced by the frequency column multiplied by the weight column.

Hope that helps,

Michael

Michael Crotty
Sr Statistical Writer
JMP Development
ron_horne

Super User

Joined:

Jun 23, 2011

thank you michael@jmp​,

with your permission a few more clarifications please:

  1. "...weights are treated in an identical fashion to frequencies." - is this documented anywhere? or indicated anywhere in the output?
  2. "...  If a frequency column and a weight column are both specified, the analysis proceeds as if there are frequencies replaced by the frequency column multiplied by the weight column.  " - i am not sure what this means can you please give a reference to the equivalent in SAS documentation?
  3. so all in all there is no way to do a weighted sample logistic regression in JMP?

best,

ron

michael_jmp

Staff

Joined:

Jun 23, 2011

Hi ron_horne​,

I hope these responses will help clarify your questions:

1. As I said in my original response, we could do a better job of documenting this. It's really only implied by the description of Weights in the Launch Fit Model section, but I'll make a note to make the description more explicit in future versions.

2. I'm not sure of an equivalent in SAS documentation, but the idea is that if you specify both a frequency and a weight column, it should be equivalent to creating a new column that multiplies the frequency and weight columns together and then uses that new column as a frequency column in the analysis.

3. I'm not sure what type of weighted sample logistic regression you're trying to do. Can you provide an example of what you would expect to see for such an analysis?

Best,
Michael

Michael Crotty
Sr Statistical Writer
JMP Development
ron_horne

Super User

Joined:

Jun 23, 2011

michael@jmp,

Thank you for the extra clarification.

if i understand it correctly, in the SAS documentation of the logistic regression there is a difference between Weights:

SAS/STAT(R) 9.3 User's Guide

and Frequencies:

SAS/STAT(R) 9.3 User's Guide

is there a way in JMP of reproducing a regression estimate with the weights statement as in SAS?

ron.

michael_jmp

Staff

Joined:

Jun 23, 2011

Ron,

I tried running the Big Class example in PROC LOGISTIC using :age as a weight variable, and it seemed like it matched the output from JMP using :age as a weight or a freq variable.

proc logistic data=big_class;

  weight age;

  model sex = weight;

run;

Regards,

Michael

Michael Crotty
Sr Statistical Writer
JMP Development
ron_horne

Super User

Joined:

Jun 23, 2011

thanks michael@jmp​,

this is not what one would expect from the different description in the SAS documentation.

would you happen to know the reason why logistic regression behaves differently than the linear on this?

ron