BookmarkSubscribeRSS Feed
srinivasansr
Calcite | Level 5

Hi I'm trying to use SAS Studio 3.5 to find which variables affect another variable in a dataset. I know you can use 1 way ANOVA to see if 1 factor affects another variable, but how do you select more than one categorical variable? SAS Studio only lets you select one categorical variable.

7 REPLIES 7
Rick_SAS
SAS Super FREQ

By definition, a "one-way" analysis uses one categorical variable to divide the data into multiple groups.  Are you trying to compare the joint frequencies or check the association between of multiple variables? The name of the SAS Studio task for that is "N-way analysis."

srinivasansr
Calcite | Level 5

Thanks, I too thought N-way ANOVA to be the correct process, but the solution of the project I'm working on tells me to use one way anova, so it confused me a bit. I've attached the solution that my course has provided (Question 3 is the one I'm working on).

 

Also, what are the steps to test the effect of multiple variables on another variable in N-way ANOVA then?

 

Rick_SAS
SAS Super FREQ

If you have questions about a specific exercise, I suggest that you ask your instructor or online support team.

Ksharp
Super User
If you want do ANOVA, proc glm is best choice:

proc glm data=have;
 class a b c;
 model y= a b c /solution;
run;

srinivasansr
Calcite | Level 5

what do you mean by a, b, and c? and what does "/solution" mean?

Rick_SAS
SAS Super FREQ

A SAS Studio task generates SAS code, usually in the form of a call to a SAS procedure.  If you click on the Code tab, you can see the program.  In this case, the call is to PROC GLM.  The SOLUTION option that KSharp mentions is an option in that procedure.

 

You have probably already read the documentation for the N-Way ANOVA task. As you click various buttons in the task, you will see the code change. You can use the doc for the underlying procedure to understand the procedure better, and to invoke options that are not supported by the procedure.

 

After you identify the name of the procedure that is being run,

1. Go to the SAS/STAT User's Guide documentation.

2. In the Contents  tab, click Procedures to expand the reference for procedure.

3. Scroll down and click on the doc for the relevant procedure.

 

In this way you can learn the SAS programming language and discover the meaning of various options/syntax.

srinivasansr
Calcite | Level 5

Thanks. I've tried to do this but because my dataset is so large it takes forever for the process to run (I've been waiting for over half an hour, and since I'm using VMWare to access it, it loses connection after some time), given that I have so many variables. Is there a quicker way to do this?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 3424 views
  • 0 likes
  • 3 in conversation