Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level II

How to make dummy variables in effects type coding instead of 0/1 coding?

I want to add a dummy variable for every crop I use. I this link I found out how to make them but the dummys are in 0/1 coding. (https://community.jmp.com/t5/JMP-Academic-Knowledge-Base/Make-Indicator-Dummy-Variables/ta-p/22636). I would like to change these 0/1 coding in effects type coding (-1,0,1) but I don't know how.

Is there somebody who knows a solution?

In the attachment you find a part of my dataset and the colom from which I want to derive dummys.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff

Re: How to make dummy variables in effects type coding instead of 0/1 coding?

I used your example. I deleted all but the first column with the crop levels. I wrote a script to make the predictor columns for each crop using the nominal modeling type (0,1,-1) and saved it with the data table. Run the script to see the result.

Learn it once, use it forever!
5 REPLIES 5
Highlighted
Staff

Re: How to make dummy variables in effects type coding instead of 0/1 coding?

First of all, why do you need such a column? JMP analysis platforms offer choices about parametrization and will handle it internally for you. See Help > Books > Fitting Linear Models.

Second, see Help > Scripting Index > Functions > Matrix. See the functions named Design(). There are several that create various kinds of indicator columns for you. A script could use this function to create the new columns for you. You can find more information in the Using JMP and Scripting Guide books.

Learn it once, use it forever!
Highlighted
Level II

Re: How to make dummy variables in effects type coding instead of 0/1 coding?

I'm using a non-linear model so the information about the linear model is not very adequte.

I'm determining a common critical value with my model but I also want to determine crop specific critical values. Therefore I need a dummy for every crop. In 0/1 coding not everthing is estimated because there is collinearity so I want to try it with effects-type coding (-1,0,1) to avoid this collinearity.

Also I'm not that familiar with making scripts so that makes it hard to use something in the scripting index

Highlighted
Staff

Re: How to make dummy variables in effects type coding instead of 0/1 coding?

I used your example. I deleted all but the first column with the crop levels. I wrote a script to make the predictor columns for each crop using the nominal modeling type (0,1,-1) and saved it with the data table. Run the script to see the result.

Learn it once, use it forever!
Highlighted
Level II

Re: How to make dummy variables in effects type coding instead of 0/1 coding?

Thank you very much!

Highlighted
Staff

Re: How to make dummy variables in effects type coding instead of 0/1 coding?

See Help > Books > Predictive and Specialized Modeling. I assume that you read the chapter about using the Nonlinear platform and you are specifying a custom model with a column formula. Did you notice the section about using the levels of a categorical predictor (such as crop) as a grouping variable in the model?

Learn it once, use it forever!
Article Labels

There are no labels assigned to this post.