cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
smartens
Level I

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

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.

View solution in original post

5 REPLIES 5

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.

smartens
Level I

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

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.

smartens
Level I

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

Thank you very much!

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?

 

Capture.PNG

Recommended Articles