Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
### Results of prenatal depression and ASQ subscale development
#01.07.2021
### Data preparation ####
#setwd("C:/Users/User/Desktop/Internship/RScripts/Cortisol/Master_Thesis")
setwd("C:/Users/alici/Desktop/Git_Folder/ITU_cortisol_analyses/Master_Thesis")
##libraries
library(dplyr)
library(gtsummary)
library(gdata)
library(rcompanion)
library(tidyverse)
library(broom)
require(foreign)
require(ggplot2)
require(MASS)
require(Hmisc)
library(APAstyler)
## 1. cortisol data ####
load("Rdata/ITU_combined_cortisol_dates_times_wide_format.Rdata")
cort_IDs <- unique(wide_cort$participantID)
## 2. maternal well-being during pregnancy ####
load("Rdata/processed_wellbeingduringpreg_completevars.Rdata")
#for now only sleep, anxiety and CESD are included
cols <- c("1", "2",grep("gestage", names(q_data_complete)),
grep("GWdiff_cort_qclosest", names(q_data_complete)),
grep("Cesd", names(q_data_complete)),
#grep("puqe", names(q_data_complete)),
grep("PSQI", names(q_data_complete)),
#grep("ESS", names(q_data_complete)),
grep("BAI",names(q_data_complete)))
q_data_sub <- q_data_complete[,c(as.numeric(cols))]
## Depressive Symptoms Severity
q_data_sub$Depressive_Symptom_Severity <- NA
q_data_sub$Depressive_Symptom_Severity_num <- NA
for(i in 1:nrow(q_data_sub)){
m <- q_data_sub$Cesd_qclosest_to_cortGW_pregMean[[i]]
if(!is.na(m)){
if(m<16){
q_data_sub$Depressive_Symptom_Severity[[i]] <- "Below_Clinical (CES-D < 16)"
q_data_sub$Depressive_Symptom_Severity_num[[i]] <- 0
}
if(m>=16){
q_data_sub$Depressive_Symptom_Severity[[i]] <- "Clinical (CES-D >= 16)"
q_data_sub$Depressive_Symptom_Severity_num[[i]] <- 1
}
}
}
q_data_sub$Depressive_Symptom_Severity <- factor(q_data_sub$Depressive_Symptom_Severity)
#Anxiety Symptom Severity
q_data_sub$Anxiety_Symptom_Severity <- NA
q_data_sub$Anxiety_Symptom_Severity_num <- NA
for(i in 1:nrow(q_data_sub)){
m <- q_data_sub$BAI_qclosest_to_cortGW_pregMean[[i]]
if(!is.na(m)){
if(m>21){
q_data_sub$Anxiety_Symptom_Severity[[i]] <- "Moderate/Severe"
q_data_sub$Anxiety_Symptom_Severity_num[[i]] <- 1
}
if(m<=21){
q_data_sub$Anxiety_Symptom_Severity[[i]] <- "Low/Normal"
q_data_sub$Anxiety_Symptom_Severity_num[[i]] <- 0
}
}
}
q_data_sub$psych_distress <- rowSums(q_data_sub[,c("Depressive_Symptom_Severity_num",
"Anxiety_Symptom_Severity_num")],
na.rm=F)
### compute additive depression score
q_data_sub$clinD <- NA
for(i in 1:nrow(q_data_sub)){
cesd <- q_data_sub$Cesd_qclosest_to_cortGW[[i]]
if(!is.na(cesd)){
if(cesd >= 16){
q_data_sub$clinD[[i]] <- 1
}
if(cesd < 16){
q_data_sub$clinD[[i]] <- 0
}
}
}
##sum occasions of clinical depression together
q_data_sub <- q_data_sub %>%
group_by(participantID) %>%
mutate(additive_clinD = sum(clinD, na.rm = T))
## data selection
q_data_subx <- q_data_sub[,c("participantID",
"pregstage",
"Cesd_qclosest_to_cortGW_pregMean",
"Depressive_Symptom_Severity",
"Depressive_Symptom_Severity_num",
"BAI_qclosest_to_cortGW_pregMean",
"PSQI_qclosest_to_cortGW_pregMean",
"qclosest_based_clin_Cesd",
"Cesd_qclosest_to_cortGW",
"BAI_qclosest_to_cortGW",
"PSQI_qclosest_to_cortGW",
"additive_clinD")]
## Sample stratification
## those with multiple assessments
at_least_two_assessments <- c()
q_data_subx <- as.data.frame(q_data_subx)
IDs <- unique(q_data_subx$participantID[!is.na(q_data_subx$Cesd_qclosest_to_cortGW)])
for(i in 1:length(IDs)){
ID <- IDs[[i]]
#print(ID)
trims <- unique(q_data_subx[q_data_subx$participantID == ID, c("pregstage")])
#print(length(trims))
if(length(trims) >= 2){
at_least_two_assessments <- append(at_least_two_assessments, ID)
}
}
### Data in wide format
q_data_sub_final <- q_data_subx %>%
tidyr::pivot_wider(
id_cols = c(participantID,
pregstage,
Cesd_qclosest_to_cortGW_pregMean,
Depressive_Symptom_Severity,
Depressive_Symptom_Severity_num,
BAI_qclosest_to_cortGW_pregMean,
PSQI_qclosest_to_cortGW_pregMean,
additive_clinD),
names_from = c(pregstage), # Can accommodate more variables, if needed.
values_from = c(8:11)
)
# #only overall questionnaire score during pregnancy
# q_data_sub_final <- q_data_sub[,c("participantID",
# "Cesd_qclosest_to_cortGW_pregMean",
# "BAI_qclosest_to_cortGW_pregMean",
# "PSQI_qclosest_to_cortGW_pregMean",
# #"WS_CESD_variation_mean",
# "Depressive_Symptom_Severity",
# "Depressive_Symptom_Severity_num",
# "Anxiety_Symptom_Severity",
# "psych_distress")]
# q_data_sub_final <- subset(q_data_sub_final, !duplicated(q_data_sub_final))
# summary(factor(q_data_sub_final$Anxiety_Symptom_Severity)) #n=5, these also have clin depression
# summary(factor(q_data_sub_final$psych_distress))
# summary(factor(q_data_sub_final$Depressive_Symptom_Severity))
# Qs transformations ####
q_data_sub_final$Cesd_qclosest_to_cortGW_pregMean_cent <- c(scale(sqrt(q_data_sub_final$Cesd_qclosest_to_cortGW_pregMean), scale = TRUE))
q_data_sub_final$BAI_qclosest_to_cortGW_pregMean_cent <- c(scale(sqrt(q_data_sub_final$BAI_qclosest_to_cortGW_pregMean), scale = TRUE))
q_data_sub_final$PSQI_qclosest_to_cortGW_pregMean_cent <- c(scale(sqrt(q_data_sub_final$PSQI_qclosest_to_cortGW_pregMean), scale = TRUE))
#add categorical anxiety severity
q_data_sub_final$Anxiety_Severity_greateroneSD_num <- ifelse(q_data_sub_final$BAI_qclosest_to_cortGW_pregMean_cent > 1, 1, 0)
q_data_sub_final$Anxiety_Severity_greateroneSD <- factor(ifelse(q_data_sub_final$BAI_qclosest_to_cortGW_pregMean_cent > 1, "yes", "no"))
q_data_sub_final$Anxiety_Severity_greateroneSD <- factor(q_data_sub_final$Anxiety_Severity_greateroneSD)
#add psych distress score
q_data_sub_final$psych_distress <- rowSums(q_data_sub_final[,c("Depressive_Symptom_Severity_num",
"Anxiety_Severity_greateroneSD_num")],
na.rm=F)
q_data_sub_final$psych_distress <- factor(q_data_sub_final$psych_distress)
q_data_sub_final$PSQI_severity <- NA
for(i in 1:nrow(q_data_sub_final)){
psqi <- q_data_sub_final$PSQI_qclosest_to_cortGW_pregMean_cent[[i]]
if(!is.na(psqi)){
q_data_sub_final$PSQI_severity[[i]] <- "mean"
if(psqi <= -1){
q_data_sub_final$PSQI_severity[[i]] <- "-1SD"
}
if(psqi >= 1){
q_data_sub_final$PSQI_severity[[i]] <- "+1SD"
}
}
}
q_data_sub_final$PSQI_severity <- factor(q_data_sub_final$PSQI_severity)
## 3. maternal follow-up data ####
followUp <- read.delim("Rdata/ITU_1to2YearsFollowup_MaternalandChildQuestionnaires.dat")
names(followUp)[1] <- "participantID"
relevant_followUp <- c("1",
grep("CESD", names(followUp)),
grep("BAI", names(followUp)))
postpartum_followUp <- followUp[,c(as.numeric(relevant_followUp))]
postpartum_followUp$ITU_1.7y_mother_CESD_sum_nomis <- as.numeric(gsub(",", ".", postpartum_followUp$ITU_1.7y_mother_CESD_sum_nomis))
postpartum_followUp$ITU_1.7y_mother_BAI_sum_no_missing <- as.numeric(gsub(",", ".", postpartum_followUp$ITU_1.7y_mother_BAI_sum_no_missing))
postpartum_df <- postpartum_followUp[,c("participantID",
"ITU_1.7y_mother_CESD_sum_nomis",
"ITU_1.7y_mother_BAI_sum_no_missing")]
names(postpartum_df)[2] <- "postpartum_Cesd"
names(postpartum_df)[3] <- "postpartum_BAI"
## Depressive Symptoms Severity
postpartum_df$postpartum_Depressive_Symptom_Severity <- NA
postpartum_df$postpartum_Depressive_Symptom_Severity_num <- NA
for(i in 1:nrow(postpartum_df)){
m <- postpartum_df$postpartum_Cesd[[i]]
if(!is.na(m)){
if(m<16){
postpartum_df$postpartum_Depressive_Symptom_Severity[[i]] <- "Non-Clinical (CES-D < 16)"
postpartum_df$postpartum_Depressive_Symptom_Severity_num[[i]] <- 0
}
if(m>=16){
postpartum_df$postpartum_Depressive_Symptom_Severity[[i]] <- "Clinical (CES-D >= 16)"
postpartum_df$postpartum_Depressive_Symptom_Severity_num[[i]] <- 1
}
}
}
postpartum_df$postpartum_Depressive_Symptom_Severity <- factor(postpartum_df$postpartum_Depressive_Symptom_Severity)
#view(postpartum_df[,c("postpartum_Cesd","postpartum_Depressive_Symptom_Severity_num")])
#Anxiety Symptom Severity
postpartum_df$postpartum_Anxiety_Symptom_Severity <- NA
postpartum_df$postpartum_Anxiety_Symptom_Severity_num <- NA
for(i in 1:nrow(postpartum_df)){
m <- postpartum_df$postpartum_BAI[[i]]
if(!is.na(m)){
if(m>21){
postpartum_df$postpartum_Anxiety_Symptom_Severity[[i]] <- "Moderate/Severe"
postpartum_df$postpartum_Anxiety_Symptom_Severity_num[[i]] <- 1
}
if(m<=21){
postpartum_df$postpartum_Anxiety_Symptom_Severity[[i]] <- "Low/Normal"
postpartum_df$postpartum_Anxiety_Symptom_Severity_num[[i]] <- 0
}
}
}
#summary(factor(postpartum_df$postpartum_Anxiety_Symptom_Severity)) n = 5
#summary(factor(postpartum_df$postpartum_Depressive_Symptom_Severity)) n = 102
### transformations
postpartum_df$postpartum_BAI_cent <- c(scale(sqrt(postpartum_df$postpartum_BAI), scale = TRUE))
postpartum_df$postpartum_Cesd_cent <- c(scale(sqrt(postpartum_df$postpartum_Cesd), scale = TRUE))
### anxiety severity by SD above the sample mean
postpartum_df$postpartum_Anxiety_Severity_greateroneSD_num <- ifelse(postpartum_df$postpartum_BAI_cent > 1, 1, 0)
postpartum_df$postpartum_Anxiety_Severity_greateroneSD <- factor(ifelse(postpartum_df$postpartum_BAI_cent > 1, "yes", "no"))
postpartum_df$postpartum_psych_distress <- rowSums(postpartum_df[,c("postpartum_Depressive_Symptom_Severity_num",
"postpartum_Anxiety_Severity_greateroneSD_num")],
na.rm=F)
postpartum_df$postpartum_psych_distress <- factor(postpartum_df$postpartum_psych_distress)
postpartum_df_final <- postpartum_df[,c("participantID",
"postpartum_BAI_cent",
"postpartum_Cesd_cent",
"postpartum_Depressive_Symptom_Severity",
"postpartum_Anxiety_Severity_greateroneSD",
"postpartum_psych_distress",
"postpartum_Depressive_Symptom_Severity_num")]
# 3.1 Maternal Education ####
maternal_edu <- read.delim("Rdata/ITU maternal education.dat")
names(maternal_edu)[1] <- "participantID"
names(maternal_edu)[3] <- "Maternal_Education"
maternal_edu <- maternal_edu[,c("participantID",
"Maternal_Education")]
library(naniar)
maternal_edu <- maternal_edu %>% replace_with_na(replace = list(Maternal_Education = -9))
maternal_edu$Maternal_Education <- factor(maternal_edu$Maternal_Education,
levels = c(1,2,3),
labels = c("primary", "applied university", "university"))
## 4. Register data during pregnancy ####
load("Rdata/processed_register_data.Rdata")
register_data$Maternal_Smoking_During_Pregnancy <- factor(register_data$Maternal_Smoking_During_Pregnancy,
levels = c("no", "quit_T1", "yes"),
labels = c("no", "no", "yes"))
register_data$Maternal_Hypertensive_Disorders_anyVSnone <- factor(register_data$Maternal_Hypertensive_Disorders_anyVSnone,
levels = c(-999,0,1),
labels = c("no", "no", "yes"))
register_data$Maternal_Diabetes_Disorders_anyVSnone <- factor(register_data$Maternal_Diabetes_Disorders_anyVSnone,
levels = c(-999,0,1),
labels = c("no", "no", "yes"))
register_data$Maternal_Body_Mass_Index_in_Early_Pregnancy_cent <- c(scale(register_data$Maternal_Body_Mass_Index_in_Early_Pregnancy, scale = F))
register_data$Weight_Gain_cent <- c(scale(register_data$Weight_Gain, scale = F))
register_data$Gestational_Age_Weeks_cent <- c(scale(register_data$Gestational_Age_Weeks, scale = F))
register_data$Child_Birth_Weight_cent <- c(scale(register_data$Child_Birth_Weight, scale = F))
register_data$Maternal_Age_Years_cent <- c(scale(register_data$Maternal_Age_Years, scale = F))
regis_final <- register_data[,c("participantID",
"caseVScontrol",
"Parity",
"Maternal_Smoking_During_Pregnancy",
"Maternal_Corticosteroid_Treatment_during_Pregnancy",
"Maternal_Body_Mass_Index_in_Early_Pregnancy_cent",
"Child_Sex" ,
"Gestational_Age_Weeks_cent",
"Child_Birth_Weight_cent",
"Weight_Gain_cent",
"Maternal_Hypertensive_Disorders_anyVSnone",
"Maternal_Diabetes_Disorders_anyVSnone",
"Maternal_Age_Years_cent"
)]
## 4.1 medication data ####
medication <- read.delim("Rdata/ITU_psychotrophicmedication05July21_Maternal_CurrentPregnancy.dat")
names(medication)[1] <- "participantID"
medication$ITUbroadpsychiatricmedication_18_KELA <- factor(medication$ITUbroadpsychiatricmedication_18_KELA,
levels = c(0,1),
labels = c("no", "yes"))
## 5. ASQ data ####
ASQ <- read.csv2("Rdata/ASQ_dataset_ITU_01122020r_shorter.csv")
names(ASQ)[1] <- "participantID"
#extract only participants who have cortisol data and finalagerange scores
#ASQ_final <- ASQ[ASQ$participantID %in% cort_IDs,c(1,3, 18:23)]
ASQ_final <- ASQ[ASQ$participantID %in% cort_IDs,c(1,3,18:22)]
ASQ_final$Child_ASQ_grossmotor_development_infancy_sum_finalagerange <-
as.numeric(ASQ_final$Child_ASQ_grossmotor_development_infancy_sum_finalagerange)
#normalized rank scores
for(col in 3:ncol(ASQ_final)){
column <- ASQ_final[col]
name <- paste0(names(ASQ_final[col]), "_norm")
ASQ_final[name] <- blom(column, method = "rankit")
}
#dichotomize normalized rank scores
for(col in 8:ncol(ASQ_final)){
column <- ASQ_final[col]
old_name <- names(ASQ_final[col])
new_name <- paste0(names(ASQ_final[col]), "_dichom")
ASQ_final[new_name] <- NA
for(i in 1:nrow(ASQ_final)){
ASQ_score <- ASQ_final[[i, c(old_name)]]
if(!is.na(ASQ_score)){
if(ASQ_score <= -1){
ASQ_final[[i,c(new_name)]] <- 1
}
if(ASQ_score > -1){
ASQ_final[[i,c(new_name)]] <- 0
}
}
}
}
ASQ_final$ChildAge_ASQ_months_allchildren_cent <-
c(scale(ASQ_final$ChildAge_ASQ_months_allchildren, scale = F))
## 6. On Pregnancy Averages: merge all data ####
#use all the ASQ data
ASQ_df1 <- left_join(ASQ_final, q_data_sub_final)
ASQ_df2 <- left_join(ASQ_df1, maternal_edu)
ASQ_df3 <- left_join(ASQ_df2, postpartum_df_final)
ASQ_df_final <- left_join(ASQ_df3, regis_final)
ASQ_df_final <- left_join(ASQ_df_final,
medication[,c("participantID",
"ITUbroadpsychiatricmedication_18_KELA",
"antidepressants_18_KELA")],
copy=TRUE)
##additive pre/post effects
ASQ_df_final$Pre.Post_clinD <- NA
for(i in 1:nrow(ASQ_df_final)){
pre <- ASQ_df_final$Depressive_Symptom_Severity_num[[i]]
post <- ASQ_df_final$postpartum_Depressive_Symptom_Severity_num[[i]]
if(!is.na(pre) & !is.na(post) & pre == 0 & post == 0){
ASQ_df_final$Pre.Post_clinD[[i]] <- "never"
}
if(sum(pre, post, na.rm=T) == 1 & !is.na(pre) & pre == 1){
ASQ_df_final$Pre.Post_clinD[[i]] <- "pre_only"
}
if(sum(pre, post, na.rm=T) == 1 & !is.na(post) & post == 1){
ASQ_df_final$Pre.Post_clinD[[i]] <- "post_only"
}
if(sum(pre, post, na.rm=T) == 2){
ASQ_df_final$Pre.Post_clinD[[i]] <- "pre_post"
}
}
ASQ_df_final$Pre.Post_clinD <- factor(ASQ_df_final$Pre.Post_clinD)
#view(ASQ_df_final[,c("Depressive_Symptom_Severity_num", "postpartum_Depressive_Symptom_Severity_num", "Pre.Post_clinD")])
## 7. Apply Exclusion Criteria ####
ASQ_df_final <- subset(ASQ_df_final, !(Maternal_Corticosteroid_Treatment_during_Pregnancy == "yes"))
#final n = 528
# ASQ_numbers <- ASQ_df_final[, c("Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom",
# "Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom",
# "Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom",
# "Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom",
# "Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom",
# "Depressive_Symptom_Severity")]
#
# tbl_summary(data = ASQ_numbers,
# by = Depressive_Symptom_Severity)
#tidy up
rm(list= ls()[!(ls() %in% c("ASQ_df_final", "at_least_two_assessments"))])
ASQ_df_final_sub <- ASQ_df_final[!(ASQ_df_final$ITUbroadpsychiatricmedication_18_KELA == "yes"),]
################################################################################
## Set up results table ####
ASQ_subscale_results <- setNames(data.frame(matrix(ncol = 19, nrow = 7)),
c("Developmental domain",
"B",
"SE",
"LL",
"UL",
"t",
"p",
"B",
"SE",
"LL",
"UL",
"t",
"p",
"B",
"SE",
"LL",
"UL",
"t",
"p"))
ASQ_subscale_results[,1] <- c("Gross_Motor_Skills",
".. in boys",
".. in girls",
"Fine_Motor_Skills",
"Communication_Skills",
"Personal_Social_Skills",
"Problem_Solving_Skills")
##for neurodevelopmental delay
ASQ_subscale_results_ND <- setNames(data.frame(matrix(ncol = 19, nrow = 7)),
c("Developmental domain",
"OR",
"SE",
"LL",
"UL",
"z",
"p",
"OR",
"SE",
"LL",
"UL",
"z",
"p",
"OR",
"SE",
"LL",
"UL",
"z",
"p"))
ASQ_subscale_results_ND[,1] <- c(
"Gross_Motor_Skills",
".. in boys",
".. in girls",
"Fine_Motor_Skills",
"Communication_Skills",
"Personal_Social_Skills",
"Problem_Solving_Skills")
## Set up functions to report statistics in APA ####
ordinal_apa <- function(m,x){ #m=tobit model, x=predictor as displayed in model summary table
#document results
ctable <- coef(summary(m))
p_val <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
ctable <- cbind(ctable, "p value" = p_val)
estimate <- format(round(ctable[x,1],2))
SE <- format(round(ctable[x,2],2))
CI <- as.numeric(c(confint(m,x)))
LL <- format(round(CI[1],2))
UL <- format(round(CI[2],2))
t <- format(round(ctable[x,3],2))
p <- format(round(ctable[x,4],3))
if(p > 0 & p < 1){
p <- snip(as.numeric(p), lead = 1)
}
output <- list(estimate,SE,LL,UL,t,p)
names(output) <- c("estimate","SE","LL","UL","t","p")
return(output) #output = list object of any parameters that may be interesting to report
}
logit_apa <- function(m,x){ #m=lobit model, x=predictor as displayed in model summary table
#document results
estimate <- format(round(exp(coef(summary(m))[x,1]),2))
SE <- format(round(exp(coef(summary(m))[x,2]),2))
CI <- as.numeric(exp(c(confint(m,x))))
LL <- format(round(CI[1],2))
UL <- format(round(CI[2],2))
z <- format(round(coef(summary(m))[x,3],2))
p <- format(round(coef(summary(m))[x,4],3))
if(p > 0 & p < 1){
p <- snip(as.numeric(p), lead = 1)
}
output <- list(estimate,SE,LL,UL,z,p)
names(output) <- c("estimate","SE","LL","UL","z","p")
return(output) #output = list object of any parameters (of OR) that may be interesting to report
}
################################################################################
################### Ordered Logistic Regression ########
### Gross Motor Development ####
M.Gross <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Gross)
ctable <- coef(summary(M.Gross))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Gross,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[1,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## add covariates M2
M2.Gross <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Gross)
ctable <- coef(summary(M2.Gross))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Gross,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[1,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## add covariates M3
M3.Gross <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Gross)
ctable <- coef(summary(M3.Gross))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Gross,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[1,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## repeat without smokers
M2.GrossB <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[!ASQ_df_final$Maternal_Smoking_During_Pregnancy == "yes",],
Hess=TRUE)
summary(M2.GrossB)
ctable <- coef(summary(M2.GrossB))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR2_gross_noSmokers <- ordinal_apa(M2.GrossB,"Cesd_qclosest_to_cortGW_pregMean_cent")
## add covariates M3
M3.GrossB <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final[!ASQ_df_final$Maternal_Smoking_During_Pregnancy == "yes",],
Hess=TRUE)
summary(M3.GrossB)
ctable <- coef(summary(M3.GrossB))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR3_gross_noSmokers <- ordinal_apa(M3.GrossB,"Cesd_qclosest_to_cortGW_pregMean_cent")
### Interactions ####
## case vS control
M.Gross_xCaCo <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Gross_xCaCo)
ctable <- coef(summary(M.Gross_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR_gross_CaCo <- ordinal_apa(M.Gross_xCaCo,"caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
#Child_Sex
M.Gross_xChS <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Gross_xChS)
ctable <- coef(summary(M.Gross_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR_gross_ChS <- ordinal_apa(M.Gross_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
#add covariates
M2.Gross_xChS <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Gross_xChS)
ctable <- coef(summary(M2.Gross_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR2_gross_ChS <- ordinal_apa(M2.Gross_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
#add covariates
M3.Gross_xChS <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Gross_xChS)
ctable <- coef(summary(M3.Gross_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR3_gross_ChS <- ordinal_apa(M3.Gross_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
## boys only ####
M.Gross_xChS_boys <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
Hess=TRUE)
summary(M.Gross_xChS_boys)
ctable <- coef(summary(M.Gross_xChS_boys))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Gross_xChS_boys,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[2,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
##model 2
M2.Gross_xChS_boys <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
Hess=TRUE)
summary(M2.Gross_xChS_boys)
ctable <- coef(summary(M2.Gross_xChS_boys))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Gross_xChS_boys,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[2,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
##Model 3
M3.Gross_xChS_boys <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
Hess=TRUE)
summary(M3.Gross_xChS_boys)
ctable <- coef(summary(M3.Gross_xChS_boys))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR3_gross_ChS_boys <- ordinal_apa(M3.Gross_xChS_boys,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[2,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### girls only ####
M.Gross_xChS_girls <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
Hess=TRUE)
summary(M.Gross_xChS_girls)
ctable <- coef(summary(M.Gross_xChS_girls))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Gross_xChS_girls,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[3,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#model 2
M2.Gross_xChS_girls <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
Hess=TRUE)
summary(M2.Gross_xChS_girls)
ctable <- coef(summary(M2.Gross_xChS_girls))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Gross_xChS_girls,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[3,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#model3
M3.Gross_xChS_girls <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
Hess=TRUE)
summary(M3.Gross_xChS_girls)
ctable <- coef(summary(M3.Gross_xChS_girls))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Gross_xChS_girls,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[3,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Fine Motor Development ####
M.Fine <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Fine)
ctable <- coef(summary(M.Fine))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Fine,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[4,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M2
M2.Fine <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Fine)
ctable <- coef(summary(M2.Fine))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Fine,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[4,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M3
M3.Fine <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Fine)
ctable <- coef(summary(M3.Fine))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Fine,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[4,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
M.Fine_xCaCo <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Fine_xCaCo)
ctable <- coef(summary(M.Fine_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR_fine_CaCo <- ordinal_apa(M.Fine_xCaCo,"caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
#Child_Sex
M.Fine_xChS <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Fine_xChS)
ctable <- coef(summary(M.Fine_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR_fine_ChS <- ordinal_apa(M.Fine_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
### Communication Development ####
M.Com <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Com)
ctable <- coef(summary(M.Com))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Com,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[5,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## M2
M2.Com <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Com)
ctable <- coef(summary(M2.Com))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Com,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[5,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
##M3
M3.Com <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Com)
ctable <- coef(summary(M3.Com))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Com,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[5,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
#caseVScontrol
M.Com_xCaCo <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Com_xCaCo)
ctable <- coef(summary(M.Com_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Com_xCaCo,"Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrolcontrol")
OR_com_CaCo <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#Child Sex
M.Com_xChS <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Com_xChS)
ctable <- coef(summary(M.Com_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Com_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
OR_com_ChS <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Personal/Social Development ####
M.per <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.per)
ctable <- coef(summary(M.per))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.per,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[6,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M2
M2.per <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.per)
ctable <- coef(summary(M2.per))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.per,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[6,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M3
M3.per <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.per)
ctable <- coef(summary(M3.per))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.per,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[6,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
#caseVScontrol
M.per_xCaCo <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.per_xCaCo)
ctable <- coef(summary(M.per_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.per_xCaCo,"Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrolcontrol")
OR_per_CaCo <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#Child Sex
M.per_xChS <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.per_xChS)
ctable <- coef(summary(M.per_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.per_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
OR_per_ChS <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Prob Development ####
M.prob <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.prob)
ctable <- coef(summary(M.prob))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.prob,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[7,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M2
M2.prob <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.prob)
ctable <- coef(summary(M2.prob))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.prob,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[7,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M3
M3.prob <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.prob)
ctable <- coef(summary(M3.prob))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.prob,"Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results[7,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
#caseVScontrol
M.prob_xCaCo <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.prob_xCaCo)
ctable <- coef(summary(M.prob_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.prob_xCaCo,"Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrolcontrol")
OR_prob_CaCo <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#Child Sex
M.prob_xChS <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.prob_xChS)
ctable <- coef(summary(M.prob_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.prob_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
OR_prob_ChS <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
################################################################################
############### Logit #####################
# ####### Gross motor development score ####
# ### assumptions ####
# new_ASQ <- na.omit(ASQ_df_final[,-c(2:14,16,19:35,39:42,46:49)]) #first exclude the other outcome variables
#
# # Fit the logistic regression model
# model <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
# ChildAge_ASQ_months_allchildren_cent +
# Child_Sex +
# Cesd_qclosest_to_cortGW_pregMean_cent +
# caseVScontrol +
# Maternal_Age_Years_cent +
# Maternal_Education +
# Parity +
# Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
# Weight_Gain_cent +
# Maternal_Hypertensive_Disorders_anyVSnone +
# Maternal_Diabetes_Disorders_anyVSnone +
# Maternal_Smoking_During_Pregnancy +
# Gestational_Age_Weeks_cent +
# Child_Birth_Weight_cent +
# postpartum_Cesd_cent +
# postpartum_BAI_cent,
# data = new_ASQ,
# family = binomial,
# na.action = "na.exclude")
#
# # Predict the probability (p) of diabete positivity
# probabilities <- predict(model, type = "response")
# # predicted.classes <- ifelse(probabilities > 0.3, "pos", "neg")
# # head(predicted.classes)
# # Select only numeric predictors
# mydata <- new_ASQ %>%
# dplyr::select_if(is.numeric)
# #mydata <- mydata[,-c(5:10)]
# predictors <- colnames(mydata)
# # Bind the logit and tidying the data for plot
# mydata <- mydata %>%
# mutate(logit = log(probabilities/(1-probabilities))) %>%
# gather(key = "predictors", value = "predictor.value", -logit)
#
# #create scatterplots
# ggplot(mydata, aes(logit, predictor.value))+
# geom_point(size = 0.5, alpha = 0.5) +
# geom_smooth(method = "loess") +
# theme_bw() +
# facet_wrap(~predictors, scales = "free_y")
#
# ## Cook's distance
# plot(model, which = 4, id.n = 4)
#
# #influential cases
# # Extract model results
# #new_ASQ <- ASQ_df_final[,-c(10:14)] #first exclude the other outcome variables
# model.data <- augment(model, data = new_ASQ) %>% mutate(index = 1:n())
# model.data %>% top_n(4, .cooksd)
#
# #plot standardize residuls
# ggplot(model.data, aes(index, .std.resid)) +
# geom_point(aes(color = Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom), alpha = .5) +
# theme_bw()
# model.data %>%
# filter(abs(.std.resid) > 3) #no influential cases
#
# #multicollinearity
# car::vif(model)
#
# ### Prenatal Cesd ####
#ASQ and prenatal Cesd
M1_gross <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_gross)
res <- logit_apa(M1_gross, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[1,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
M2_gross.cov <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_gross.cov)
res <- logit_apa(M2_gross.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[1,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_gross.cov <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_gross.cov)
res <- logit_apa(M3_gross.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[1,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
##ASQ and prenatal Cesd*child sex
M1_gross.INT1 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
na.action = "na.exclude",
family = "binomial")
summary(M1_gross.INT1)
LOG_gross_xChS <- logit_apa(M1_gross.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
##M2
M2_gross.INT1 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
na.action = "na.exclude",
family = "binomial")
summary(M2_gross.INT1)
LOG2_gross_xChS <- logit_apa(M2_gross.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
#M3
M3_gross.INT1 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
na.action = "na.exclude",
family = "binomial")
summary(M3_gross.INT1)
LOG3_gross_xChS <- logit_apa(M3_gross.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
## for boys
M1_gross.INT1_boys <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
na.action = "na.exclude",
family = "binomial")
summary(M1_gross.INT1_boys)
res <- logit_apa(M1_gross.INT1_boys, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[2,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
##M2
M2_gross.INT1_boys <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
na.action = "na.exclude",
family = "binomial")
summary(M2_gross.INT1_boys)
res <- logit_apa(M2_gross.INT1_boys, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[2,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M3
M3_gross.INT1_boys <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
na.action = "na.exclude",
family = "binomial")
summary(M3_gross.INT1_boys)
res <- logit_apa(M3_gross.INT1_boys, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[2,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
## for girls
M1_gross.INT1_girls <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
na.action = "na.exclude",
family = "binomial")
summary(M1_gross.INT1_girls)
res <- logit_apa(M1_gross.INT1_girls, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[3,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
##M2
M2_gross.INT1_girls <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
na.action = "na.exclude",
family = "binomial")
summary(M2_gross.INT1_girls)
res <- logit_apa(M2_gross.INT1_girls, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[3,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M3
M3_gross.INT1_girls <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
na.action = "na.exclude",
family = "binomial")
summary(M3_gross.INT1_girls)
res <- logit_apa(M3_gross.INT1_girls, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[3,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd*caseVScontrol
M1_gross.INT2 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_gross.INT2)
LOG_gross_xCaCo <- logit_apa(M1_gross.INT2, "Cesd_qclosest_to_cortGW_pregMean_cent")
# ### Categorical Cesd ####
#ASQ and prenatal Cesd
M1_gross_cat <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity,
data = ASQ_df_final,
family = "binomial")
summary(M1_gross_cat)
#res <- logit_apa(M1_gross_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[10,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
M2_gross.cov_cat <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_gross.cov_cat)
#res <- logit_apa(M2_gross.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[10,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_gross.cov_cat <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_gross.cov_cat)
#res <- logit_apa(M3_gross.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[10,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# ####### Fine motor development score ####
# ### assumptions ####
new_ASQ.fine <- na.omit(ASQ_df_final[,-c(2:13,15,16,19:35,39:42,46:49)])
#first exclude the other outcome variables
# # Fit the logistic regression model
# model <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
# ChildAge_ASQ_months_allchildren_cent +
# Child_Sex +
# Cesd_qclosest_to_cortGW_pregMean_cent +
# #BAI_qclosest_to_cortGW_pregMean_cent +
# #PSQI_qclosest_to_cortGW_pregMean_cent +
# caseVScontrol +
# Maternal_Age_Years_cent +
# Maternal_Education +
# Parity +
# Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
# Weight_Gain_cent +
# Maternal_Hypertensive_Disorders_anyVSnone +
# Maternal_Diabetes_Disorders_anyVSnone +
# Maternal_Smoking_During_Pregnancy +
# Gestational_Age_Weeks_cent +
# Child_Birth_Weight_cent +
# postpartum_Cesd_cent +
# postpartum_BAI_cent,
# data = new_ASQ.fine,
# family = binomial,
# na.action = "na.exclude")
#
# # Predict the probability (p) of diabete positivity
# probabilities <- predict(model, type = "response")
# # predicted.classes <- ifelse(probabilities > 0.3, "pos", "neg")
# # head(predicted.classes)
# # Select only numeric predictors
# mydata <- new_ASQ.fine %>%
# dplyr::select_if(is.numeric)
# #mydata <- mydata[,-c(5:10)]
# predictors <- colnames(mydata)
# # Bind the logit and tidying the data for plot
# mydata <- mydata %>%
# mutate(logit = log(probabilities/(1-probabilities))) %>%
# gather(key = "predictors", value = "predictor.value", -logit)
#
# #create scatterplots
# ggplot(mydata, aes(logit, predictor.value))+
# geom_point(size = 0.5, alpha = 0.5) +
# geom_smooth(method = "loess") +
# theme_bw() +
# facet_wrap(~predictors, scales = "free_y")
#
# ## Cook's distance
# plot(model, which = 4, id.n = 4)
#
# #influential cases
# # Extract model results
# #new_ASQ <- ASQ_df_final[,-c(10:14)] #first exclude the other outcome variables
# model.data <- augment(model, data = new_ASQ.fine) %>% mutate(index = 1:n())
# model.data %>% top_n(4, .cooksd)
#
# #plot standardize residuls
# ggplot(model.data, aes(index, .std.resid)) +
# geom_point(aes(color = Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom), alpha = .5) +
# theme_bw()
# model.data %>%
# filter(abs(.std.resid) > 3) #no influential cases
#
# #multicollinearity
# car::vif(model)
# ### Prenatal Cesd ####
#ASQ and prenatal Cesd
M1_fine <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine)
res <- logit_apa(M1_fine, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[4,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
#ASQ and prenatal Cesd + prenatal covariates
M2_fine.cov <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_fine.cov)
res <- logit_apa(M2_fine.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[4,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + postnatal covariates
M3_fine.cov <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_fine.cov)
res <- logit_apa(M3_fine.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[4,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_fine.INT1 <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine.INT1)
LOG_fine_xChS <- logit_apa(M1_fine.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_fine.INT2 <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine.INT2)
LOG_fine_xCaCo <- logit_apa(M1_fine.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
# ### Categorical Cesd ####
#ASQ and prenatal Cesd
M1_fine_cat <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine_cat)
#res <- logit_apa(M1_fine_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[11,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
M2_fine.cov_cat <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_fine.cov_cat)
#res <- logit_apa(M2_fine.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[11,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_fine.cov_cat <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_fine.cov_cat)
#res <- logit_apa(M3_fine.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[11,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# ####### communication development score ####
# ### assumptions ####
# new_ASQ.com <- na.omit(ASQ_df_final[,-c(2:13:16,19:36,38:43,47:50)]) #first exclude the other outcome variables
#
# # Fit the logistic regression model
# model <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
# ChildAge_ASQ_months_allchildren_cent +
# Child_Sex +
# Cesd_qclosest_to_cortGW_pregMean_cent +
# caseVScontrol +
# Maternal_Age_Years_cent +
# Maternal_Education +
# Parity +
# Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
# Weight_Gain_cent +
# Maternal_Hypertensive_Disorders_anyVSnone +
# Maternal_Diabetes_Disorders_anyVSnone +
# Maternal_Smoking_During_Pregnancy +
# Gestational_Age_Weeks_cent +
# Child_Birth_Weight_cent +
# postpartum_Cesd_cent +
# postpartum_BAI_cent,
# data = new_ASQ.com,
# family = binomial,
# na.action = "na.exclude")
#
# # Predict the probability (p) of diabete positivity
# probabilities <- predict(model, type = "response")
# # predicted.classes <- ifelse(probabilities > 0.3, "pos", "neg")
# # head(predicted.classes)
# # Select only numeric predictors
# mydata <- new_ASQ.com %>%
# dplyr::select_if(is.numeric)
# #mydata <- mydata[,-c(5:10)]
# predictors <- colnames(mydata)
# # Bind the logit and tidying the data for plot
# mydata <- mydata %>%
# mutate(logit = log(probabilities/(1-probabilities))) %>%
# gather(key = "predictors", value = "predictor.value", -logit)
#
# #create scatterplots
# ggplot(mydata, aes(logit, predictor.value))+
# geom_point(size = 0.5, alpha = 0.5) +
# geom_smooth(method = "loess") +
# theme_bw() +
# facet_wrap(~predictors, scales = "free_y")
#
# ## Cook's distance
# plot(model, which = 4, id.n = 4)
#
# #influential cases
# # Extract model results
# #new_ASQ <- ASQ_df_final[,-c(10:14)] #first exclude the other outcome variables
# model.data <- augment(model, data = new_ASQ.com) %>% mutate(index = 1:n())
# model.data %>% top_n(4, .cooksd)
#
# #plot standardize residuls
# ggplot(model.data, aes(index, .std.resid)) +
# geom_point(aes(color = Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom), alpha = .5) +
# theme_bw()
# model.data %>%
# filter(abs(.std.resid) > 3) #no influential cases
#
# #multicollinearity
# car::vif(model)
# ### Prenatal Cesd ####
# #ASQ and prenatal Cesd
M1_com <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_com)
res <- logit_apa(M1_com, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[5,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + prenatal covariates
M2_com.cov <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_com.cov)
res <- logit_apa(M2_com.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[5,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + postnatal covariates
M3_com.cov <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_com.cov)
res <- logit_apa(M3_com.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[5,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_com.INT1 <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_com.INT1)
LOG_com_xChS <- logit_apa(M1_com.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_com.INT2 <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_com.INT2)
LOG_com_xCaCo <- logit_apa(M1_com.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
# ####### personal/social development score ####
# ### assumptions ####
# new_ASQ.per <- na.omit(ASQ_df_final[,-c(2:12, 14:16,19:36,38:43,47:50)]) #first exclude the other outcome variables
#
# # Fit the logistic regression model
# model <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
# ChildAge_ASQ_months_allchildren_cent +
# Child_Sex +
# Cesd_qclosest_to_cortGW_pregMean_cent +
# caseVScontrol +
# Maternal_Age_Years_cent +
# Maternal_Education +
# Parity +
# Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
# Weight_Gain_cent +
# Maternal_Hypertensive_Disorders_anyVSnone +
# Maternal_Diabetes_Disorders_anyVSnone +
# Maternal_Smoking_During_Pregnancy +
# Gestational_Age_Weeks_cent +
# Child_Birth_Weight_cent +
# postpartum_Cesd_cent +
# postpartum_BAI_cent,
# data = new_ASQ.per,
# family = binomial,
# na.action = "na.exclude")
#
# # Predict the probability (p) of diabete positivity
# probabilities <- predict(model, type = "response")
# # predicted.classes <- ifelse(probabilities > 0.3, "pos", "neg")
# # head(predicted.classes)
# # Select only numeric predictors
# mydata <- new_ASQ.per %>%
# dplyr::select_if(is.numeric)
# #mydata <- mydata[,-c(5:10)]
# predictors <- colnames(mydata)
# # Bind the logit and tidying the data for plot
# mydata <- mydata %>%
# mutate(logit = log(probabilities/(1-probabilities))) %>%
# gather(key = "predictors", value = "predictor.value", -logit)
#
# #create scatterplots
# ggplot(mydata, aes(logit, predictor.value))+
# geom_point(size = 0.5, alpha = 0.5) +
# geom_smooth(method = "loess") +
# theme_bw() +
# facet_wrap(~predictors, scales = "free_y")
#
# ## Cook's distance
# plot(model, which = 4, id.n = 4)
#
# #influential cases
# # Extract model results
# #new_ASQ <- ASQ_df_final[,-c(10:14)] #first exclude the other outcome variables
# model.data <- augment(model, data = new_ASQ.per) %>% mutate(index = 1:n())
# model.data %>% top_n(4, .cooksd)
#
# #plot standardize residuls
# ggplot(model.data, aes(index, .std.resid)) +
# geom_point(aes(color = Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom), alpha = .5) +
# theme_bw()
# model.data %>%
# filter(abs(.std.resid) > 3) #no influential cases
#
# #multicollinearity
# car::vif(model)
#
# ### Prenatal Cesd ####
# #ASQ and prenatal Cesd
M1_per <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_per)
res <- logit_apa(M1_per, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[6,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + prenatal covariates
M2_per.cov <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_per.cov)
res <- logit_apa(M2_per.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[6,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_per.cov <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_per.cov)
res <- logit_apa(M3_per.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[6,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_per.INT1 <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_per.INT1)
LOG_per_xChS <- logit_apa(M1_per.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_per.INT2 <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_per.INT2)
LOG_per_xCaCo <- logit_apa(M1_per.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
# ####### problem solving development score ####
# ### assumptions ####
# new_ASQ.prob <- na.omit(ASQ_df_final[,-c(2:13, 15:16,19:36,38:43,47:50)]) #first exclude the other outcome variables
#
# # Fit the logistic regression model
# model <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
# ChildAge_ASQ_months_allchildren_cent +
# Child_Sex +
# Cesd_qclosest_to_cortGW_pregMean_cent +
# caseVScontrol +
# Maternal_Age_Years_cent +
# Maternal_Education +
# Parity +
# Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
# Weight_Gain_cent +
# Maternal_Hypertensive_Disorders_anyVSnone +
# Maternal_Diabetes_Disorders_anyVSnone +
# Maternal_Smoking_During_Pregnancy +
# Gestational_Age_Weeks_cent +
# Child_Birth_Weight_cent +
# postpartum_Cesd_cent +
# postpartum_BAI_cent,
# data = new_ASQ.prob,
# family = binomial,
# na.action = "na.exclude")
#
# # Predict the probability (p) of diabete positivity
# probabilities <- predict(model, type = "response")
# # predicted.classes <- ifelse(probabilities > 0.3, "pos", "neg")
# # head(predicted.classes)
# # Select only numeric predictors
# mydata <- new_ASQ.prob %>%
# dplyr::select_if(is.numeric)
# #mydata <- mydata[,-c(5:10)]
# predictors <- colnames(mydata)
# # Bind the logit and tidying the data for plot
# mydata <- mydata %>%
# mutate(logit = log(probabilities/(1-probabilities))) %>%
# gather(key = "predictors", value = "predictor.value", -logit)
#
# #create scatterplots
# ggplot(mydata, aes(logit, predictor.value))+
# geom_point(size = 0.5, alpha = 0.5) +
# geom_smooth(method = "loess") +
# theme_bw() +
# facet_wrap(~predictors, scales = "free_y")
#
# ## Cook's distance
# plot(model, which = 4, id.n = 4)
#
# #influential cases
# # Extract model results
# #new_ASQ <- ASQ_df_final[,-c(10:14)] #first exclude the other outcome variables
# model.data <- augment(model, data = new_ASQ.prob) %>% mutate(index = 1:n())
# model.data %>% top_n(4, .cooksd)
#
# #plot standardize residuls
# ggplot(model.data, aes(index, .std.resid)) +
# geom_point(aes(color = Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom), alpha = .5) +
# theme_bw()
# model.data %>%
# filter(abs(.std.resid) > 3) #no influential cases
#
# #multicollinearity
# car::vif(model)
# ### Prenatal Cesd ####
# #ASQ and prenatal Cesd
M1_prob <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_prob)
res <- logit_apa(M1_prob, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[7,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + prenatal covariates
M2_prob.cov <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_prob.cov)
res <- logit_apa(M2_prob.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[7,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + postnatal covariates
M3_prob.cov <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_prob.cov)
res <- logit_apa(M3_prob.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
ASQ_subscale_results_ND[7,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_prob.INT1 <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_prob.INT1)
LOG_prob_xChS <- logit_apa(M1_prob.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_prob.INT2 <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_prob.INT2)
LOG_prob_xCaCo <- logit_apa(M1_prob.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
######################### Sensitivity analysis ###################
## Set up results table ####
Appen_ASQ_subscale_results <- setNames(data.frame(matrix(ncol = 19, nrow = 7)),
c("Developmental domain",
"B",
"SE",
"LL",
"UL",
"t",
"p",
"B",
"SE",
"LL",
"UL",
"t",
"p",
"B",
"SE",
"LL",
"UL",
"t",
"p"))
Appen_ASQ_subscale_results[,1] <- c("Gross_Motor_Skills",
".. in boys",
".. in girls",
"Fine_Motor_Skills",
"Communication_Skills",
"Personal_Social_Skills",
"Problem_Solving_Skills")
##for neurodevelopmental delay
Appen_ASQ_subscale_results_ND <- setNames(data.frame(matrix(ncol = 19, nrow = 7)),
c("Developmental domain",
"OR",
"SE",
"LL",
"UL",
"z",
"p",
"OR",
"SE",
"LL",
"UL",
"z",
"p",
"OR",
"SE",
"LL",
"UL",
"z",
"p"))
Appen_ASQ_subscale_results_ND[,1] <- c(
"Gross_Motor_Skills",
".. in boys",
".. in girls",
"Fine_Motor_Skills",
"Communication_Skills",
"Personal_Social_Skills",
"Problem_Solving_Skills")
ASQ_df_final <- ASQ_df_final_sub
################### Ordered Logistic Regression ########
### Gross Motor Development ####
M.Gross <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Gross)
ctable <- coef(summary(M.Gross))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Gross,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[1,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## add covariates M2
M2.Gross <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Gross)
ctable <- coef(summary(M2.Gross))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Gross,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[1,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## add covariates M3
M3.Gross <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Gross)
ctable <- coef(summary(M3.Gross))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Gross,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[1,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## repeat without smokers
M2.GrossB <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[!ASQ_df_final$Maternal_Smoking_During_Pregnancy == "yes",],
Hess=TRUE)
summary(M2.GrossB)
ctable <- coef(summary(M2.GrossB))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR2_gross_noSmokers <- ordinal_apa(M2.GrossB,"Cesd_qclosest_to_cortGW_pregMean_cent")
## add covariates M3
M3.GrossB <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
#Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
#Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final[!ASQ_df_final$Maternal_Smoking_During_Pregnancy == "yes",],
Hess=TRUE)
summary(M3.GrossB)
ctable <- coef(summary(M3.GrossB))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR3_gross_noSmokers <- ordinal_apa(M3.GrossB,"Cesd_qclosest_to_cortGW_pregMean_cent")
### Interactions ####
## case vS control
M.Gross_xCaCo <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Gross_xCaCo)
ctable <- coef(summary(M.Gross_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR_gross_CaCo <- ordinal_apa(M.Gross_xCaCo,"caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
#Child_Sex
M.Gross_xChS <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Gross_xChS)
ctable <- coef(summary(M.Gross_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR_gross_ChS <- ordinal_apa(M.Gross_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
#add covariates
M2.Gross_xChS <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Gross_xChS)
ctable <- coef(summary(M2.Gross_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR2_gross_ChS <- ordinal_apa(M2.Gross_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
#add covariates
M3.Gross_xChS <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Gross_xChS)
ctable <- coef(summary(M3.Gross_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR3_gross_ChS <- ordinal_apa(M3.Gross_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
## boys only ####
M.Gross_xChS_boys <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
Hess=TRUE)
summary(M.Gross_xChS_boys)
ctable <- coef(summary(M.Gross_xChS_boys))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Gross_xChS_boys,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[2,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
##model 2
M2.Gross_xChS_boys <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
Hess=TRUE)
summary(M2.Gross_xChS_boys)
ctable <- coef(summary(M2.Gross_xChS_boys))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Gross_xChS_boys,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[2,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
##Model 3
M3.Gross_xChS_boys <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
Hess=TRUE)
summary(M3.Gross_xChS_boys)
ctable <- coef(summary(M3.Gross_xChS_boys))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
OR3_gross_ChS_boys <- ordinal_apa(M3.Gross_xChS_boys,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[2,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### girls only ####
M.Gross_xChS_girls <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
Hess=TRUE)
summary(M.Gross_xChS_girls)
ctable <- coef(summary(M.Gross_xChS_girls))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Gross_xChS_girls,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[3,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#model 2
M2.Gross_xChS_girls <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
Hess=TRUE)
summary(M2.Gross_xChS_girls)
ctable <- coef(summary(M2.Gross_xChS_girls))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Gross_xChS_girls,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[3,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#model3
M3.Gross_xChS_girls <- polr(factor(Child_ASQ_grossmotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
Hess=TRUE)
summary(M3.Gross_xChS_girls)
ctable <- coef(summary(M3.Gross_xChS_girls))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Gross_xChS_girls,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[3,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Fine Motor Development ####
M.Fine <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Fine)
ctable <- coef(summary(M.Fine))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Fine,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[4,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M2
M2.Fine <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Fine)
ctable <- coef(summary(M2.Fine))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Fine,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[4,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M3
M3.Fine <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Fine)
ctable <- coef(summary(M3.Fine))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Fine,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[4,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
M.Fine_xCaCo <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Fine_xCaCo)
ctable <- coef(summary(M.Fine_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR_fine_CaCo <- ordinal_apa(M.Fine_xCaCo,"caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
#Child_Sex
M.Fine_xChS <- polr(factor(Child_ASQ_finemotor_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Fine_xChS)
ctable <- coef(summary(M.Fine_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
Appen_OR_fine_ChS <- ordinal_apa(M.Fine_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
### Communication Development ####
M.Com <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Com)
ctable <- coef(summary(M.Com))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Com,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[5,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
## M2
M2.Com <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.Com)
ctable <- coef(summary(M2.Com))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.Com,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[5,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
##M3
M3.Com <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.Com)
ctable <- coef(summary(M3.Com))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.Com,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[5,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
#caseVScontrol
M.Com_xCaCo <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Com_xCaCo)
ctable <- coef(summary(M.Com_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Com_xCaCo,"Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrolcontrol")
Appen_OR_com_CaCo <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#Child Sex
M.Com_xChS <- polr(factor(Child_ASQ_communication_develop_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.Com_xChS)
ctable <- coef(summary(M.Com_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.Com_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_OR_com_ChS <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Personal/Social Development ####
M.per <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.per)
ctable <- coef(summary(M.per))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.per,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[6,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M2
M2.per <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.per)
ctable <- coef(summary(M2.per))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.per,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[6,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M3
M3.per <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.per)
ctable <- coef(summary(M3.per))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.per,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[6,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
#caseVScontrol
M.per_xCaCo <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.per_xCaCo)
ctable <- coef(summary(M.per_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.per_xCaCo,"Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrolcontrol")
Appen_OR_per_CaCo <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#Child Sex
M.per_xChS <- polr(factor(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.per_xChS)
ctable <- coef(summary(M.per_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.per_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_OR_per_ChS <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Prob Development ####
M.prob <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M.prob)
ctable <- coef(summary(M.prob))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.prob,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[7,2:7] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M2
M2.prob <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M2.prob)
ctable <- coef(summary(M2.prob))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M2.prob,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[7,8:13] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#M3
M3.prob <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_Cesd_cent +
postpartum_BAI_cent,
data = ASQ_df_final,
Hess=TRUE)
summary(M3.prob)
ctable <- coef(summary(M3.prob))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M3.prob,"Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results[7,14:19] <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
### Interactions ####
#caseVScontrol
M.prob_xCaCo <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
Hess=TRUE)
summary(M.prob_xCaCo)
ctable <- coef(summary(M.prob_xCaCo))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.prob_xCaCo,"Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrolcontrol")
Appen_OR_prob_CaCo <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
#Child Sex
M.prob_xChS <- polr(factor(Child_ASQ_problemsolving_development_infancy_sum_finalagerange) ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
Hess=TRUE)
summary(M.prob_xChS)
ctable <- coef(summary(M.prob_xChS))
## calculate and store p values
p <- pnorm(abs(ctable[, "t value"]), lower.tail = FALSE) * 2
## combined table
ctable <- cbind(ctable, "p value" = p)
res <- ordinal_apa(M.prob_xChS,"Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_OR_prob_ChS <- c(res[c("estimate","SE", "LL", "UL", "t","p")])
################################################################################
############### Logit #####################
# ####### Gross motor development score ####
# ### Prenatal Cesd ####
#ASQ and prenatal Cesd
M1_gross <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_gross)
res <- logit_apa(M1_gross, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[1,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
M2_gross.cov <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_gross.cov)
res <- logit_apa(M2_gross.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[1,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_gross.cov <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_gross.cov)
res <- logit_apa(M3_gross.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[1,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
##ASQ and prenatal Cesd*child sex
M1_gross.INT1 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
na.action = "na.exclude",
family = "binomial")
summary(M1_gross.INT1)
Appen_LOG_gross_xChS <- logit_apa(M1_gross.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
##M2
M2_gross.INT1 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
na.action = "na.exclude",
family = "binomial")
summary(M2_gross.INT1)
Appen_LOG2_gross_xChS <- logit_apa(M2_gross.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
#M3
M3_gross.INT1 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
na.action = "na.exclude",
family = "binomial")
summary(M3_gross.INT1)
Appen_LOG3_gross_xChS <- logit_apa(M3_gross.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
## for boys
M1_gross.INT1_boys <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
na.action = "na.exclude",
family = "binomial")
summary(M1_gross.INT1_boys)
res <- logit_apa(M1_gross.INT1_boys, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[2,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
##M2
M2_gross.INT1_boys <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
na.action = "na.exclude",
family = "binomial")
summary(M2_gross.INT1_boys)
res <- logit_apa(M2_gross.INT1_boys, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[2,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M3
M3_gross.INT1_boys <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "boy",],
na.action = "na.exclude",
family = "binomial")
summary(M3_gross.INT1_boys)
res <- logit_apa(M3_gross.INT1_boys, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[2,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
## for girls
M1_gross.INT1_girls <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
na.action = "na.exclude",
family = "binomial")
summary(M1_gross.INT1_girls)
res <- logit_apa(M1_gross.INT1_girls, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[3,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
##M2
M2_gross.INT1_girls <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
na.action = "na.exclude",
family = "binomial")
summary(M2_gross.INT1_girls)
res <- logit_apa(M2_gross.INT1_girls, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[3,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M3
M3_gross.INT1_girls <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final[ASQ_df_final$Child_Sex == "girl",],
na.action = "na.exclude",
family = "binomial")
summary(M3_gross.INT1_girls)
res <- logit_apa(M3_gross.INT1_girls, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[3,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd*caseVScontrol
M1_gross.INT2 <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_gross.INT2)
Appen_LOG_gross_xCaCo <- logit_apa(M1_gross.INT2, "Cesd_qclosest_to_cortGW_pregMean_cent")
# ### Categorical Cesd ####
#ASQ and prenatal Cesd
M1_gross_cat <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity,
data = ASQ_df_final,
family = "binomial")
summary(M1_gross_cat)
#res <- logit_apa(M1_gross_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[10,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
M2_gross.cov_cat <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_gross.cov_cat)
#res <- logit_apa(M2_gross.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[10,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_gross.cov_cat <- glm(Child_ASQ_grossmotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_gross.cov_cat)
#res <- logit_apa(M3_gross.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[10,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# ####### Fine motor development score ####
# ### Prenatal Cesd ####
#ASQ and prenatal Cesd
M1_fine <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine)
res <- logit_apa(M1_fine, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[4,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
#ASQ and prenatal Cesd + prenatal covariates
M2_fine.cov <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_fine.cov)
res <- logit_apa(M2_fine.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[4,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + postnatal covariates
M3_fine.cov <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_fine.cov)
res <- logit_apa(M3_fine.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[4,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_fine.INT1 <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine.INT1)
Appen_LOG_fine_xChS <- logit_apa(M1_fine.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_fine.INT2 <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine.INT2)
Appen_LOG_fine_xCaCo <- logit_apa(M1_fine.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
# ### Categorical Cesd ####
#ASQ and prenatal Cesd
M1_fine_cat <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity,
data = ASQ_df_final,
family = "binomial")
summary(M1_fine_cat)
#res <- logit_apa(M1_fine_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[11,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#M2
M2_fine.cov_cat <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_fine.cov_cat)
#res <- logit_apa(M2_fine.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[11,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_fine.cov_cat <- glm(Child_ASQ_finemotor_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Depressive_Symptom_Severity +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_fine.cov_cat)
#res <- logit_apa(M3_fine.cov_cat, "Depressive_Symptom_SeverityClinical (CES-D >= 16)")
#ASQ_subscale_results_ND[11,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# ####### communication development score ####
# ### Prenatal Cesd ####
# #ASQ and prenatal Cesd
M1_com <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_com)
res <- logit_apa(M1_com, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[5,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + prenatal covariates
M2_com.cov <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_com.cov)
res <- logit_apa(M2_com.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[5,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + postnatal covariates
M3_com.cov <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_com.cov)
res <- logit_apa(M3_com.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[5,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_com.INT1 <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_com.INT1)
Appen_LOG_com_xChS <- logit_apa(M1_com.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_com.INT2 <- glm(Child_ASQ_communication_develop_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_com.INT2)
Appen_LOG_com_xCaCo <- logit_apa(M1_com.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
# ####### personal/social development score ####
# ### Prenatal Cesd ####
# #ASQ and prenatal Cesd
M1_per <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_per)
res <- logit_apa(M1_per, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[6,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + prenatal covariates
M2_per.cov <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_per.cov)
res <- logit_apa(M2_per.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[6,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
# #ASQ and prenatal Cesd + postnatal covariates
M3_per.cov <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_per.cov)
res <- logit_apa(M3_per.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[6,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_per.INT1 <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_per.INT1)
Appen_LOG_per_xChS <- logit_apa(M1_per.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_per.INT2 <- glm(Child_ASQpersonalandsocialskills_dev_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_per.INT2)
Appen_LOG_per_xCaCo <- logit_apa(M1_per.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")
# ####### problem solving development score ####
# ### Prenatal Cesd ####
# #ASQ and prenatal Cesd
M1_prob <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent,
data = ASQ_df_final,
family = "binomial")
summary(M1_prob)
res <- logit_apa(M1_prob, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[7,2:7] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + prenatal covariates
M2_prob.cov <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent,
data = ASQ_df_final,
family = "binomial")
summary(M2_prob.cov)
res <- logit_apa(M2_prob.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[7,8:13] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
#ASQ and prenatal Cesd + postnatal covariates
M3_prob.cov <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
caseVScontrol +
Maternal_Age_Years_cent +
Maternal_Education +
Parity +
Maternal_Body_Mass_Index_in_Early_Pregnancy_cent +
Weight_Gain_cent +
Maternal_Hypertensive_Disorders_anyVSnone +
Maternal_Diabetes_Disorders_anyVSnone +
Maternal_Smoking_During_Pregnancy +
Gestational_Age_Weeks_cent +
Child_Birth_Weight_cent +
postpartum_BAI_cent +
postpartum_Cesd_cent,
data = ASQ_df_final,
family = "binomial")
summary(M3_prob.cov)
res <- logit_apa(M3_prob.cov, "Cesd_qclosest_to_cortGW_pregMean_cent")
Appen_ASQ_subscale_results_ND[7,14:19] <- c(res[c("estimate","SE", "LL", "UL", "z","p")])
### Interactions ####
# #ASQ and prenatal Cesd*child sex
M1_prob.INT1 <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:Child_Sex,
data = ASQ_df_final,
family = "binomial")
summary(M1_prob.INT1)
Appen_LOG_prob_xChS <- logit_apa(M1_prob.INT1, "Child_Sexgirl:Cesd_qclosest_to_cortGW_pregMean_cent")
# #ASQ and prenatal Cesd*caseVScontrol
M1_prob.INT2 <- glm(Child_ASQ_problemsolving_development_infancy_sum_finalagerange_norm_dichom ~
ChildAge_ASQ_months_allchildren_cent +
Child_Sex +
caseVScontrol +
Cesd_qclosest_to_cortGW_pregMean_cent +
Cesd_qclosest_to_cortGW_pregMean_cent:caseVScontrol,
data = ASQ_df_final,
family = "binomial")
summary(M1_prob.INT2)
Appen_LOG_prob_xCaCo <- logit_apa(M1_prob.INT2, "caseVScontrolcontrol:Cesd_qclosest_to_cortGW_pregMean_cent")