Choose Language Hide Translation Bar

Community Trekker

Joined:

Jun 23, 2011

## Logistic Regression with Categorical Covariate

I am fitting a logistic regression with two covariates , one continuous (say, weight) and the other nominal (say, Gender).  I want to plot the probability of success against the weights for Males and Females within the sample plot, i.e., two probability curves within the same plot, one for males and the other for females.  I am having trouble figuring out how to do this.  Any help is very much appreciated.

2 REPLIES 2

Super User

Joined:

Jun 23, 2011

## Re: Logistic Regression with Categorical Covariate

You can pick "save probability formula" under the red triangle in the fit model report. Then plot the fitted probabilities using e.g graph builder and use the nominal variable as overlay.

Here is a script example that goes through the steps:

dt = Open( "\$ENGLISH_SAMPLE_DATA/Big Class.jmp" );

//create dummy binary column only for this example

dt<<new column("logistic", nominal, formula(If( :height > 63, 1, 0 )));

logfit=Fit Model(

Y( :logistic ),

Effects( :sex, :weight ),

Personality( Nominal Logistic ),

Run( Likelihood Ratio Tests( 1 ), Wald Tests( 0 ))

);

logfit<<save probability formula;

Graph Builder(

Show Control Panel( 0 ),

Variables( X( :weight ), Y( :Name( "Prob[1]" ) ), Overlay( :sex ) ),

Elements( Smoother( X, Y, Legend( 4 ) ) )

);

Community Trekker

Joined:

Jun 23, 2011

## Re: Logistic Regression with Categorical Covariate

Thank you very much.  I appreciate your help.