cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Jogger560
Level I

Change the default -1 1 coding of categorical variable to 0 1 coding

Dear JMP community, 

 

I found that when fitting a multiple linear regression (y ~ X1 + X2, X1 is a continuous and X2 is a categorical variable), by default JMP defines the dummy variable X2 as -1 1. Is there a way to change it to 0 1, which will be the same as the default dummy variable coding as R? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
MRB3855
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Hi @Jogger560 : In the red triangle pull down menu at the top of the Fit Model output, there is an option for Indicator Parameterization Estimates.

MRB3855_0-1726474958717.png

 

View solution in original post

10 REPLIES 10
MRB3855
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Hi @Jogger560 : In the red triangle pull down menu at the top of the Fit Model output, there is an option for Indicator Parameterization Estimates.

MRB3855_0-1726474958717.png

 

Jogger560
Level I

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Thanks very much! I also need to get the correlation of estimates under the 0, 1 coding coding, is there a way to do that? 

MRB3855
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Deleted

 

MRB3855
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Hi @Jogger560 : Hmm, Some JMP folks may want to jump in here but I don't think that is directly available. You can get it yourself though. The Var-Cov matrix of the OLS Estimates is defined on page 8 here.

https://web.stanford.edu/~mrosenfe/soc_meth_proj3/matrix_OLS_NYU_notes.pdf

statman
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Advice for coding of factor levels consistently is equivalent-distant, centered on 0.  So -1, 1 for 2-levels, -1,0,1 for 3-levels.

 

This a quote from Mark Bailey:  Coding benefits the analysis in several ways:

 

  • The parameter estimates are comparable.They are independent of the associated scale (units).
  • The parameter estimates are interpretable. The intercept when estimated with real values is the response when all your factors are zero. What does that mean? With coding, the intercept is the mean response at the origin (center) of your design. The other parameters still represent the change in the response for 1 unit change in the factor, but in the coded space, 1 unit change is half the range. Double the estimate and that is the change in the response over the full range of the factor.
  • The parameter estimates are uncorrelated or minimally correlated. This preserves power for the significance tests.
"All models are wrong, some are useful" G.E.P. Box
MRB3855
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Hi @statman : I understood his question to be about the categorial factor (X2 in his OP); you seem to be discussing the covariate X1?

statman
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

The coding applies to any type of factor in an experiment, continuous or categorical.  This allows for easy comparison of the coefficients for analysis.

"All models are wrong, some are useful" G.E.P. Box
MRB3855
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

Hi @statman : Perhaps, but your first and third  bullets don't seem relevant for X2 categorical. 

statman
Super User

Re: Change the default -1 1 coding of categorical variable to 0 1 coding

I just copied and pasted Mark Baileys comments on factor coding...I didn't want to cherry pick what he wrote:

 

https://community.jmp.com/t5/Discussions/DOE-Code-and-Uncoded-levels-of-factor/td-p/61864

 

"All models are wrong, some are useful" G.E.P. Box