BookmarkSubscribeRSS Feed
lolol0101
Calcite | Level 5

Newbie at SAS, I did as

 

proc freq data=want;
tables earnings*gender / chisq;
run; 

 

but I doubt it's right because I went to google the methods

to analyze its results?

 

Thank you.

Screenshot 2022-12-30 095316.png

8 REPLIES 8
MarkusWeick
Barite | Level 11

Hi @lolol0101,

my advise would be not to start with test but with (graphical) analysis of the data. For example the frequency distribution of earnings, one per gender. Comparing the distributions might give some ideas about a hypothesis that than can be tested.

So, do you want to show us graphs of the frequency distributions?

Best

Markus

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
Ksharp
Super User
TTest
PROC TTEST
or
Wilcoxon test (nonparameter version of TTest )
PROC NPAR1WAY .... wilcoxon ;


Also calling @Rick_SAS @StatDave to get more statistical method.
lolol0101
Calcite | Level 5
The gender has 3 levels so I would get the error "class variable has more than two levels"

is T-Test still appropriate to use?
Ksharp
Super User

Then try ANOVA .

proc glm data=have;
class gender;
model salary=gender /solution;

lsmean gender/diff pdiff adjust=dutt;
quit;

The better way is non-parameter version of ANOVA as Paige said.
or you could try GAMMA distribution since your salary is all positive.
proc genmod data=have;
class gender;
model salary=gender/dist=gamma;
lsmean gender/diff pdiff adjust=dutt;
run;

lolol0101
Calcite | Level 5

Thank you! last question, what if it's "salary" vs. "age"? (both are numeric)

How does one examine this?

PaigeMiller
Diamond | Level 26

@lolol0101 wrote:

Thank you! last question, what if it's "salary" vs. "age"? (both are numeric)

How does one examine this?


  1. Scatterplot
  2. Regression

 

--
Paige Miller
Ksharp
Super User
As Paige said , Regression .(if you have big data ,also could try ANOVA)
And I would recommend to use violin graph .

https://blogs.sas.com/content/graphicallyspeaking/2012/10/30/violin-plots/

PaigeMiller
Diamond | Level 26

@lolol0101 wrote:

Newbie at SAS, I did as

 

proc freq data=want;
tables earnings*gender / chisq;
run; 

 

but I doubt it's right because I went to google the methods

to analyze its results?


I would say use the Kruskal-Wallis test in PROC NPAR1WAY, which uses the Wilcoxon scores. Example.

 

This is the non-parametric equivalent of a one-way ANOVA. A chi-squared test is not really appropriate for the (almost) continuous variable earnings.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 2181 views
  • 2 likes
  • 4 in conversation