Purpose Study “Next Stage Purpose” Results

MLQ w/o searching for purpose questions

setwd("/Users/levibrackman/Desktop/Adult_study")
data_pre <- read.csv("pre.csv")
data_post <- read.csv("post.csv")

table(data_pre$GROUP, dnn = "group")
## group
##  0  1 
## 35 32
data <- merge(data_pre, data_post, by = "ID", all = TRUE)

library(psych)
library(lattice)
# Time 1 MLG
items <- grep("MLQ[0-9]*.x", names(data), value = TRUE)
scaleKey <- c(1, 1, 1, 1, 1, 1, 1, 1, -1, 1)
data$meanT1mlq <- scoreItems(scaleKey, items = data[, items], delete = FALSE)$score
# T2 MLQ
items <- grep("MLQ[0-9]*.y", names(data), value = TRUE)
scaleKey <- c(1, 1, 1, 1, 1, 1, 1, 1, -1, 1)
data$meanT2mlq <- scoreItems(scaleKey, items = data[, items], delete = FALSE)$score

# Only the Purpose questions in MLQ leaving out the searching for purpose
data$T1MLQP <- apply(data[, c("MLQ1.x", "MLQ4.x", "MLQ5.x", "MLQ6.x", "meanT1mlq")], 
    1, mean, na.rm = TRUE)
data$T2MLQP <- apply(data[, c("MLQ1.y", "MLQ4.y", "MLQ5.y", "MLQ6.y", "meanT2mlq")], 
    1, mean, na.rm = TRUE)

plot(data$T1MLQP, data$T2MLQP, ylab = "Pre", xlab = "Post", main = "Purpose")

plot of chunk unnamed-chunk-1

# pre test plots
bwplot(GROUP.x ~ T1MLQP, ylab = "GROUP", xlab = "MLQ", main = "Pre test", data = data)

plot of chunk unnamed-chunk-1

# post test plots
bwplot(GROUP.x ~ T2MLQP, ylab = "Group", xlab = "MLQ", main = "Post test", data = data)

plot of chunk unnamed-chunk-1

# Pre test
t.test(T1MLQP ~ GROUP.x, data = data)
## 
##  Welch Two Sample t-test
## 
## data:  T1MLQP by GROUP.x
## t = 0.4799, df = 60.36, p-value = 0.633
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.4041  0.6593
## sample estimates:
## mean in group 0 mean in group 1 
##           4.806           4.678
t.test(T2MLQP ~ GROUP.x, data = data)
## 
##  Welch Two Sample t-test
## 
## data:  T2MLQP by GROUP.x
## t = -3.333, df = 64.62, p-value = 0.001425
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.9258 -0.2320
## sample estimates:
## mean in group 0 mean in group 1 
##           5.195           5.774
# Ancova, Model for MLQ
MLQP_ANCOVA <- lm(T2MLQP ~ as.factor(GROUP.x) + T1MLQP, data = data)
# check assumptions visually
plot(MLQP_ANCOVA)

plot of chunk unnamed-chunk-1 plot of chunk unnamed-chunk-1 plot of chunk unnamed-chunk-1 plot of chunk unnamed-chunk-1

# see results
summary(MLQP_ANCOVA)
## 
## Call:
## lm(formula = T2MLQP ~ as.factor(GROUP.x) + T1MLQP, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.5237 -0.2558  0.0306  0.4543  1.3434 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           3.8031     0.3753   10.13  6.2e-15 ***
## as.factor(GROUP.x)1   0.6158     0.1590    3.87  0.00025 ***
## T1MLQP                0.2896     0.0747    3.88  0.00025 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.649 on 64 degrees of freedom
##   (2 observations deleted due to missingness)
## Multiple R-squared:  0.307,  Adjusted R-squared:  0.285 
## F-statistic: 14.2 on 2 and 64 DF,  p-value: 8.03e-06