Description Usage Format Source References Examples
This dataset gives the PSS (stress measurement) for 26 people in prison at the entry and at the exit. Part of these people were physically trained during their imprisonment.
1 |
A dataframe with 26 rows and 4 columns.
[,1] | Subject | factor | anonymous subjects |
[,2] | Group | factor | sport or control |
[,3] | PSSbefore | numeric | stress measurement before training |
[,4] | PSSafter | numeric | stress measurement after training |
Private communication. Charlotte Verdot, CRIS, Lyon 1 University, FRANCE
Verdot, C., Champely, S., Massarelli, R. and Clement, M. (2008) Physical activities in prison as a tool to ameliorate detainees mood and well-being. International Review on Sport and Violence, 2.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | data(PrisonStress)
# The two groups are not randomized!
# The control group is less stressed before the experiment
with(PrisonStress,boxplot(PSSbefore~Group,ylab="Stress at the eginning of the study"))
# But more stressed at the end!
with(PrisonStress,boxplot(PSSafter~Group,ylab="22 weeks later"))
# So the effects of physical training seems promising
with(PrisonStress,plot(paired(PSSbefore,PSSafter),groups=Group,type="BA",facet=FALSE))
# Testing using gain scores analysis
difference<-PrisonStress$PSSafter-PrisonStress$PSSbefore
t.test(difference~PrisonStress$Group,var.equal=TRUE)
# Testing using ANCOVA
lmJail<-lm(PSSafter~PSSbefore*Group,data=PrisonStress)
anova(lmJail)
# Testing using repeated measures ANOVA
PSS<-c(PrisonStress$PSSbefore,PrisonStress$PSSafter)
Time<-factor(rep(c("Before","After"),c(26,26)))
Subject<-rep(PrisonStress$Subject,2)
Condition<-rep(PrisonStress$Group,2)
aovJail<-aov(PSS~Condition*Time+Error(Subject))
summary(aovJail)
|
Loading required package: MASS
Loading required package: gld
Loading required package: mvtnorm
Loading required package: lattice
Loading required package: ggplot2
Attaching package: 'PairedData'
The following object is masked from 'package:base':
summary
Two Sample t-test
data: difference by PrisonStress$Group
t = 3.8616, df = 24, p-value = 0.0007469
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
5.25916 17.33478
sample estimates:
mean in group Control mean in group Sport
7.363636 -3.933333
Analysis of Variance Table
Response: PSSafter
Df Sum Sq Mean Sq F value Pr(>F)
PSSbefore 1 228.88 228.878 7.0624 0.014383 *
Group 1 281.66 281.663 8.6911 0.007436 **
PSSbefore:Group 1 38.83 38.829 1.1981 0.285534
Residuals 22 712.98 32.408
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Error: Subject
Df Sum Sq Mean Sq F value Pr(>F)
Condition 1 46.8 46.85 0.457 0.506
Residuals 24 2461.9 102.58
Error: Within
Df Sum Sq Mean Sq F value Pr(>F)
Time 1 9.3 9.3 0.343 0.563710
Condition:Time 1 405.0 405.0 14.912 0.000747 ***
Residuals 24 651.7 27.2
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.