Data Cleaning and Preparation- pre wide format 1. Recode Self harm variables to binary and then calculate a new combined binary variable of “any self harm yes/no” 2. Make Attendance variables and last session attended variables
### Code to create binary self-harm variables and presence variables without overwriting the originals ###
library(readxl)
library(dplyr)
library(tidyr)
library(readr)
NoDup_PurrbleAnon <- read_csv("Desktop/Purrbel/NoDup_PurrbleAnon.csv")
Warning: One or more parsing issues, call `problems()` on your data frame for details, e.g.:
dat <- vroom(...)
problems(dat)Rows: 1941 Columns: 140── Column specification ─────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (40): psid, randomization, so, gi, ethnicity, identity_group, startdate, orientation, identity, endda...
dbl (89): Week, age, source, status, progress, durationinseconds, finished, selfharm, q251_1, q251_2, q25...
lgl (11): firstname, q45_3_text, q46_6_text, GAD7_Complete, PHQ9_Complete, SHS_Pathways_Complete, SHS_Age...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(NoDup_PurrbleAnon)
NoDup_PurrbleAnon <- NoDup_PurrbleAnon %>%
mutate(
# If missing, then NA. If <= 1 then 0, else 1
SHQ1 = ifelse(is.na(shqscreener1), NA, ifelse(shqscreener1 <= 1, 0, 1)),
SHQ2 = ifelse(is.na(shqscreener2), NA, ifelse(shqscreener2 <= 1, 0, 1)),
SHQ3 = ifelse(is.na(shqscreener3), NA, ifelse(shqscreener3 <= 1, 0, 1))
) %>%
mutate(
# If any of SHQ1, SHQ2, or SHQ3 is missing, SHQ_Any is missing.
# If all three are 0, SHQ_Any is 0, else 1.
SHQ_Any = case_when(
is.na(SHQ1) | is.na(SHQ2) | is.na(SHQ3) ~ NA_real_,
SHQ1 == 0 & SHQ2 == 0 & SHQ3 == 0 ~ 0,
TRUE ~ 1
)
)
Data Cleaning and preparation: 2. Transform from wide to long format 3. Calculate a new condition variable
Note: Do not get confused! In the datset for user ID, T means transgender and C means Cisgender- IT DOES NOT MEAN TREATMENT AND CONTROL. This is based on Seonaid’s original participant tracking database and aligns with all of that data!
Data Cleaning and Preparation: - Calculate pre-test (avg of weeks 1-3) and post-test (average of weeks 10-13) variables
library(readxl)
library(dplyr)
library(tidyr)
library(readr)
# Define the vector of outcomes for which we need pre/post lists
outcomes <- c("shqscreener1", "shqscreener2", "shqscreener3",
"DERS8_Sum", "GAD7_Sum",
"PHQ9_Sum", "SHS_Pathways", "SHS_Agency", "SHS_TotalHope",
"ucla_Sum", "pmerq_Focus_Avg", "pmerq_Distract_Avg", "pmerq_AD_Avg")
# Create the pretest list (weeks 1-3 for each outcome)
pretest_list <- unlist(lapply(outcomes, function(x) paste0(x, "_", 1:3)))
# Create the posttest list (weeks 11-13 for each outcome)
posttest_list <- unlist(lapply(outcomes, function(x) paste0(x, "_", 11:13)))
for (outcome in outcomes) {
# Identify the pre-test columns for this outcome
pre_cols <- pretest_list[grepl(paste0("^", outcome, "_"), pretest_list)]
# Identify the post-test columns for this outcome
post_cols <- posttest_list[grepl(paste0("^", outcome, "_"), posttest_list)]
# Create the names for the new Pre_ and Post_ columns
pre_colname <- paste0("Pre_", outcome)
post_colname <- paste0("Post_", outcome)
# Calculate row means for pre-test columns (weeks 1-3)
purrble_wide[[pre_colname]] <- rowMeans(purrble_wide[, pre_cols, drop = FALSE], na.rm = TRUE)
# Calculate row means for post-test columns (weeks 11-13)
purrble_wide[[post_colname]] <- rowMeans(purrble_wide[, post_cols, drop = FALSE], na.rm = TRUE)
}
View(purrble_wide)
Data Cleaning and Preparation: - Calculate Attendance Variables for Each Week (for later survival curve analyses!) - Calculate “Week of Dropout” Variable
library(dplyr)
# Create a vector of weeks
weeks <- 1:13
# For each week, check if any of that week's columns are non-NA.
# We use `rowSums(!is.na(across(...))) > 0` to check for the presence of any data.
for (w in weeks) {
purrble_wide <- purrble_wide %>%
mutate(!!paste0("ATT", w) := if_else(
rowSums(!is.na(across(ends_with(paste0("_", w))))) > 0,
1,
0
))
}
purrble_wide <- purrble_wide %>%
rowwise() %>%
mutate(Last_Session = {
# Extract the attendance values for all weeks
att_values <- c_across(starts_with("ATT"))
# Check if there is any attendance
if (all(att_values == 0 | is.na(att_values))) {
# If no attendance, set Last_Session to NA
NA_integer_
} else {
# If there is attendance, find the last (max) week attended
max(which(att_values == 1))
}
}) %>%
ungroup()
#View(purrble_wide)
#colnames(purrble_wide)
Reporting baseline descriptive statistics of the sample (characteristics as reported at screening amongst those who were randomized) by condition: identity_group, Age
Problem note for Jess: I need Jess to code the ethnicity data and sexuality data into something usable- need this for reporting before any sort of publication and for all descriptive tables. People were able to write anything they wanted under those variables, so I do not have the ability to engage with the dataset for those accurately.
library(dplyr)
library(psych)
# 1. Continuous variable (e.g., age) by condition
age_desc <- describeBy(purrble_wide$age, purrble_wide$condition, mat = TRUE)
age_desc <- age_desc %>%
select(group1, n, mean, sd, min, max) %>%
rename(
Condition = group1,
N = n,
Mean = mean,
SD = sd,
Min = min,
Max = max
)
cat("**Age by Condition (Baseline)**\n")
**Age by Condition (Baseline)**
print(age_desc)
cat("\n")
# T-test for age by condition
t_result <- t.test(age ~ condition, data = purrble_wide)
cat("T-test for Age by Condition:\n")
T-test for Age by Condition:
print(t_result)
Welch Two Sample t-test
data: age by condition
t = -0.9, df = 152, p-value = 0.4
alternative hypothesis: true difference in means between group Waitlist Control and group Purrble Treatment is not equal to 0
95 percent confidence interval:
-1.098 0.411
sample estimates:
mean in group Waitlist Control mean in group Purrble Treatment
20.1 20.4
cat("\n")
# Effect size (Cohen's d) using psych
cohen <- cohen.d(purrble_wide$age, purrble_wide$condition)
cat("Cohen's d for Age by Condition:\n")
Cohen's d for Age by Condition:
print(cohen)
Call: cohen.d(x = purrble_wide$age, group = purrble_wide$condition)
Cohen d statistic of difference between two means
lower effect upper
[1,] -0.17 0.15 0.46
Multivariate (Mahalanobis) distance between groups
[1] 0.15
r equivalent of difference between two means
data
0.07
cat("\n")
# Categorical Variable (identity_group) by condition
cat("Frequency of 'identity_group' by Condition (Baseline):\n")
Frequency of 'identity_group' by Condition (Baseline):
print(table(purrble_wide$identity_group, purrble_wide$condition))
Waitlist Control Purrble Treatment
c 0 1
C 38 38
TGD 40 37
cat("\n")
Attrition Analysis by Condition Attrition is defined as dropping out of study prior to Week 11. (In other words, someone could have participated in any data collection during weeks 11-13 and count as enrolled).
Result: No difference in attrition by group
# Create an attrition variable: 1 if last session <= 10, else 0
purrble_wide$attrition <- ifelse(purrble_wide$Last_Session <= 10, 1, 0)
# Identify condition levels
cond_levels <- unique(purrble_wide$condition)
cond_levels <- cond_levels[!is.na(cond_levels)]
if (length(cond_levels) != 2) {
stop("This code expects exactly two conditions for the comparison.")
}
# Extract data by condition
cond1_data <- purrble_wide[purrble_wide$condition == cond_levels[1], "attrition", drop = TRUE]
cond2_data <- purrble_wide[purrble_wide$condition == cond_levels[2], "attrition", drop = TRUE]
# Calculate descriptive statistics
cond1_n <- sum(!is.na(cond1_data))
cond1_mean <- mean(cond1_data, na.rm = TRUE)
cond1_sd <- sd(cond1_data, na.rm = TRUE)
cond2_n <- sum(!is.na(cond2_data))
cond2_mean <- mean(cond2_data, na.rm = TRUE)
cond2_sd <- sd(cond2_data, na.rm = TRUE)
# T-test comparing attrition by condition
tt <- t.test(attrition ~ condition, data = purrble_wide)
# Print results
cat("Attrition Analysis by Condition (prior to Week 11):\n\n")
Attrition Analysis by Condition (prior to Week 11):
cat("Means and SD by Condition:\n")
Means and SD by Condition:
cat(cond_levels[1], ": N =", cond1_n, "Mean =", round(cond1_mean, 3), "SD =", round(cond1_sd, 3), "\n")
1 : N = 78 Mean = 0.064 SD = 0.247
cat(cond_levels[2], ": N =", cond2_n, "Mean =", round(cond2_mean, 3), "SD =", round(cond2_sd, 3), "\n\n")
2 : N = 76 Mean = 0.092 SD = 0.291
cat("T-test results:\n")
T-test results:
print(tt)
Welch Two Sample t-test
data: attrition by condition
t = -0.6, df = 147, p-value = 0.5
alternative hypothesis: true difference in means between group Waitlist Control and group Purrble Treatment is not equal to 0
95 percent confidence interval:
-0.114 0.058
sample estimates:
mean in group Waitlist Control mean in group Purrble Treatment
0.0641 0.0921
Baseline Descriptive Analyses T-test to check for baseline differences in outcomes of interest by study condition Result: No difference in baseline pre-test measures
library(dplyr)
library(psych)
# Create vectors of pre- and post-test variables
pre_vars <- c("Pre_shqscreener1", "Pre_shqscreener2", "Pre_shqscreener3",
"Pre_DERS8_Sum", "Pre_GAD7_Sum", "Pre_PHQ9_Sum",
"Pre_SHS_Pathways", "Pre_SHS_Agency", "Pre_SHS_TotalHope",
"Pre_ucla_Sum", "Pre_pmerq_Focus_Avg", "Pre_pmerq_Distract_Avg", "Pre_pmerq_AD_Avg")
post_vars <- c("Post_shqscreener1", "Post_shqscreener2", "Post_shqscreener3",
"Post_DERS8_Sum", "Post_GAD7_Sum", "Post_PHQ9_Sum",
"Post_SHS_Pathways", "Post_SHS_Agency", "Post_SHS_TotalHope",
"Post_ucla_Sum", "Post_pmerq_Focus_Avg", "Post_pmerq_Distract_Avg", "Post_pmerq_AD_Avg")
# Identify condition levels (assuming exactly two conditions)
cond_levels <- unique(purrble_wide$condition)
cond_levels <- cond_levels[!is.na(cond_levels)]
if (length(cond_levels) != 2) {
stop("This code expects exactly two conditions for the t-tests.")
}
# Split data by condition
data_cond1 <- purrble_wide[purrble_wide$condition == cond_levels[1], ]
data_cond2 <- purrble_wide[purrble_wide$condition == cond_levels[2], ]
# Initialize a results data frame
results <- data.frame(
Outcome = character(),
Condition1 = character(),
Condition1_N = numeric(),
Condition1_Mean = numeric(),
Condition1_SD = numeric(),
Condition2 = character(),
Condition2_N = numeric(),
Condition2_Mean = numeric(),
Condition2_SD = numeric(),
df = numeric(),
t = numeric(),
p = numeric(),
CI_Lower = numeric(),
CI_Upper = numeric(),
stringsAsFactors = FALSE
)
# Loop through each pre-test variable and run descriptives and t-test
for (var in pre_vars) {
# Describe by condition
desc1 <- describe(data_cond1[[var]])
desc2 <- describe(data_cond2[[var]])
# Check if we have valid data for both conditions
if (desc1$n > 0 & desc2$n > 0) {
# t-test
tt <- t.test(purrble_wide[[var]] ~ purrble_wide$condition)
# Extract info
n1 <- desc1$n
mean1 <- desc1$mean
sd1 <- desc1$sd
n2 <- desc2$n
mean2 <- desc2$mean
sd2 <- desc2$sd
df_val <- tt$parameter
t_val <- tt$statistic
p_val <- tt$p.value
ci_lower <- tt$conf.int[1]
ci_upper <- tt$conf.int[2]
# Add row to results
results <- rbind(results, data.frame(
Outcome = var,
Condition1 = cond_levels[1],
Condition1_N = n1,
Condition1_Mean = mean1,
Condition1_SD = sd1,
Condition2 = cond_levels[2],
Condition2_N = n2,
Condition2_Mean = mean2,
Condition2_SD = sd2,
df = df_val,
t = t_val,
p = p_val,
CI_Lower = ci_lower,
CI_Upper = ci_upper,
stringsAsFactors = FALSE
))
}
}
cat("Baseline differences in study outcomes by condition\n\n")
Baseline differences in study outcomes by condition
print(results)
NA
ANCOVA Of all outcomes of interest: Examining Intervention Outcome Controlling for Baseline Covariates
# Assuming pre_vars and purrble_wide are defined
pre_vars <- c("Pre_shqscreener1", "Pre_shqscreener2", "Pre_shqscreener3",
"Pre_DERS8_Sum", "Pre_GAD7_Sum", "Pre_PHQ9_Sum",
"Pre_SHS_Pathways", "Pre_SHS_Agency", "Pre_SHS_TotalHope",
"Pre_ucla_Sum", "Pre_pmerq_Focus_Avg", "Pre_pmerq_Distract_Avg", "Pre_pmerq_AD_Avg")
# Identify condition levels
cond_levels <- unique(purrble_wide$condition)
cond_levels <- cond_levels[!is.na(cond_levels)]
if (length(cond_levels) != 2) {
stop("This code expects exactly two conditions for the t-tests.")
}
cat("Baseline differences in study outcomes by condition\n\n")
# Initialize a results data frame
results <- data.frame(
Outcome = character(),
Condition1 = character(),
Condition1_N = numeric(),
Condition1_Mean = numeric(),
Condition1_SD = numeric(),
Condition2 = character(),
Condition2_N = numeric(),
Condition2_Mean = numeric(),
Condition2_SD = numeric(),
df = numeric(),
t = numeric(),
p = numeric(),
CI_Lower = numeric(),
CI_Upper = numeric(),
stringsAsFactors = FALSE
)
for (var in pre_vars) {
# Extract data for both conditions
cond1_data <- purrble_wide[purrble_wide$condition == cond_levels[1], var, drop = TRUE]
cond2_data <- purrble_wide[purrble_wide$condition == cond_levels[2], var, drop = TRUE]
# Compute descriptives
cond1_n <- sum(!is.na(cond1_data))
cond1_mean <- mean(cond1_data, na.rm = TRUE)
cond1_sd <- sd(cond1_data, na.rm = TRUE)
cond2_n <- sum(!is.na(cond2_data))
cond2_mean <- mean(cond2_data, na.rm = TRUE)
cond2_sd <- sd(cond2_data, na.rm = TRUE)
# Only run t-test if both groups have data
if (cond1_n > 0 & cond2_n > 0) {
tt <- t.test(purrble_wide[[var]] ~ purrble_wide$condition)
df_val <- tt$parameter
t_val <- tt$statistic
p_val <- tt$p.value
ci_lower <- tt$conf.int[1]
ci_upper <- tt$conf.int[2]
results <- rbind(results, data.frame(
Outcome = var,
Condition1 = cond_levels[1],
Condition1_N = cond1_n,
Condition1_Mean = cond1_mean,
Condition1_SD = cond1_sd,
Condition2 = cond_levels[2],
Condition2_N = cond2_n,
Condition2_Mean = cond2_mean,
Condition2_SD = cond2_sd,
df = df_val,
t = t_val,
p = p_val,
CI_Lower = ci_lower,
CI_Upper = ci_upper,
stringsAsFactors = FALSE
))
}
}
print(results)
# Define pre-test and post-test variables
pre_vars <- c("Pre_shqscreener1", "Pre_shqscreener2", "Pre_shqscreener3",
"Pre_DERS8_Sum", "Pre_GAD7_Sum", "Pre_PHQ9_Sum",
"Pre_SHS_Pathways", "Pre_SHS_Agency", "Pre_SHS_TotalHope",
"Pre_ucla_Sum", "Pre_pmerq_Focus_Avg", "Pre_pmerq_Distract_Avg", "Pre_pmerq_AD_Avg")
post_vars <- c("Post_shqscreener1", "Post_shqscreener2", "Post_shqscreener3",
"Post_DERS8_Sum", "Post_GAD7_Sum", "Post_PHQ9_Sum",
"Post_SHS_Pathways", "Post_SHS_Agency", "Post_SHS_TotalHope",
"Post_ucla_Sum", "Post_pmerq_Focus_Avg", "Post_pmerq_Distract_Avg", "Post_pmerq_AD_Avg")
# Run ANCOVAs for each post-test variable controlling for the corresponding pre-test variable
for (post_var in post_vars) {
# Identify the corresponding pre variable
pre_var <- sub("^Post_", "Pre_", post_var)
# Ensure that both variables exist in the dataset
if (!(pre_var %in% names(purrble_wide))) {
cat("No corresponding pre-test variable found for:", post_var, "\n")
next
}
# Fit the ANCOVA model
# Model: Post_Test_Outcome ~ condition + Pre_Test_Outcome
formula_str <- paste(post_var, "~ condition +", pre_var)
model <- aov(as.formula(formula_str), data = purrble_wide)
# Print a header and the model summary
cat("\n---------------------------------------\n")
cat("ANCOVA for:", post_var, "controlling for", pre_var, "\n")
cat("---------------------------------------\n")
print(summary(model))
}
---------------------------------------
ANCOVA for: Post_shqscreener1 controlling for Pre_shqscreener1
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 0.2 0.2 0.34 0.56
Pre_shqscreener1 1 51.7 51.7 102.07 <2e-16 ***
Residuals 138 69.9 0.5
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
13 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_shqscreener2 controlling for Pre_shqscreener2
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 0.0 0.0 0.01 0.91
Pre_shqscreener2 1 33.4 33.4 86.45 2.9e-16 ***
Residuals 138 53.4 0.4
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
13 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_shqscreener3 controlling for Pre_shqscreener3
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 0.1 0.06 0.27 0.6
Pre_shqscreener3 1 7.9 7.94 34.59 2.9e-08 ***
Residuals 138 31.7 0.23
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
13 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_DERS8_Sum controlling for Pre_DERS8_Sum
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 410 410 13.1 0.00042 ***
Pre_DERS8_Sum 1 2779 2779 88.5 < 2e-16 ***
Residuals 138 4331 31
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
13 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_GAD7_Sum controlling for Pre_GAD7_Sum
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 54 54 3.5 0.064 .
Pre_GAD7_Sum 1 1311 1311 84.9 4.7e-16 ***
Residuals 138 2132 15
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
13 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_PHQ9_Sum controlling for Pre_PHQ9_Sum
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 111 111 6.2 0.014 *
Pre_PHQ9_Sum 1 3034 3034 170.1 <2e-16 ***
Residuals 138 2461 18
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
13 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_SHS_Pathways controlling for Pre_SHS_Pathways
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 9 9 0.64 0.42
Pre_SHS_Pathways 1 602 602 42.71 1.5e-09 ***
Residuals 125 1763 14
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
26 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_SHS_Agency controlling for Pre_SHS_Agency
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 4 4 0.17 0.68
Pre_SHS_Agency 1 922 922 44.82 6.5e-10 ***
Residuals 125 2572 21
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
26 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_SHS_TotalHope controlling for Pre_SHS_TotalHope
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 24 24 0.42 0.52
Pre_SHS_TotalHope 1 2786 2786 49.03 1.4e-10 ***
Residuals 125 7103 57
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
26 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_ucla_Sum controlling for Pre_ucla_Sum
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 1.8 1.8 1.09 0.3
Pre_ucla_Sum 1 169.7 169.7 105.24 <2e-16 ***
Residuals 124 200.0 1.6
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
27 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_pmerq_Focus_Avg controlling for Pre_pmerq_Focus_Avg
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 0.9 0.9 1.13 0.29
Pre_pmerq_Focus_Avg 1 77.8 77.8 95.44 <2e-16 ***
Residuals 124 101.1 0.8
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
27 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_pmerq_Distract_Avg controlling for Pre_pmerq_Distract_Avg
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 0.6 0.6 0.77 0.38
Pre_pmerq_Distract_Avg 1 35.8 35.8 42.88 1.4e-09 ***
Residuals 124 103.6 0.8
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
27 observations deleted due to missingness
---------------------------------------
ANCOVA for: Post_pmerq_AD_Avg controlling for Pre_pmerq_AD_Avg
---------------------------------------
Df Sum Sq Mean Sq F value Pr(>F)
condition 1 0.8 0.8 1.49 0.22
Pre_pmerq_AD_Avg 1 49.3 49.3 94.79 <2e-16 ***
Residuals 124 64.5 0.5
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
27 observations deleted due to missingness
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Cmd+Shift+K to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.