Desktop productivity for business analysts and programmers

create the dummy variables for the character variables in the dataset

Reply
Contributor
Posts: 20

create the dummy variables for the character variables in the dataset

I want to join the two datasets to do the analyzing work, while for one data file, all the variables are characters, so how to transform them?

Super User
Posts: 8,218

Re: create the dummy variables for the character variables in the dataset

Provide an example of what you have and what you want.

 

Art, CEO, AnalystFinder.com

 

Contributor
Posts: 20

Re: create the dummy variables for the character variables in the dataset

sorry for misunderstanding, I am analyzing the customer lifetime value related content, while one variable is called lifstage, which is divided to on-contract, off-contract, expiry,pre-expiry,early tenured, so I want to create dummy virables to modify them, but I do not know how to use sas EG to complete it, or is there any other good methods to finish the relationship analyzing?

Super User
Posts: 24,018

Re: create the dummy variables for the character variables in the dataset

Depending on the model you're running, if you include it in the Categorical or CLASS list SAS will automatically do this for you.

 

Otherwise, here are several ways to create dummy variables:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-dummy-variables-Categorical-Var...

Contributor
Posts: 20

Re: create the dummy variables for the character variables in the dataset

thanks so much for your relay, I have tried the glmmod method, while the final resultes include too many vairables so SAS was filed to open the result¬¬

Super User
Posts: 24,018

Re: create the dummy variables for the character variables in the dataset


@relish wrote:

thanks so much for your relay, I have tried the glmmod method, while the final resultes include too many vairables so SAS was filed to open the result¬¬


Is that failed to open? How many variables did you have? I can only see that happening if you tried to include a continuous variable in the CLASS list. 

Ask a Question
Discussion stats
  • 5 replies
  • 183 views
  • 0 likes
  • 3 in conversation