lunes, 28 de marzo de 2016

Assignment 1: Writing about data

Study: Assessment of teenagers physical condition in Barcelona

Sample:


200 Students of the city of Barcelona (Spain). 120 Male and 80 Female with ages comprised between 12 and 16 years old (High school age). Taken by groups of different high-schools (20 education centres) among the different districts of the city


Procedures:

The data collection had 2 steps:

Step 1: InSchool questionnaire covering the following topics:

·         Living conditions (people per household, income group, neighbourhood)
·         Age, weight and height
·         Nutrition habits (by ppresence of different macro-nutrients)
·         Practice of exercise
·         Academical scores

Step 2: Eurofit physical tests. Pre-made physical tests to determine different physical capabilities:

·         Stamina – Course Navette
·         Upper body strength – MedBall launch
·         Lower body strength – Horizontal jumps
·         Flexibility – Full body bends
·         Muscular resistance – Minute crunches
·         Explosive speed – 5x10 courses


Measures:

Explanatory measure observe unvariable living conditions for the student such as in which neighbourhood they live, number of siblings age, sex and height
Other variable conditions are also observed such as; which kind of diet they follow, how much sport they practice, how much time they devote to studying

Response variable considered are weight and body mass indexes, results in the physical tests. Students are categorized by physical prowess from 0 to 10 drawn from the result the get on the eurofit tests.

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.