domingo, 14 de febrero de 2016

Assignment 1: Hypothesis testing and ANOVA

Coursera: Hypothesis testing and ANOVA assignment

1.- Analysis question:

I want to verify whether the topic that states that married people are fatter than single ones is true or not.
NOTE: as I have no previous knowledge of SAS, I stuck to a question that allowed me to complete the assignment by using as less code as possible. Sorry for the simplicity of the exercise.
I have used the NESARC data set to compare the WEIGHT field means by the SPOUSE groups.

2.- Code used:

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

LABEL SPOUSE="MARRIED OR UNMARRIED"
                  WEIGHT="WEIGHT IN POUNDS"



PROC SORT; by IDNUM;

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

RUN;



3.- Results

Información de nivel de clase
Clase
Niveles
Valores
SPOUSE
2
1 2


Número de observaciones leídas
43093
Número de observaciones usadas
43093

Fuente
DF
Suma de cuadrados
Cuadrado de la media
F-Valor
Pr > F
Modelo
1
51114964804
51114964804
4663.93
<.0001
Error
43091
472261177300
10959624.453


Total corregido
43092
523376142103





R-cuadrado
Coef Var
Raíz MSE
WEIGHT Media
0.097664
68.62655
3310.532
4823.982


Fuente
DF
Anova SS
Cuadrado de la media
F-Valor
Pr > F
SPOUSE
1
51114964804
51114964804
4663.93
<.0001




Nivel de
SPOUSE
N
WEIGHT
Mean
Dev std
1
19810
6004.70424
3536.74459
2
23283
3819.38097
3105.11566

4.- Interpretation:


As the means for both groups are different enough (6004,7 vs 3819.4) and the level of significance is under 0,0001, we can conclude that married people are statistically likely to be fatter than unmarried ones. 

No hay comentarios:

Publicar un comentario