BookmarkSubscribeRSS Feed
newmkka
Calcite | Level 5

Hello all, please help this question or any link for similar examples.


Q. A researcher is interested in predicting self-esteem(RESE) among University students. He believes that self-esteem can be predicted based on overall stress and happiness levels as well as gender.  Using an appropriate PROC procedure and dummy coding with females(1) as a reference group, run a following model using SAS:

RSESi=b0 + b1*Genderi + b2*Stress_i +  b3*Happiness_i +  b4*Gender_i*Happinessi + e_i

IDbfiebfiabficbfinbfioRSESgenderhappinessstressairscompautprocautrelorIDFburnoutrelqualautaware
13.6253.111113.555563.1254.12.913.503333.272736.682692.93.166672.8753.503339.42863
23.54.111113.888893.53.9423.78194.54.0833333.7815.33333.83333

Thanks in advance.

10 REPLIES 10
Keith
Obsidian | Level 7

This is clearly a homework type question.  Why not try researching it first, running some code and then post a question on here if the code doesn't work?

Doc_Duke
Rhodochrosite | Level 12

Newmkka,

To follow-up on Keith's comments, a good place to start your research would be with a couple of Google searchs:

dummy coding reference group

dummy coding reference group site:sas.com

Doc Muhlbaier

Duke

newmkka
Calcite | Level 5

Hello, I made a dummy variable and run a model in SAS:

data dummy;

set work.Datafile;

    d1 = 0 ;

if gender = "1" then d1 = 1 ; <------- here is right? females(1) reference?

run;

data dummy;

set work.dummy;

Gender_Happiness = gender*happiness;

run;

proc reg data = work.dummy;

  model rses = gender stress happiness Gender_Happiness;

run;

Something wrong can you see? Please collect it. Thanks in advance.

Reeza
Super User

Is females 1? If so, that isn't correct.

See the link below.

FAQ: What is dummy coding?

newmkka
Calcite | Level 5

Thanks your help. Even though I read it, I don't know which part should I modify. Can you help me?

Thanks

SteveDenham
Jade | Level 19

What about:

proc glm data=work.datafile;

class gender(ref=first);

model rses=stress happiness gender gender*happiness/solution;

quit;

PROC GLM is designed for exactly this kind of regression, and the use of the ref= option in the class statement makes it easy to set females as the reference class.

Steve Denham


newmkka
Calcite | Level 5

Thanks for your code. But it has syntax error ("ref=") this. gender value are both 1 and 2. and want females as a reference group. So I use (ref=1). But it doesn't work. Can you help me more?

SteveDenham
Jade | Level 19

What do you mean by "it doesn't work"?  Could you please share your results?  If females are coded in gender as 1, they are first in the category, and so there should be no problem.  It may be just a problem in interpreting the output.

Steve Denham

newmkka
Calcite | Level 5

Finally I got the results. Can you help to interpret these questions? If wrong, collect it please.

1.      Is the overall model significant? Report your finding using APA format.

The overall model is significant, F(11.15) , p = <.0001


2.      Determine which coefficients are statistically significant. Report your findings using APA format.

Happiness is significant (p<.0001), stress is also significant, (p=0.0011), gender*happiness is also significant (p=0.0299). Also dummy code is significant (p=0.026


3.      What is an average level of self-esteem for males?

An average level of self-esteem is 2.39629. (actually I run it again with male as a reference) How to get it without running code again?


4.      What is the estimated effect of happiness and what does it mean?

Happiness Coefficient – For Female (reference group), one unit increase in a number of happiness results in increasing self-esteem by 1.0193


5.      What is the estimated effect of stress and what does it mean?

Stress Coefficient – One unit increase in a number of happiness results in increasing self-esteem by -0.17877


6.      What is the estimated effect of gender and happiness and what does it mean?

Interaction Term (Gender and happiness) - One unit increase in a number of happiness results in increasing self-esteem by -0.61991.


Interaction Term (Gender and happiness) – Since that is an additive effect we could calculate a (1.01936 + (-0.61991) = 0.39945). One unit increase in a number of happiness results in increasing self-esteem by 0.39945.


(which one is correct?)


7.      What is the estimated main effect of gender and what does it mean?

Male have 2.16998 higher values compared to female.


8.       Based on an appropriate statistic determine a model fit. Report your findings.

Based on an R-Square value, the IVs predict an amount 20 percent DV.

dummy.png

SteveDenham
Jade | Level 19

This has obviously developed into a homework/take home exam question.  Interpretation is left to the analyst.

Steve Denham

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 10 replies
  • 1342 views
  • 0 likes
  • 5 in conversation