BookmarkSubscribeRSS Feed
berylsky1
Fluorite | Level 6

Hi all,

 

I am doing multiple linear regression using proc survreg and want to test interaction between stressors and gender. I want to know if my codes below are correct for the model 1 and model 2. I really appreciate any feedback.

 

This was a list of variables I used for the analysis.

Gen2_cat= gender (binary)

ethnicity_group= ethnicity (4 categorical)

maritalstatus_dummy=marital status (binary)

nativity2=nativity (binary)

COVID_ImpactOverall_new= continuous

FAsocitalracism= continuous

Socialstressors4= continuous

materialstressors4 = continuous

Age_BirthYear_Calculate= continuous

miss_binary('1') = complete sample

 

/*Model1: Interaction Stressors*Gender – Interaction Testing*/
proc surveyreg data=mental8 alpha=0.05; /*alpha-set alpha level*/
 class gen2_cat (ref="0") ethnicity_group (ref="0") maritalstatus_dummy (ref="0") nativity2_cat (ref="0"); /*reference*/
 model COVID_ImpactOverall_new= FAsocitalracism socialstressor4_v1 materialstressors4  FAsocitalracism*gen2_cat socialstressor4_v1*gen2_cat materialstressors4*gen2_cat Age_BirthYear_Calculate gen2_cat ethnicity_group maritalstatus_dummy nativity2_cat income_new_n edu5_cat_n/solution CLPARM STB ADJRSQ;/*CLPARM=display 95%CI*/
 weight WEIGHTS_A7;
 domain miss_binary('1');
run;

The interaction between stressors and gender I got :

FAsocitalracism*gen2_cat : p=0.3537

socialstressor4_v1*gen2_cat : p=0.015

materialstressors4*gen2_cat : p=0.486

Since interaction social stressor and gender was significant, I would like to stratify the model by gender. In this case, should I include all stressors or just social stressor in the stratified model?

 

/*Model2: Stratified by Gender*/
proc surveyreg data=mental8 alpha=0.05; /*alpha-set alpha level*/
 class gen2_cat (ref="0") ethnicity_group (ref="0") maritalstatus_dummy (ref="0") nativity2_cat (ref="0"); /*reference*/
 model COVID_ImpactOverall_new= FAsocitalracism socialstressor4_v1 materialstressors4  Age_BirthYear_Calculate ethnicity_group maritalstatus_dummy 
 nativity2_cat income_new_n edu5_cat_n/solution CLPARM STB ADJRSQ;/*CLPARM=display 95%CI*/
 weight WEIGHTS_A7;
 domain miss_binary('1')*gen2_cat; /*stratify by gender*/
run;

Also, I want to know how I can get predicted mean mental health by stressors (i.e., FAsocitalracism, socialstressor4, materialstressors4) for female and male in proc surveyreg and create a graph based on the results (like the graph I attached below). 

 

berylsky1_0-1715134058213.png

 

I would appreciate if you could help me with this! Thank you in advance!

Looking forward to your response!!!

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 628 views
  • 0 likes
  • 1 in conversation