domingo, 6 de marzo de 2016

Assignment 4: Moderators

1.- Research question:

On my first assignment, where we had to run an ANOVA Test  I wanted to demonstrate that people who live with a partned have a statistically higher body weight than thos who lived alone.

Now, I am going to introduce a moderator into the equation; Gender. I want to know if the relation is different for men and for women.

2.- Code used:

LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly;
DATA new; set mydata.nesarc_pds;

PROC SORT; BY SEX;

PROC ANOVA; CLASS SPOUSE;
MODEL WEIGHT=SPOUSE;
MEANS SPOUSE;BY SEX;


RUN;

3.- Results:

Procedimiento ANOVA
Información de nivel de clase
ClaseNivelesValores
SPOUSE21 2
Número de observaciones leídas18518
Número de observaciones usadas18518

Procedimiento ANOVA
Variable dependiente: WEIGHT
FuenteDFSuma de cuadradosCuadrado de la mediaF-ValorPr > F
Modelo117586689181175866891811325.30<.0001
Error1851624570682492413269973.262  
Total corregido18517263293514104   
R-cuadradoCoef VarRaíz MSEWEIGHT Media
0.06679567.717993642.7975379.365
FuenteDFAnova SSCuadrado de la mediaF-ValorPr > F
SPOUSE117586689181175866891811325.30<.0001

Procedimiento ANOVA
Distribución de WEIGHT por SPOUSE
Nivel de
SPOUSE
NWEIGHT
MediaDev std
194406335.026023751.07691
290784385.594443526.67543

Procedimiento ANOVA
Información de nivel de clase
ClaseNivelesValores
SPOUSE21 2
Número de observaciones leídas24575
Número de observaciones usadas24575

Procedimiento ANOVA
Variable dependiente: WEIGHT
FuenteDFSuma de cuadradosCuadrado de la mediaF-ValorPr > F
Modelo130250318951302503189513381.65<.0001
Error245732198163544818945442.3343  
Total corregido24574250066673433   
R-cuadradoCoef VarRaíz MSEWEIGHT Media
0.12096967.890232990.8934405.484
FuenteDFAnova SSCuadrado de la mediaF-ValorPr > F
SPOUSE130250318951302503189513381.65<.0001

Procedimiento ANOVA
Distribución de WEIGHT por SPOUSE
Nivel de
SPOUSE
NWEIGHT
MediaDev std
1103705704.006303301.22494
2142053457.530502742.26209
4.- Interpretation:
What SAS tells us is that the relation between living with a partner (Spouse =1) o living without it (Spouse=2)  and the average body weight is statistically sigificant both for men (sex=1) and for women (sex=2). Furthermore, in both cases the relation works in the same direction and with a similar intensity. Thus we can conclude that sex is not a good moderator in this relation.

No hay comentarios:

Publicar un comentario