#------------ setwd
setwd("C:/Users/C00252837/Dropbox/StudentParentsData")
#------------Read in Data
data<-read.csv("sutdentparents_survey_weighted.csv", header = T)
data<-as_tibble(data)
names(data)
## [1] "Column1" "x1"
## [3] "ïColumn1" "x"
## [5] "classification" "enrollment"
## [7] "department" "q4"
## [9] "finanacial_assistance" "q24_8_text"
## [11] "q23" "q38"
## [13] "q5" "q43"
## [15] "employment_status" "gender"
## [17] "gender2" "q10_5_text"
## [19] "age_original" "race"
## [21] "race2" "q46"
## [23] "q46_4_text" "q47"
## [25] "q47_11_text" "pregnancy"
## [27] "parenthood" "numb_children"
## [29] "age_children" "q35_13"
## [31] "q35_14" "q35_15"
## [33] "q62" "column226"
## [35] "res_aware_both_mean" "res_aware_patuniq_mean"
## [37] "res_use_both_mean" "res_use_patuniq_mean"
## [39] "socialsupport_both_mean" "socialsupport_patuniq_mean"
## [41] "positive_exp_both_mean" "positive_exp_patuniq_mean"
## [43] "negative_exp_gen_both_mean" "negative_exp_gen_patuniq_mean"
## [45] "academic_diffty_both_mean" "academic_diffty_patuniq_mean"
## [47] "financial_ins_both_mean" "financial_ins_patuniq_mean"
## [49] "housing_ins_both_mean" "physical_health_both_mean"
## [51] "psycsocemo_health_both_mean" "psycsocemo_health_patuniq_mean"
## [53] "expectations_both_mean" "expectations_patuniq_mean"
## [55] "pat_childcare_patuniq_mean" "child_issues_patuniq_mean"
## [57] "pregnancy_patuniq_mean" "age_recoded"
## [59] "age_recoded_narm" "parenthood_age"
## [61] "parenthood_age_narm" "res_aware_both_mean_recode"
## [63] "res_use_both_mean_recode" "socialsupport_both_mean_recode"
## [65] "positive_exp_both_mean_recode" "negative_exp_gen_both_mean_recod"
## [67] "academic_diffty_both_mean_recode" "financial_ins_both_mean_recode"
## [69] "housing_ins_both_mean_recode" "physical_health_both_mean_recode"
## [71] "psycsocemo_health_both_mean_recode" "nurs_or_not"
## [73] "age" "agegroup"
## [75] "binary_gender_original" "binary_gender"
## [77] "race3" "graduate"
## [79] "agegroup_tot" "binary_gender_tot"
## [81] "race3_tot" "graduate_tot"
## [83] "counter1" "sample_tot"
## [85] "baseweight" "finalweight"
data <- data%>%
rename(
ID = x)
#Total count of the sample (N=738)
count(data)
## # A tibble: 1 × 1
## n
## <int>
## 1 738
#rename factor levels of parenthood
unique(data$parenthood)
## [1] "No" "Yes"
data$parenthood<-recode_factor (data$parenthood, No="nonP", Yes="P")
levels(data$parenthood)
## [1] "nonP" "P"
#parenthood status
table(data$parenthood)
##
## nonP P
## 571 167
prop.table(table(data$parenthood))
##
## nonP P
## 0.7737127 0.2262873
#graduate status
table(data$graduate)#0=undergraduate, 1=graduate
##
## 0 1
## 535 203
prop.table(table(data$graduate))
##
## 0 1
## 0.7249322 0.2750678
#parenthood by graduate status
table(data$parenthood, data$graduate)
##
## 0 1
## nonP 445 126
## P 90 77
prop.table(table(data$parenthood, data$graduate), margin=2)
##
## 0 1
## nonP 0.8317757 0.6206897
## P 0.1682243 0.3793103
prop.test(table(data$parenthood, data$graduate), correct=FALSE)
##
## 2-sample test for equality of proportions without continuity correction
##
## data: table(data$parenthood, data$graduate)
## X-squared = 37.452, df = 1, p-value = 9.37e-10
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## 0.1575100 0.3233147
## sample estimates:
## prop 1 prop 2
## 0.7793345 0.5389222
#employment status
table(data$employment_status)
##
## Full-time I do not work. Part-time
## 3 215 203 317
prop.table(table(data$employment_status))
##
## Full-time I do not work. Part-time
## 0.004065041 0.291327913 0.275067751 0.429539295
#age groups
table(data$agegroup)
##
## 1 2 3 4
## 134 200 115 289
prop.table(table(data$agegroup))
##
## 1 2 3 4
## 0.1815718 0.2710027 0.1558266 0.3915989
#pregnancy
table(data$pregnancy)
##
## No Yes
## 2 727 9
prop.table(table(data$pregnancy))
##
## No Yes
## 0.002710027 0.985094851 0.012195122
library(survey)
des<-svydesign(ids=~1, weights=~finalweight, data = data)
#re-do the analysis from above using sample weights
library(questionr)
#parenthood status
wtd.table(data$parenthood,weights = data$finalweight)
## nonP P
## 12521 2203
prop.table(wtd.table(data$parenthood,weights = data$finalweight))
## nonP P
## 0.8503803 0.1496197
#graduate status
wtd.table(data$graduate, weights = data$finalweight)#0=undergraduate, 1=graduate
## 0 1
## 12353 2371
prop.table(wtd.table(data$graduate, weights = data$finalweight))
## 0 1
## 0.8389704 0.1610296
#employment status
wtd.table(data$employment_status, weights = data$finalweight)
## Full-time I do not work. Part-time
## 73 3150 4492 7009
prop.table(wtd.table(data$employment_status, weights = data$finalweight))
## Full-time I do not work. Part-time
## 0.004957892 0.213936430 0.305080141 0.476025537
#race3
##race3=0(Other),race3=1(Asian),race3=2(Black or African American),race3=3(Hispanic or Latino or Spanish origin of any race),race3=4 (White or Caucasian)
wtd.table(data$race3, weights = data$finalweight)#race3=0(Other),race3=1(Asian),race3=2(Black or African American),race3=3(Hispanic or Latino or Spanish origin of any race),race3=4 (White or Caucasian)
## 0 1 2 3 4
## 1342 426 2938 852 9166
prop.table(wtd.table(data$race3, weights = data$finalweight))
## 0 1 2 3 4
## 0.09114371 0.02893236 0.19953817 0.05786471 0.62252105
#age
#agegroup=1(age<20), agegroup=2(age>=20 & age<22),agegroup=3 (age>=22 & age<25),agegroup=4 (age>=25 & age!=.
wtd.table(data$agegroup, weights = data$finalweight)
## 1 2 3 4
## 4123 4096 3003 3502
prop.table(wtd.table(data$agegroup, weights = data$finalweight))
## 1 2 3 4
## 0.2800190 0.2781853 0.2039527 0.2378430
#parenthood by age group
table(data$parenthood, data$agegroup)
##
## 1 2 3 4
## nonP 134 196 110 131
## P 0 4 5 158
prop.table(table(data$parenthood, data$agegroup), margin=2)
##
## 1 2 3 4
## nonP 1.00000000 0.98000000 0.95652174 0.45328720
## P 0.00000000 0.02000000 0.04347826 0.54671280
prop.test(x = c(0, 1, 3, 67), n = c(72, 112, 69, 136))
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(0, 1, 3, 67) out of c(72, 112, 69, 136)
## X-squared = 135.3, df = 3, p-value < 2.2e-16
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.000000000 0.008928571 0.043478261 0.492647059
pairwise.prop.test(x = c(0, 1, 3, 67), n = c(72, 112, 69, 136), p.adjust.method="bonferroni", alternative="two.sided", correct = TRUE)
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(0, 1, 3, 67) out of c(72, 112, 69, 136)
##
## 1 2 3
## 2 1 - -
## 3 1 1 -
## 4 8.8e-12 3.9e-16 2.4e-09
##
## P value adjustment method: bonferroni
#or
parents_number <- c(0, 1, 3, 67)
agegroup_total <- c(72, 112, 69, 136)
pairwise.prop.test(parents_number, agegroup_total)
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: parents_number out of agegroup_total
##
## 1 2 3
## 2 1.00 - -
## 3 0.68 0.68 -
## 4 7.3e-12 3.9e-16 1.6e-09
##
## P value adjustment method: holm
###Gender
#Gender
#binary_gender=1 (Female),binary_gender=2 (Male)
wtd.table(data$binary_gender, weights = data$finalweight)
## 1 2
## 8461 6263
prop.table(wtd.table(data$binary_gender, weights = data$finalweight))
## 1 2
## 0.57464 0.42536
#pregnancy
wtd.table(data$pregnancy, weights = data$finalweight)
## No Yes
## 27 14571 126
prop.table(wtd.table(data$pregnancy, weights = data$finalweight))
## No Yes
## 0.001833741 0.989608802 0.008557457
#parenthood by graduate status (weighted)
wtd.table(data$parenthood, data$graduate, weights = data$finalweight)
## 0 1
## nonP 10949 1572
## P 1404 799
prop.table(wtd.table(data$parenthood, data$graduate, weights = data$finalweight), margin=2)
## 0 1
## nonP 0.8863434 0.6630114
## P 0.1136566 0.3369886
prop.test(wtd.table(data$parenthood, data$graduate, weights = data$finalweight),correct=FALSE)
##
## 2-sample test for equality of proportions without continuity correction
##
## data: wtd.table(data$parenthood, data$graduate, weights = data$finalweight)
## X-squared = 779.79, df = 1, p-value < 2.2e-16
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## 0.2162398 0.2580365
## sample estimates:
## prop 1 prop 2
## 0.8744509 0.6373128
#Proportion test_Resource Awareness by parenthood (weighted)
#drop "" from res_aware_both_mean_recode
data <- data[!(data$res_aware_both_mean_recode==""), ]
unique(data$res_aware_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$res_aware_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 4169 532
## Yes 5995 1268
prop.table(wtd.table(data$res_aware_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.4101732 0.2955556
## Yes 0.5898268 0.7044444
compare_res_aware <-prop.test(x = c(1268, 5995), n = c(1268+532, 5995+4169))
compare_res_aware
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(1268, 5995) out of c(1268 + 532, 5995 + 4169)
## X-squared = 83.739, df = 1, p-value < 2.2e-16
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## 0.0911439 0.1380913
## sample estimates:
## prop 1 prop 2
## 0.7044444 0.5898268
#Proportion test_Resource Use by parenthood (weighted)
#drop "" from res_use_both_mean_recode
data <- data[!(data$res_use_both_mean_recode==""), ]
unique(data$res_use_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$res_use_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 6261 1041
## Yes 2188 421
prop.table(wtd.table(data$res_use_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.7410344 0.7120383
## Yes 0.2589656 0.2879617
compare_res_use <-prop.test(x = c(258, 1901), n = c(258+650, 1901+ 4957))
compare_res_use
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(258, 1901) out of c(258 + 650, 1901 + 4957)
## X-squared = 0.15971, df = 1, p-value = 0.6894
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.02486638 0.03875928
## sample estimates:
## prop 1 prop 2
## 0.2841410 0.2771945
#Proportion test_positive experience by parenthood (weighted)
#drop "" from positive_exp_both_mean_recode
data <- data[!(data$positive_exp_both_mean_recode==""), ]
unique(data$positive_exp_both_mean_recode)
## [1] "No" "Yes"
wtd.table(data$positive_exp_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 7161 1037
## Yes 1078 260
prop.table(wtd.table(data$positive_exp_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.8691589 0.7995374
## Yes 0.1308411 0.2004626
compare_positive_exp <-prop.test(x = c(188, 833), n = c(188+720, 833+ 6025))
compare_positive_exp
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(188, 833) out of c(188 + 720, 833 + 6025)
## X-squared = 50.689, df = 1, p-value = 1.082e-12
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## 0.05749522 0.11367373
## sample estimates:
## prop 1 prop 2
## 0.2070485 0.1214640
#Proportion test_negative experience by parenthood (weighted)
#drop "" from negative_exp_gen_both_mean_recod
data <- data[!(data$negative_exp_gen_both_mean_recod==""), ]
unique(data$negative_exp_gen_both_mean_recod)
## [1] "Yes" "No"
wtd.table(data$negative_exp_gen_both_mean_recod, data$parenthood, weights = data$finalweight)
## nonP P
## No 2912 772
## Yes 5212 525
prop.table(wtd.table(data$negative_exp_gen_both_mean_recod, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.3584441 0.5952197
## Yes 0.6415559 0.4047803
compare_negative_exp <-prop.test(x = c(383, 4387), n = c(383+525, 4387+2471 ))
compare_negative_exp
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(383, 4387) out of c(383 + 525, 4387 + 2471)
## X-squared = 159.73, df = 1, p-value < 2.2e-16
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.2525804 -0.1831890
## sample estimates:
## prop 1 prop 2
## 0.4218062 0.6396909
#Proportion test_housing insecurity by parenthood (weighted)
#drop "" from housing_ins_both_mean_recode
data <- data[!(data$housing_ins_both_mean_recode==""), ]
unique(data$housing_ins_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$housing_ins_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 7346 1215
## Yes 433 55
prop.table(wtd.table(data$housing_ins_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.94433732 0.95669291
## Yes 0.05566268 0.04330709
compare_housing_ins <-prop.test(x = c(55, 413), n = c(55+853, 413+6445))
compare_housing_ins
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(55, 413) out of c(55 + 853, 413 + 6445)
## X-squared = 2.9235e-29, df = 1, p-value = 1
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.01650583 0.01720793
## sample estimates:
## prop 1 prop 2
## 0.06057269 0.06022164
#Proportion test_financial insecurity by parenthood (weighted)
#drop "" from financial_ins_both_mean_recode
data <- data[!(data$financial_ins_both_mean_recode==""), ]
unique(data$financial_ins_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$financial_ins_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 3582 693
## Yes 3780 471
prop.table(wtd.table(data$financial_ins_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.4865526 0.5953608
## Yes 0.5134474 0.4046392
compare_financial_ins <-prop.test(x = c(411, 3529), n = c(411+497, 3529+ 3329))
compare_financial_ins
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(411, 3529) out of c(411 + 497, 3529 + 3329)
## X-squared = 12.061, df = 1, p-value = 0.000515
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.09703072 -0.02684596
## sample estimates:
## prop 1 prop 2
## 0.4526432 0.5145815
#Proportion test_accademic difficulty by parenthood (weighted)
#drop "" from academic_diffty_both_mean_recode
data <- data[!(data$academic_diffty_both_mean_recode==""), ]
unique(data$academic_diffty_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$academic_diffty_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 2549 555
## Yes 4500 516
prop.table(wtd.table(data$academic_diffty_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.3616116 0.5182073
## Yes 0.6383884 0.4817927
compare_academic_diffty <-prop.test(x = c(467, 4434), n = c(467+441, 4434+2424 ))
compare_academic_diffty
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(467, 4434) out of c(467 + 441, 4434 + 2424)
## X-squared = 59.649, df = 1, p-value = 1.134e-14
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.16727163 -0.09718237
## sample estimates:
## prop 1 prop 2
## 0.5143172 0.6465442
#Proportion test_physical health by parenthood (weighted)
#drop "" from physical_health_both_mean_recode
data <- data[!(data$physical_health_both_mean_recode==""), ]
unique(data$physical_health_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$physical_health_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 3625 556
## Yes 3424 505
prop.table(wtd.table(data$physical_health_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.5142573 0.5240339
## Yes 0.4857427 0.4759661
compare_physical_health <-prop.test(x = c(416, 3342), n = c(416+492, 3342+3516))
compare_physical_health
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(416, 3342) out of c(416 + 492, 3342 + 3516)
## X-squared = 2.6153, df = 1, p-value = 0.1058
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.064287239 0.005958627
## sample estimates:
## prop 1 prop 2
## 0.4581498 0.4873141
#Proportion test_psychosocioemotional health by parenthood (weighted)
#drop "" from psycsocemo_health_both_mean_recode
data <- data[!(data$psycsocemo_health_both_mean_recode==""), ]
unique(data$psycsocemo_health_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$psycsocemo_health_both_mean_recode, data$parenthood, weights = data$finalweight)
## nonP P
## No 1900 407
## Yes 4972 553
prop.table(wtd.table(data$psycsocemo_health_both_mean_recode, data$parenthood, weights = data$finalweight), margin=2)
## nonP P
## No 0.2764843 0.4239583
## Yes 0.7235157 0.5760417
compare_psycsocemo_health <-prop.test(x = c(543, 4958), n = c(543+365, 4958+ 1900 ))
compare_psycsocemo_health
##
## 2-sample test for equality of proportions with continuity correction
##
## data: c(543, 4958) out of c(543 + 365, 4958 + 1900)
## X-squared = 59.977, df = 1, p-value = 9.598e-15
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.15916107 -0.09070629
## sample estimates:
## prop 1 prop 2
## 0.5980176 0.7229513
unique(data$parenthood_age_narm)
## [1] "young non-parents" "old parents" "old non-parents"
## [4] "young parents" ""
data <- data[!(data$parenthood_age_narm==""), ]
unique(data$parenthood_age_narm)
## [1] "young non-parents" "old parents" "old non-parents"
## [4] "young parents"
#parenthood_age_narm by graduate status (weighted)
wtd.table(data$parenthood_age_narm, data$graduate, weights = data$finalweight)
## 0 1
## old non-parents 185 551
## old parents 524 283
## young non-parents 5684 438
## young parents 101 0
prop.table(wtd.table(data$parenthood_age_narm, data$graduate, weights = data$finalweight), margin=1)
## 0 1
## old non-parents 0.25135870 0.74864130
## old parents 0.64931846 0.35068154
## young non-parents 0.92845475 0.07154525
## young parents 1.00000000 0.00000000
compare_parenthood_age <-prop.test(x = c(551, 283, 438, 0), n = c(185+551, 524+283, 5684+438, 101 ))
compare_parenthood_age
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(551, 283, 438, 0) out of c(185 + 551, 524 + 283, 5684 + 438, 101)
## X-squared = 2444, df = 3, p-value < 2.2e-16
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.74864130 0.35068154 0.07154525 0.00000000
compare_parenthood_age_pairwise <-pairwise.prop.test(x = c(551, 283, 438, 0), n = c(185+551, 524+283, 5684+438, 101 ))
compare_parenthood_age_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(551, 283, 438, 0) out of c(185 + 551, 524 + 283, 5684 + 438, 101)
##
## 1 2 3
## 2 < 2e-16 - -
## 3 < 2e-16 < 2e-16 -
## 4 < 2e-16 3.3e-12 0.0095
##
## P value adjustment method: holm
#Proportion test_Resource Awareness by parenthood_age_narm (weighted)
#drop "" from res_aware_both_mean_recode
data <- data[!(data$res_aware_both_mean_recode==""), ]
unique(data$res_aware_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$res_aware_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 285 451
## old parents 269 538
## young non-parents 2577 3545
## young parents 14 87
prop.table(wtd.table(data$parenthood_age_narm, data$res_aware_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.3872283 0.6127717
## old parents 0.3333333 0.6666667
## young non-parents 0.4209409 0.5790591
## young parents 0.1386139 0.8613861
compare_res_aware <-prop.test(x = c(451, 538, 3545, 87), n = c(451+285, 538+269, 3545+2577, 87+14 ))
compare_res_aware
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(451, 538, 3545, 87) out of c(451 + 285, 538 + 269, 3545 + 2577, 87 + 14)
## X-squared = 54.364, df = 3, p-value = 9.384e-12
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.6127717 0.6666667 0.5790591 0.8613861
compare_res_aware_pairwise <-pairwise.prop.test(x = c(451, 538, 3545, 87), n = c(451+285, 538+269, 3545+2577, 87+14))
compare_res_aware_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(451, 538, 3545, 87) out of c(451 + 285, 538 + 269, 3545 + 2577, 87 + 14)
##
## 1 2 3
## 2 0.06294 - -
## 3 0.08674 9.6e-06 -
## 4 8.8e-06 0.00033 1.2e-07
##
## P value adjustment method: holm
#Proportion test_Resource Use by parenthood_age_narm (weighted)
#drop "" from res_use_both_mean_recode
data <- data[!(data$res_use_both_mean_recode==""), ]
unique(data$res_use_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$res_use_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 489 247
## old parents 573 234
## young non-parents 4468 1654
## young parents 77 24
prop.table(wtd.table(data$parenthood_age_narm, data$res_use_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.6644022 0.3355978
## old parents 0.7100372 0.2899628
## young non-parents 0.7298269 0.2701731
## young parents 0.7623762 0.2376238
compare_res_use <-prop.test(x = c(247, 234, 1654, 24), n = c(247+489, 234+573, 1654+4468, 24+77 ))
compare_res_use
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(247, 234, 1654, 24) out of c(247 + 489, 234 + 573, 1654 + 4468, 24 + 77)
## X-squared = 15.429, df = 3, p-value = 0.001485
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.3355978 0.2899628 0.2701731 0.2376238
compare_res_use_pairwise <-pairwise.prop.test(x = c(247, 234, 1654, 24), n = c(247+489, 234+573, 1654+4468, 24+77))
compare_res_use_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(247, 234, 1654, 24) out of c(247 + 489, 234 + 573, 1654 + 4468, 24 + 77)
##
## 1 2 3
## 2 0.3019 - -
## 3 0.0013 0.7569 -
## 4 0.3019 0.7569 0.7569
##
## P value adjustment method: holm
#Proportion test_positive experience by parenthood_age_narm (weighted)
#drop "" from positive_exp_both_mean_recode
data <- data[!(data$positive_exp_both_mean_recode==""), ]
unique(data$positive_exp_both_mean_recode)
## [1] "No" "Yes"
wtd.table(data$parenthood_age_narm, data$positive_exp_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 648 88
## old parents 631 176
## young non-parents 5377 745
## young parents 89 12
prop.table(wtd.table(data$parenthood_age_narm, data$positive_exp_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.8804348 0.1195652
## old parents 0.7819083 0.2180917
## young non-parents 0.8783077 0.1216923
## young parents 0.8811881 0.1188119
compare_positive_exp <-prop.test(x = c(88, 176, 745, 12), n = c(88+648, 176+631, 745+5377, 12+89 ))
compare_positive_exp
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(88, 176, 745, 12) out of c(88 + 648, 176 + 631, 745 + 5377, 12 + 89)
## X-squared = 59.21, df = 3, p-value = 8.67e-13
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.1195652 0.2180917 0.1216923 0.1188119
compare_positive_exp_pairwise <-pairwise.prop.test(x = c(88, 176, 745, 59), n = c(88+648, 176+631, 745+5377, 12+89))
compare_positive_exp_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(88, 176, 745, 59) out of c(88 + 648, 176 + 631, 745 + 5377, 12 + 89)
##
## 1 2 3
## 2 8.2e-07 - -
## 3 0.91 1.6e-13 -
## 4 < 2e-16 2.5e-14 < 2e-16
##
## P value adjustment method: holm
#Proportion test_negative experience by parenthood_age_narm (weighted)
#drop "" from negative_exp_gen_both_mean_recod
data <- data[!(data$negative_exp_gen_both_mean_recod==""), ]
unique(data$negative_exp_gen_both_mean_recod)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$negative_exp_gen_both_mean_recod, weights = data$finalweight)
## No Yes
## old non-parents 337 399
## old parents 513 294
## young non-parents 2134 3988
## young parents 12 89
prop.table(wtd.table(data$parenthood_age_narm, data$negative_exp_gen_both_mean_recod, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.4578804 0.5421196
## old parents 0.6356877 0.3643123
## young non-parents 0.3485789 0.6514211
## young parents 0.1188119 0.8811881
compare_negative_exp <-prop.test(x = c(399, 294, 3988, 89), n = c(399+337, 294+513, 3988+2134, 89+12 ))
compare_negative_exp
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(399, 294, 3988, 89) out of c(399 + 337, 294 + 513, 3988 + 2134, 89 + 12)
## X-squared = 294.98, df = 3, p-value < 2.2e-16
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.5421196 0.3643123 0.6514211 0.8811881
compare_negative_exp_pairwise <-pairwise.prop.test(x = c(399, 294, 3988, 89), n = c(399+337, 294+513, 3988+2134, 89+12))
compare_negative_exp_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(399, 294, 3988, 89) out of c(399 + 337, 294 + 513, 3988 + 2134, 89 + 12)
##
## 1 2 3
## 2 1.3e-11 - -
## 3 1.4e-08 < 2e-16 -
## 4 5.6e-10 < 2e-16 2.4e-06
##
## P value adjustment method: holm
#Proportion test_accademic difficulty by parenthood_age_narm (weighted)
#drop "" from academic_diffty_both_mean_recode
data <- data[!(data$academic_diffty_both_mean_recode==""), ]
unique(data$academic_diffty_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$academic_diffty_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 269 467
## old parents 441 366
## young non-parents 2155 3967
## young parents 0 101
prop.table(wtd.table(data$parenthood_age_narm, data$academic_diffty_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.3654891 0.6345109
## old parents 0.5464684 0.4535316
## young non-parents 0.3520091 0.6479909
## young parents 0.0000000 1.0000000
compare_academic_diffty <-prop.test(x = c(467, 366, 3967, 101), n = c(467+269, 366+441, 3967+2155, 101+0 ))
compare_academic_diffty
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(467, 366, 3967, 101) out of c(467 + 269, 366 + 441, 3967 + 2155, 101 + 0)
## X-squared = 175.87, df = 3, p-value < 2.2e-16
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.6345109 0.4535316 0.6479909 1.0000000
compare_academic_diffty_pairwise <-pairwise.prop.test(x = c(467, 366, 3967, 101), n = c(467+269, 366+441, 3967+2155, 101+0))
compare_academic_diffty_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(467, 366, 3967, 101) out of c(467 + 269, 366 + 441, 3967 + 2155, 101 + 0)
##
## 1 2 3
## 2 3.0e-12 - -
## 3 0.5 < 2e-16 -
## 4 1.4e-12 < 2e-16 1.4e-12
##
## P value adjustment method: holm
#Proportion test_financial insecurity by parenthood_age_narm (weighted)
#drop "" from financial_ins_both_mean_recode
data <- data[!(data$financial_ins_both_mean_recode==""), ]
unique(data$financial_ins_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$financial_ins_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 315 421
## old parents 455 352
## young non-parents 3014 3108
## young parents 42 59
prop.table(wtd.table(data$parenthood_age_narm, data$financial_ins_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.4279891 0.5720109
## old parents 0.5638166 0.4361834
## young non-parents 0.4923228 0.5076772
## young parents 0.4158416 0.5841584
compare_financial_ins <-prop.test(x = c(421, 352, 3108, 59), n = c(421+315 , 352+455, 3108+3014, 59+42 ))
compare_financial_ins
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(421, 352, 3108, 59) out of c(421 + 315, 352 + 455, 3108 + 3014, 59 + 42)
## X-squared = 31.05, df = 3, p-value = 8.295e-07
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.5720109 0.4361834 0.5076772 0.5841584
compare_financial_ins_pairwise <-pairwise.prop.test(x = c(421, 352, 3108, 59), n = c(421+315 , 352+455, 3108+3014, 59+42))
compare_financial_ins_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(421, 352, 3108, 59) out of c(421 + 315, 352 + 455, 3108 + 3014, 59 + 42)
##
## 1 2 3
## 2 7.8e-07 - -
## 3 0.00445 0.00078 -
## 4 0.90116 0.02015 0.30853
##
## P value adjustment method: holm
#Proportion test_housing insecurity by parenthood_age_narm (weighted)
#drop "" from housing_ins_both_mean_recode
data <- data[!(data$housing_ins_both_mean_recode==""), ]
unique(data$housing_ins_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$housing_ins_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 648 88
## old parents 775 32
## young non-parents 5797 325
## young parents 78 23
prop.table(wtd.table(data$parenthood_age_narm, data$housing_ins_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.88043478 0.11956522
## old parents 0.96034696 0.03965304
## young non-parents 0.94691277 0.05308723
## young parents 0.77227723 0.22772277
compare_housing_ins <-prop.test(x = c(88, 32, 325, 23), n = c(88+648 , 32+775, 325+5797, 23+78 ))
compare_housing_ins
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(88, 32, 325, 23) out of c(88 + 648, 32 + 775, 325 + 5797, 23 + 78)
## X-squared = 107.34, df = 3, p-value < 2.2e-16
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.11956522 0.03965304 0.05308723 0.22772277
compare_housing_ins_pairwise <-pairwise.prop.test(x = c(88, 32, 325, 23), n = c(88+648 , 32+775, 325+5797, 23+78))
compare_housing_ins_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(88, 32, 325, 23) out of c(88 + 648, 32 + 775, 325 + 5797, 23 + 78)
##
## 1 2 3
## 2 2.5e-08 - -
## 3 5.7e-12 0.1240 -
## 4 0.0088 2.1e-12 1.1e-12
##
## P value adjustment method: holm
#Proportion test_physical health by parenthood_age_narm (weighted)
#drop "" from physical_health_both_mean_recode
data <- data[!(data$physical_health_both_mean_recode==""), ]
unique(data$physical_health_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$physical_health_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 309 427
## old parents 424 383
## young non-parents 3207 2915
## young parents 68 33
prop.table(wtd.table(data$parenthood_age_narm, data$physical_health_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.4198370 0.5801630
## old parents 0.5254027 0.4745973
## young non-parents 0.5238484 0.4761516
## young parents 0.6732673 0.3267327
compare_physical_health <-prop.test(x = c(427, 383, 2915, 33), n = c(427+309, 383+424, 2915+3207, 33+68 ))
compare_physical_health
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(427, 383, 2915, 33) out of c(427 + 309, 383 + 424, 2915 + 3207, 33 + 68)
## X-squared = 39.05, df = 3, p-value = 1.694e-08
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.5801630 0.4745973 0.4761516 0.3267327
compare_physical_health_pairwise <-pairwise.prop.test(x = c(427, 383, 2915, 33), n = c(427+309, 383+424, 2915+3207, 33+68))
compare_physical_health_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(427, 383, 2915, 33) out of c(427 + 309, 383 + 424, 2915 + 3207, 33 + 68)
##
## 1 2 3
## 2 0.00017 - -
## 3 7.1e-07 0.96362 -
## 4 1.3e-05 0.01363 0.01184
##
## P value adjustment method: holm
#Proportion test_psychosocioemotional health by parenthood_age_narm (weighted)
#drop "" from psycsocemo_health_both_mean_recode
data <- data[!(data$psycsocemo_health_both_mean_recode==""), ]
unique(data$psycsocemo_health_both_mean_recode)
## [1] "Yes" "No"
wtd.table(data$parenthood_age_narm, data$psycsocemo_health_both_mean_recode, weights = data$finalweight)
## No Yes
## old non-parents 244 492
## old parents 323 484
## young non-parents 1656 4466
## young parents 42 59
prop.table(wtd.table(data$parenthood_age_narm, data$psycsocemo_health_both_mean_recode, weights = data$finalweight), margin=1)
## No Yes
## old non-parents 0.3315217 0.6684783
## old parents 0.4002478 0.5997522
## young non-parents 0.2704998 0.7295002
## young parents 0.4158416 0.5841584
compare_psychosocioemotional_health <-prop.test(x = c(492, 484, 4466, 59), n = c(492+244, 484+323, 4466+1656, 59+42))
compare_psychosocioemotional_health
##
## 4-sample test for equality of proportions without continuity correction
##
## data: c(492, 484, 4466, 59) out of c(492 + 244, 484 + 323, 4466 + 1656, 59 + 42)
## X-squared = 72.528, df = 3, p-value = 1.227e-15
## alternative hypothesis: two.sided
## sample estimates:
## prop 1 prop 2 prop 3 prop 4
## 0.6684783 0.5997522 0.7295002 0.5841584
compare_psychosocioemotional_health_pairwise <-pairwise.prop.test(x = c(492, 484, 4466, 59), n = c(492+244, 484+323, 4466+1656, 59+42))
compare_psychosocioemotional_health_pairwise
##
## Pairwise comparisons using Pairwise comparison of proportions
##
## data: c(492, 484, 4466, 59) out of c(492 + 244, 484 + 323, 4466 + 1656, 59 + 42)
##
## 1 2 3
## 2 0.0182 - -
## 3 0.0028 1.4e-13 -
## 4 0.2358 0.8464 0.0068
##
## P value adjustment method: holm
###################### academic_difficulty ##########################################################
#weighted
Hmisc::describe(data$academic_diffty_both_mean, weights = data$finalweight)
## data$academic_diffty_both_mean
## n missing distinct Info Mean
## 7766 0 5 0.89 3.373
##
## lowest : 1 2 3 4 5, highest: 1 2 3 4 5
##
## Value 1 2 3 4 5
## Frequency 35 1175 3263 2446 847
## Proportion 0.005 0.151 0.420 0.315 0.109
t.test(academic_diffty_both_mean~parenthood, data=data, weights = data$finalweight, var.equal=TRUE)
##
## Two Sample t-test
##
## data: academic_diffty_both_mean by parenthood
## t = 2.0651, df = 384, p-value = 0.03958
## alternative hypothesis: true difference in means between group nonP and group P is not equal to 0
## 95 percent confidence interval:
## 0.01174103 0.47817805
## sample estimates:
## mean in group nonP mean in group P
## 3.375394 3.130435
###################### psycsocemo_health_issues ##########################################################
#weighted
Hmisc::describe(data$psycsocemo_health_both_mean, weights = data$finalweight)
## data$psycsocemo_health_both_mean
## n missing distinct Info Mean
## 7766 0 4 0.873 3.598
##
## Value 2 3 4 5
## Frequency 824 2459 3501 982
## Proportion 0.106 0.317 0.451 0.126
t.test(psycsocemo_health_both_mean~parenthood, data=data, weights = data$finalweight, var.equal=TRUE)
##
## Two Sample t-test
##
## data: psycsocemo_health_both_mean by parenthood
## t = 2.1661, df = 384, p-value = 0.03092
## alternative hypothesis: true difference in means between group nonP and group P is not equal to 0
## 95 percent confidence interval:
## 0.02212051 0.45710044
## sample estimates:
## mean in group nonP mean in group P
## 3.630915 3.391304
reg_psycsocemo_health_both<-lm(psycsocemo_health_both_mean~age + + binary_gender + race3 + graduate + parenthood + socialsupport_both_mean + financial_ins_both_mean + physical_health_both_mean+negative_exp_gen_both_mean+res_aware_both_mean+res_use_both_mean, data=data,weights = data$finalweight, var.equal=TRUE)
summary(reg_psycsocemo_health_both)
##
## Call:
## lm(formula = psycsocemo_health_both_mean ~ age + +binary_gender +
## race3 + graduate + parenthood + socialsupport_both_mean +
## financial_ins_both_mean + physical_health_both_mean + negative_exp_gen_both_mean +
## res_aware_both_mean + res_use_both_mean, data = data, weights = data$finalweight,
## var.equal = TRUE)
##
## Weighted Residuals:
## Min 1Q Median 3Q Max
## -9.8958 -1.4530 0.1092 1.6066 10.8839
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.371935 0.323356 7.335 1.40e-12 ***
## age 0.008247 0.005326 1.548 0.122365
## binary_gender2 -0.004489 0.061832 -0.073 0.942160
## race31 -0.308692 0.206027 -1.498 0.134904
## race32 -0.322629 0.130628 -2.470 0.013967 *
## race33 0.056087 0.167688 0.334 0.738214
## race34 -0.214691 0.117485 -1.827 0.068445 .
## graduate1 -0.169452 0.095110 -1.782 0.075625 .
## parenthoodP -0.118271 0.112422 -1.052 0.293472
## socialsupport_both_mean -0.191472 0.042403 -4.516 8.50e-06 ***
## financial_ins_both_mean 0.075787 0.043383 1.747 0.081479 .
## physical_health_both_mean 0.118038 0.033002 3.577 0.000394 ***
## negative_exp_gen_both_mean 0.342067 0.039946 8.563 2.97e-16 ***
## res_aware_both_mean -0.076724 0.036515 -2.101 0.036298 *
## res_use_both_mean 0.089142 0.053905 1.654 0.099034 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.604 on 371 degrees of freedom
## Multiple R-squared: 0.541, Adjusted R-squared: 0.5237
## F-statistic: 31.23 on 14 and 371 DF, p-value: < 2.2e-16
reg_psycsocemo_health_both<-lm(psycsocemo_health_both_mean~age + + binary_gender + race3 + graduate + parenthood + socialsupport_both_mean + financial_ins_both_mean + physical_health_both_mean+negative_exp_gen_both_mean+res_aware_both_mean+res_use_both_mean, data=data,weights = data$finalweight, var.equal=TRUE)
summary(reg_psycsocemo_health_both)
##
## Call:
## lm(formula = psycsocemo_health_both_mean ~ age + +binary_gender +
## race3 + graduate + parenthood + socialsupport_both_mean +
## financial_ins_both_mean + physical_health_both_mean + negative_exp_gen_both_mean +
## res_aware_both_mean + res_use_both_mean, data = data, weights = data$finalweight,
## var.equal = TRUE)
##
## Weighted Residuals:
## Min 1Q Median 3Q Max
## -9.8958 -1.4530 0.1092 1.6066 10.8839
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.371935 0.323356 7.335 1.40e-12 ***
## age 0.008247 0.005326 1.548 0.122365
## binary_gender2 -0.004489 0.061832 -0.073 0.942160
## race31 -0.308692 0.206027 -1.498 0.134904
## race32 -0.322629 0.130628 -2.470 0.013967 *
## race33 0.056087 0.167688 0.334 0.738214
## race34 -0.214691 0.117485 -1.827 0.068445 .
## graduate1 -0.169452 0.095110 -1.782 0.075625 .
## parenthoodP -0.118271 0.112422 -1.052 0.293472
## socialsupport_both_mean -0.191472 0.042403 -4.516 8.50e-06 ***
## financial_ins_both_mean 0.075787 0.043383 1.747 0.081479 .
## physical_health_both_mean 0.118038 0.033002 3.577 0.000394 ***
## negative_exp_gen_both_mean 0.342067 0.039946 8.563 2.97e-16 ***
## res_aware_both_mean -0.076724 0.036515 -2.101 0.036298 *
## res_use_both_mean 0.089142 0.053905 1.654 0.099034 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.604 on 371 degrees of freedom
## Multiple R-squared: 0.541, Adjusted R-squared: 0.5237
## F-statistic: 31.23 on 14 and 371 DF, p-value: < 2.2e-16
#un-weighted (lots of missing values!)
Hmisc::describe(data$res_aware_patuniq_mean)
## data$res_aware_patuniq_mean
## n missing distinct Info Mean Gmd
## 55 331 5 0.801 2.527 0.6882
##
## lowest : 1 2 3 4 5, highest: 1 2 3 4 5
##
## Value 1 2 3 4 5
## Frequency 2 25 26 1 1
## Proportion 0.036 0.455 0.473 0.018 0.018
Hmisc::describe(data$res_use_patuniq_mean)
## data$res_use_patuniq_mean
## n missing distinct Info Mean Gmd
## 34 352 3 0.545 3.265 0.4296
##
## Value 3 4 5
## Frequency 26 7 1
## Proportion 0.765 0.206 0.029
Hmisc::describe(data$socialsupport_patuniq_mean)
## data$socialsupport_patuniq_mean
## n missing distinct Info Mean Gmd
## 52 334 4 0.857 3.481 0.8318
##
## Value 2 3 4 5
## Frequency 5 21 22 4
## Proportion 0.096 0.404 0.423 0.077
Hmisc::describe(data$positive_exp_patuniq_mean)
## data$positive_exp_patuniq_mean
## n missing distinct Info Mean Gmd
## 51 335 3 0.727 3.784 0.571
##
## Value 3 4 5
## Frequency 15 32 4
## Proportion 0.294 0.627 0.078
Hmisc::describe(data$negative_exp_gen_patuniq_mean)
## data$negative_exp_gen_patuniq_mean
## n missing distinct Info Mean Gmd
## 51 335 3 0.727 3.784 0.571
##
## Value 3 4 5
## Frequency 15 32 4
## Proportion 0.294 0.627 0.078
Hmisc::describe(data$financial_ins_patuniq_mean)
## data$financial_ins_patuniq_mean
## n missing distinct Info Mean Gmd
## 386 0 5 0.899 3.251 0.983
##
## lowest : 1 2 3 4 5, highest: 1 2 3 4 5
##
## Value 1 2 3 4 5
## Frequency 3 79 155 116 33
## Proportion 0.008 0.205 0.402 0.301 0.085
Hmisc::describe(data$academic_diffty_patuniq_mean)
## data$academic_diffty_patuniq_mean
## n missing distinct Info Mean Gmd
## 55 331 4 0.92 3.473 1.091
##
## Value 2 3 4 5
## Frequency 10 18 18 9
## Proportion 0.182 0.327 0.327 0.164
Hmisc::describe(data$psycsocemo_health_patuniq_mean)
## data$psycsocemo_health_patuniq_mean
## n missing distinct Info Mean Gmd
## 52 334 4 0.829 3.462 0.816
##
## Value 2 3 4 5
## Frequency 7 16 27 2
## Proportion 0.135 0.308 0.519 0.038
Hmisc::describe(data$pat_childcare_patuniq_mean)
## data$pat_childcare_patuniq_mean
## n missing distinct Info Mean Gmd
## 50 336 4 0.82 3.62 0.7257
##
## Value 2 3 4 5
## Frequency 2 19 25 4
## Proportion 0.04 0.38 0.50 0.08
Hmisc::describe(data$child_issues_patuniq_mean)
## data$child_issues_patuniq_mean
## n missing distinct Info Mean Gmd
## 43 343 4 0.873 3.512 0.8948
##
## Value 2 3 4 5
## Frequency 4 18 16 5
## Proportion 0.093 0.419 0.372 0.116
Hmisc::describe(data$physical_health_both_mean)
## data$physical_health_both_mean
## n missing distinct Info Mean Gmd
## 386 0 5 0.927 3.513 1.145
##
## lowest : 1 2 3 4 5, highest: 1 2 3 4 5
##
## Value 1 2 3 4 5
## Frequency 7 61 121 121 76
## Proportion 0.018 0.158 0.313 0.313 0.197
#weighted (such missingness warrants cautious generalization!)
Hmisc::describe(data$res_aware_patuniq_mean, weights = data$finalweight)
## data$res_aware_patuniq_mean
## n missing distinct Info Mean
## 732 7034 5 0.798 2.598
##
## lowest : 1 2 3 4 5, highest: 1 2 3 4 5
##
## Value 1 2 3 4 5
## Frequency 31 286 382 12 21
## Proportion 0.042 0.391 0.522 0.016 0.029
Hmisc::describe(data$res_use_patuniq_mean, weights = data$finalweight)
## data$res_use_patuniq_mean
## n missing distinct Info Mean
## 516 7250 3 0.568 3.308
##
## Value 3 4 5
## Frequency 388 97 31
## Proportion 0.752 0.188 0.060
Hmisc::describe(data$socialsupport_patuniq_mean, weights = data$finalweight)
## data$socialsupport_patuniq_mean
## n missing distinct Info Mean
## 684 7082 4 0.856 3.398
##
## Value 2 3 4 5
## Frequency 75 312 247 50
## Proportion 0.110 0.456 0.361 0.073
Hmisc::describe(data$positive_exp_patuniq_mean, weights = data$finalweight)
## data$positive_exp_patuniq_mean
## n missing distinct Info Mean
## 684 7082 3 0.744 3.81
##
## Value 3 4 5
## Frequency 197 420 67
## Proportion 0.288 0.614 0.098
Hmisc::describe(data$negative_exp_gen_patuniq_mean, weights = data$finalweight)
## data$negative_exp_gen_patuniq_mean
## n missing distinct Info Mean
## 684 7082 3 0.744 3.81
##
## Value 3 4 5
## Frequency 197 420 67
## Proportion 0.288 0.614 0.098
Hmisc::describe(data$financial_ins_patuniq_mean, weights = data$finalweight)
## data$financial_ins_patuniq_mean
## n missing distinct Info Mean
## 7766 0 5 0.897 3.229
##
## lowest : 1 2 3 4 5, highest: 1 2 3 4 5
##
## Value 1 2 3 4 5
## Frequency 72 1622 3212 2177 683
## Proportion 0.009 0.209 0.414 0.280 0.088
Hmisc::describe(data$academic_diffty_patuniq_mean, weights = data$finalweight)
## data$academic_diffty_patuniq_mean
## n missing distinct Info Mean
## 722 7044 4 0.93 3.316
##
## Value 2 3 4 5
## Frequency 205 199 203 115
## Proportion 0.284 0.276 0.281 0.159
Hmisc::describe(data$psycsocemo_health_patuniq_mean, weights = data$finalweight)
## data$psycsocemo_health_patuniq_mean
## n missing distinct Info Mean
## 691 7075 4 0.808 3.486
##
## Value 2 3 4 5
## Frequency 96 188 382 25
## Proportion 0.139 0.272 0.553 0.036
Hmisc::describe(data$pat_childcare_patuniq_mean, weights = data$finalweight)
## data$pat_childcare_patuniq_mean
## n missing distinct Info Mean
## 674 7092 4 0.82 3.558
##
## Value 2 3 4 5
## Frequency 20 309 294 51
## Proportion 0.030 0.458 0.436 0.076
Hmisc::describe(data$child_issues_patuniq_mean, weights = data$finalweight)
## data$child_issues_patuniq_mean
## n missing distinct Info Mean
## 612 7154 4 0.88 3.43
##
## Value 2 3 4 5
## Frequency 77 260 210 65
## Proportion 0.126 0.425 0.343 0.106
Hmisc::describe(data$physical_health_both_mean, weights = data$finalweight)
## data$physical_health_both_mean
## n missing distinct Info Mean
## 7766 0 5 0.933 3.426
##
## lowest : 1 2 3 4 5, highest: 1 2 3 4 5
##
## Value 1 2 3 4 5
## Frequency 165 1546 2297 2331 1427
## Proportion 0.021 0.199 0.296 0.300 0.184
patuniq <- dplyr::select(data, res_aware_patuniq_mean, res_use_patuniq_mean, socialsupport_patuniq_mean, negative_exp_gen_patuniq_mean, academic_diffty_patuniq_mean, financial_ins_patuniq_mean, physical_health_both_mean, psycsocemo_health_patuniq_mean, pat_childcare_patuniq_mean, child_issues_patuniq_mean)
#pairwise deletion: [rcorr(as.matrix(patuniq), type="pearson")]
#The default of rcorr() is pairwise deletion. To do listwide deletion, remove incomplete data first.
patuniq_complete<-patuniq[complete.cases(patuniq),]
cor.matrix<-rcorr(as.matrix(patuniq_complete), type="pearson")
cor.matrix
## res_aware_patuniq_mean res_use_patuniq_mean
## res_aware_patuniq_mean 1.00 0.01
## res_use_patuniq_mean 0.01 1.00
## socialsupport_patuniq_mean 0.25 0.11
## negative_exp_gen_patuniq_mean -0.21 0.29
## academic_diffty_patuniq_mean -0.36 -0.02
## financial_ins_patuniq_mean 0.09 -0.17
## physical_health_both_mean 0.22 -0.25
## psycsocemo_health_patuniq_mean -0.08 0.03
## pat_childcare_patuniq_mean -0.07 0.12
## child_issues_patuniq_mean 0.18 -0.01
## socialsupport_patuniq_mean
## res_aware_patuniq_mean 0.25
## res_use_patuniq_mean 0.11
## socialsupport_patuniq_mean 1.00
## negative_exp_gen_patuniq_mean 0.21
## academic_diffty_patuniq_mean -0.07
## financial_ins_patuniq_mean -0.09
## physical_health_both_mean 0.01
## psycsocemo_health_patuniq_mean -0.17
## pat_childcare_patuniq_mean -0.05
## child_issues_patuniq_mean 0.08
## negative_exp_gen_patuniq_mean
## res_aware_patuniq_mean -0.21
## res_use_patuniq_mean 0.29
## socialsupport_patuniq_mean 0.21
## negative_exp_gen_patuniq_mean 1.00
## academic_diffty_patuniq_mean 0.05
## financial_ins_patuniq_mean -0.09
## physical_health_both_mean -0.19
## psycsocemo_health_patuniq_mean -0.28
## pat_childcare_patuniq_mean -0.21
## child_issues_patuniq_mean -0.36
## academic_diffty_patuniq_mean
## res_aware_patuniq_mean -0.36
## res_use_patuniq_mean -0.02
## socialsupport_patuniq_mean -0.07
## negative_exp_gen_patuniq_mean 0.05
## academic_diffty_patuniq_mean 1.00
## financial_ins_patuniq_mean 0.40
## physical_health_both_mean 0.22
## psycsocemo_health_patuniq_mean 0.49
## pat_childcare_patuniq_mean 0.57
## child_issues_patuniq_mean 0.32
## financial_ins_patuniq_mean
## res_aware_patuniq_mean 0.09
## res_use_patuniq_mean -0.17
## socialsupport_patuniq_mean -0.09
## negative_exp_gen_patuniq_mean -0.09
## academic_diffty_patuniq_mean 0.40
## financial_ins_patuniq_mean 1.00
## physical_health_both_mean 0.45
## psycsocemo_health_patuniq_mean 0.29
## pat_childcare_patuniq_mean 0.45
## child_issues_patuniq_mean 0.49
## physical_health_both_mean
## res_aware_patuniq_mean 0.22
## res_use_patuniq_mean -0.25
## socialsupport_patuniq_mean 0.01
## negative_exp_gen_patuniq_mean -0.19
## academic_diffty_patuniq_mean 0.22
## financial_ins_patuniq_mean 0.45
## physical_health_both_mean 1.00
## psycsocemo_health_patuniq_mean 0.40
## pat_childcare_patuniq_mean 0.27
## child_issues_patuniq_mean 0.47
## psycsocemo_health_patuniq_mean
## res_aware_patuniq_mean -0.08
## res_use_patuniq_mean 0.03
## socialsupport_patuniq_mean -0.17
## negative_exp_gen_patuniq_mean -0.28
## academic_diffty_patuniq_mean 0.49
## financial_ins_patuniq_mean 0.29
## physical_health_both_mean 0.40
## psycsocemo_health_patuniq_mean 1.00
## pat_childcare_patuniq_mean 0.74
## child_issues_patuniq_mean 0.45
## pat_childcare_patuniq_mean
## res_aware_patuniq_mean -0.07
## res_use_patuniq_mean 0.12
## socialsupport_patuniq_mean -0.05
## negative_exp_gen_patuniq_mean -0.21
## academic_diffty_patuniq_mean 0.57
## financial_ins_patuniq_mean 0.45
## physical_health_both_mean 0.27
## psycsocemo_health_patuniq_mean 0.74
## pat_childcare_patuniq_mean 1.00
## child_issues_patuniq_mean 0.58
## child_issues_patuniq_mean
## res_aware_patuniq_mean 0.18
## res_use_patuniq_mean -0.01
## socialsupport_patuniq_mean 0.08
## negative_exp_gen_patuniq_mean -0.36
## academic_diffty_patuniq_mean 0.32
## financial_ins_patuniq_mean 0.49
## physical_health_both_mean 0.47
## psycsocemo_health_patuniq_mean 0.45
## pat_childcare_patuniq_mean 0.58
## child_issues_patuniq_mean 1.00
##
## n= 29
##
##
## P
## res_aware_patuniq_mean res_use_patuniq_mean
## res_aware_patuniq_mean 0.9501
## res_use_patuniq_mean 0.9501
## socialsupport_patuniq_mean 0.1972 0.5868
## negative_exp_gen_patuniq_mean 0.2788 0.1231
## academic_diffty_patuniq_mean 0.0546 0.9121
## financial_ins_patuniq_mean 0.6567 0.3681
## physical_health_both_mean 0.2558 0.1827
## psycsocemo_health_patuniq_mean 0.6843 0.8597
## pat_childcare_patuniq_mean 0.7035 0.5337
## child_issues_patuniq_mean 0.3474 0.9501
## socialsupport_patuniq_mean
## res_aware_patuniq_mean 0.1972
## res_use_patuniq_mean 0.5868
## socialsupport_patuniq_mean
## negative_exp_gen_patuniq_mean 0.2788
## academic_diffty_patuniq_mean 0.7054
## financial_ins_patuniq_mean 0.6567
## physical_health_both_mean 0.9546
## psycsocemo_health_patuniq_mean 0.3826
## pat_childcare_patuniq_mean 0.7884
## child_issues_patuniq_mean 0.6745
## negative_exp_gen_patuniq_mean
## res_aware_patuniq_mean 0.2788
## res_use_patuniq_mean 0.1231
## socialsupport_patuniq_mean 0.2788
## negative_exp_gen_patuniq_mean
## academic_diffty_patuniq_mean 0.8059
## financial_ins_patuniq_mean 0.6334
## physical_health_both_mean 0.3188
## psycsocemo_health_patuniq_mean 0.1342
## pat_childcare_patuniq_mean 0.2735
## child_issues_patuniq_mean 0.0587
## academic_diffty_patuniq_mean
## res_aware_patuniq_mean 0.0546
## res_use_patuniq_mean 0.9121
## socialsupport_patuniq_mean 0.7054
## negative_exp_gen_patuniq_mean 0.8059
## academic_diffty_patuniq_mean
## financial_ins_patuniq_mean 0.0320
## physical_health_both_mean 0.2479
## psycsocemo_health_patuniq_mean 0.0065
## pat_childcare_patuniq_mean 0.0011
## child_issues_patuniq_mean 0.0935
## financial_ins_patuniq_mean
## res_aware_patuniq_mean 0.6567
## res_use_patuniq_mean 0.3681
## socialsupport_patuniq_mean 0.6567
## negative_exp_gen_patuniq_mean 0.6334
## academic_diffty_patuniq_mean 0.0320
## financial_ins_patuniq_mean
## physical_health_both_mean 0.0146
## psycsocemo_health_patuniq_mean 0.1235
## pat_childcare_patuniq_mean 0.0132
## child_issues_patuniq_mean 0.0074
## physical_health_both_mean
## res_aware_patuniq_mean 0.2558
## res_use_patuniq_mean 0.1827
## socialsupport_patuniq_mean 0.9546
## negative_exp_gen_patuniq_mean 0.3188
## academic_diffty_patuniq_mean 0.2479
## financial_ins_patuniq_mean 0.0146
## physical_health_both_mean
## psycsocemo_health_patuniq_mean 0.0313
## pat_childcare_patuniq_mean 0.1543
## child_issues_patuniq_mean 0.0102
## psycsocemo_health_patuniq_mean
## res_aware_patuniq_mean 0.6843
## res_use_patuniq_mean 0.8597
## socialsupport_patuniq_mean 0.3826
## negative_exp_gen_patuniq_mean 0.1342
## academic_diffty_patuniq_mean 0.0065
## financial_ins_patuniq_mean 0.1235
## physical_health_both_mean 0.0313
## psycsocemo_health_patuniq_mean
## pat_childcare_patuniq_mean 0.0000
## child_issues_patuniq_mean 0.0144
## pat_childcare_patuniq_mean
## res_aware_patuniq_mean 0.7035
## res_use_patuniq_mean 0.5337
## socialsupport_patuniq_mean 0.7884
## negative_exp_gen_patuniq_mean 0.2735
## academic_diffty_patuniq_mean 0.0011
## financial_ins_patuniq_mean 0.0132
## physical_health_both_mean 0.1543
## psycsocemo_health_patuniq_mean 0.0000
## pat_childcare_patuniq_mean
## child_issues_patuniq_mean 0.0010
## child_issues_patuniq_mean
## res_aware_patuniq_mean 0.3474
## res_use_patuniq_mean 0.9501
## socialsupport_patuniq_mean 0.6745
## negative_exp_gen_patuniq_mean 0.0587
## academic_diffty_patuniq_mean 0.0935
## financial_ins_patuniq_mean 0.0074
## physical_health_both_mean 0.0102
## psycsocemo_health_patuniq_mean 0.0144
## pat_childcare_patuniq_mean 0.0010
## child_issues_patuniq_mean
##correlation coefficients(repetitive codes)
# r's
#cor_df_r<-as.data.frame.matrix(round(cor.matrix$r,2)) #round to 2 d.p.
#cor_df_r
# p's
cor_df_p<-as.data.frame.matrix(round(cor.matrix$P,3)) #round to 3 d.p.
cor_df_p[cor_df_p == 0] <- "< .001"
cor_df_p[is.na(cor_df_p)] <- "-"
cor_df_p
## res_aware_patuniq_mean res_use_patuniq_mean
## res_aware_patuniq_mean - 0.95
## res_use_patuniq_mean 0.95 -
## socialsupport_patuniq_mean 0.197 0.587
## negative_exp_gen_patuniq_mean 0.279 0.123
## academic_diffty_patuniq_mean 0.055 0.912
## financial_ins_patuniq_mean 0.657 0.368
## physical_health_both_mean 0.256 0.183
## psycsocemo_health_patuniq_mean 0.684 0.86
## pat_childcare_patuniq_mean 0.704 0.534
## child_issues_patuniq_mean 0.347 0.95
## socialsupport_patuniq_mean
## res_aware_patuniq_mean 0.197
## res_use_patuniq_mean 0.587
## socialsupport_patuniq_mean -
## negative_exp_gen_patuniq_mean 0.279
## academic_diffty_patuniq_mean 0.705
## financial_ins_patuniq_mean 0.657
## physical_health_both_mean 0.955
## psycsocemo_health_patuniq_mean 0.383
## pat_childcare_patuniq_mean 0.788
## child_issues_patuniq_mean 0.674
## negative_exp_gen_patuniq_mean
## res_aware_patuniq_mean 0.279
## res_use_patuniq_mean 0.123
## socialsupport_patuniq_mean 0.279
## negative_exp_gen_patuniq_mean -
## academic_diffty_patuniq_mean 0.806
## financial_ins_patuniq_mean 0.633
## physical_health_both_mean 0.319
## psycsocemo_health_patuniq_mean 0.134
## pat_childcare_patuniq_mean 0.274
## child_issues_patuniq_mean 0.059
## academic_diffty_patuniq_mean
## res_aware_patuniq_mean 0.055
## res_use_patuniq_mean 0.912
## socialsupport_patuniq_mean 0.705
## negative_exp_gen_patuniq_mean 0.806
## academic_diffty_patuniq_mean -
## financial_ins_patuniq_mean 0.032
## physical_health_both_mean 0.248
## psycsocemo_health_patuniq_mean 0.007
## pat_childcare_patuniq_mean 0.001
## child_issues_patuniq_mean 0.094
## financial_ins_patuniq_mean
## res_aware_patuniq_mean 0.657
## res_use_patuniq_mean 0.368
## socialsupport_patuniq_mean 0.657
## negative_exp_gen_patuniq_mean 0.633
## academic_diffty_patuniq_mean 0.032
## financial_ins_patuniq_mean -
## physical_health_both_mean 0.015
## psycsocemo_health_patuniq_mean 0.123
## pat_childcare_patuniq_mean 0.013
## child_issues_patuniq_mean 0.007
## physical_health_both_mean
## res_aware_patuniq_mean 0.256
## res_use_patuniq_mean 0.183
## socialsupport_patuniq_mean 0.955
## negative_exp_gen_patuniq_mean 0.319
## academic_diffty_patuniq_mean 0.248
## financial_ins_patuniq_mean 0.015
## physical_health_both_mean -
## psycsocemo_health_patuniq_mean 0.031
## pat_childcare_patuniq_mean 0.154
## child_issues_patuniq_mean 0.01
## psycsocemo_health_patuniq_mean
## res_aware_patuniq_mean 0.684
## res_use_patuniq_mean 0.86
## socialsupport_patuniq_mean 0.383
## negative_exp_gen_patuniq_mean 0.134
## academic_diffty_patuniq_mean 0.007
## financial_ins_patuniq_mean 0.123
## physical_health_both_mean 0.031
## psycsocemo_health_patuniq_mean -
## pat_childcare_patuniq_mean < .001
## child_issues_patuniq_mean 0.014
## pat_childcare_patuniq_mean
## res_aware_patuniq_mean 0.704
## res_use_patuniq_mean 0.534
## socialsupport_patuniq_mean 0.788
## negative_exp_gen_patuniq_mean 0.274
## academic_diffty_patuniq_mean 0.001
## financial_ins_patuniq_mean 0.013
## physical_health_both_mean 0.154
## psycsocemo_health_patuniq_mean < .001
## pat_childcare_patuniq_mean -
## child_issues_patuniq_mean 0.001
## child_issues_patuniq_mean
## res_aware_patuniq_mean 0.347
## res_use_patuniq_mean 0.95
## socialsupport_patuniq_mean 0.674
## negative_exp_gen_patuniq_mean 0.059
## academic_diffty_patuniq_mean 0.094
## financial_ins_patuniq_mean 0.007
## physical_health_both_mean 0.01
## psycsocemo_health_patuniq_mean 0.014
## pat_childcare_patuniq_mean 0.001
## child_issues_patuniq_mean -
#un-weighted
reg_psycsocemo_health_patuniq_unweighted<-lm(psycsocemo_health_patuniq_mean~age + binary_gender + race3 + graduate + socialsupport_patuniq_mean + financial_ins_patuniq_mean + physical_health_both_mean+negative_exp_gen_patuniq_mean+res_aware_patuniq_mean+res_use_patuniq_mean +pat_childcare_patuniq_mean + child_issues_patuniq_mean, data=data,var.equal=TRUE)
summary(reg_psycsocemo_health_patuniq_unweighted)
##
## Call:
## lm(formula = psycsocemo_health_patuniq_mean ~ age + binary_gender +
## race3 + graduate + socialsupport_patuniq_mean + financial_ins_patuniq_mean +
## physical_health_both_mean + negative_exp_gen_patuniq_mean +
## res_aware_patuniq_mean + res_use_patuniq_mean + pat_childcare_patuniq_mean +
## child_issues_patuniq_mean, data = data, var.equal = TRUE)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.7292 -0.2498 0.0000 0.1442 1.2241
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.39824 1.70231 0.821 0.4252
## age 0.01724 0.01970 0.875 0.3961
## binary_gender2 0.23542 0.32163 0.732 0.4763
## race32 0.15791 0.69571 0.227 0.8237
## race33 0.68531 0.85170 0.805 0.4345
## race34 -0.11793 0.50732 -0.232 0.8195
## graduate1 -0.14012 0.30185 -0.464 0.6496
## socialsupport_patuniq_mean 0.02235 0.19025 0.118 0.9081
## financial_ins_patuniq_mean -0.12748 0.18008 -0.708 0.4906
## physical_health_both_mean 0.22650 0.13509 1.677 0.1158
## negative_exp_gen_patuniq_mean -0.31397 0.24782 -1.267 0.2259
## res_aware_patuniq_mean -0.20897 0.22186 -0.942 0.3622
## res_use_patuniq_mean 0.16851 0.34060 0.495 0.6284
## pat_childcare_patuniq_mean 0.76860 0.21553 3.566 0.0031 **
## child_issues_patuniq_mean -0.19350 0.27334 -0.708 0.4906
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5867 on 14 degrees of freedom
## (357 observations deleted due to missingness)
## Multiple R-squared: 0.7194, Adjusted R-squared: 0.4388
## F-statistic: 2.564 on 14 and 14 DF, p-value: 0.04454
#weighted
reg_psycsocemo_health_patuniq_weighted<-lm(psycsocemo_health_patuniq_mean~age + binary_gender + race3 + graduate + socialsupport_patuniq_mean + financial_ins_patuniq_mean + physical_health_both_mean+negative_exp_gen_patuniq_mean+res_aware_patuniq_mean+res_use_patuniq_mean + pat_childcare_patuniq_mean + child_issues_patuniq_mean, data=data,weights = data$finalweight, var.equal=TRUE)
summary(reg_psycsocemo_health_patuniq_weighted)
##
## Call:
## lm(formula = psycsocemo_health_patuniq_mean ~ age + binary_gender +
## race3 + graduate + socialsupport_patuniq_mean + financial_ins_patuniq_mean +
## physical_health_both_mean + negative_exp_gen_patuniq_mean +
## res_aware_patuniq_mean + res_use_patuniq_mean + pat_childcare_patuniq_mean +
## child_issues_patuniq_mean, data = data, weights = data$finalweight,
## var.equal = TRUE)
##
## Weighted Residuals:
## Min 1Q Median 3Q Max
## -2.2604 -0.8149 -0.2006 0.5879 4.8963
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.15124 1.52397 -0.099 0.92235
## age 0.01540 0.01852 0.832 0.41957
## binary_gender2 0.29010 0.32904 0.882 0.39284
## race32 0.27350 0.61324 0.446 0.66242
## race33 0.92967 0.76153 1.221 0.24232
## race34 -0.11734 0.44390 -0.264 0.79538
## graduate1 0.05068 0.32989 0.154 0.88011
## socialsupport_patuniq_mean 0.12234 0.18815 0.650 0.52605
## financial_ins_patuniq_mean -0.26053 0.17112 -1.523 0.15014
## physical_health_both_mean 0.28715 0.13426 2.139 0.05056 .
## negative_exp_gen_patuniq_mean -0.13740 0.27217 -0.505 0.62154
## res_aware_patuniq_mean -0.24925 0.22365 -1.114 0.28385
## res_use_patuniq_mean 0.27719 0.37308 0.743 0.46979
## pat_childcare_patuniq_mean 0.80975 0.22095 3.665 0.00255 **
## child_issues_patuniq_mean -0.10922 0.25793 -0.423 0.67840
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.153 on 14 degrees of freedom
## (357 observations deleted due to missingness)
## Multiple R-squared: 0.7615, Adjusted R-squared: 0.523
## F-statistic: 3.193 on 14 and 14 DF, p-value: 0.01881
reg_academic_diffty_patuniq_unweighted<-lm(academic_diffty_patuniq_mean~
age + binary_gender + race3 + graduate +
socialsupport_patuniq_mean +
financial_ins_patuniq_mean +
physical_health_both_mean +
psycsocemo_health_patuniq_mean +
negative_exp_gen_patuniq_mean +
res_aware_patuniq_mean +
res_use_patuniq_mean +
pat_childcare_patuniq_mean +
child_issues_patuniq_mean,
data=data,var.equal=TRUE)
summary(reg_academic_diffty_patuniq_unweighted)
##
## Call:
## lm(formula = academic_diffty_patuniq_mean ~ age + binary_gender +
## race3 + graduate + socialsupport_patuniq_mean + financial_ins_patuniq_mean +
## physical_health_both_mean + psycsocemo_health_patuniq_mean +
## negative_exp_gen_patuniq_mean + res_aware_patuniq_mean +
## res_use_patuniq_mean + pat_childcare_patuniq_mean + child_issues_patuniq_mean,
## data = data, var.equal = TRUE)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.9148 -0.3369 0.0000 0.4121 1.4038
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.578502 2.773440 0.930 0.369
## age -0.007959 0.032194 -0.247 0.809
## binary_gender2 -0.604286 0.521523 -1.159 0.267
## race32 -1.463065 1.109131 -1.319 0.210
## race33 -0.316070 1.386317 -0.228 0.823
## race34 -0.819227 0.808871 -1.013 0.330
## graduate1 -0.195216 0.484025 -0.403 0.693
## socialsupport_patuniq_mean -0.168426 0.302893 -0.556 0.588
## financial_ins_patuniq_mean 0.121187 0.291645 0.416 0.685
## physical_health_both_mean -0.089730 0.235565 -0.381 0.709
## psycsocemo_health_patuniq_mean 0.525663 0.425300 1.236 0.238
## negative_exp_gen_patuniq_mean 0.476136 0.416355 1.144 0.273
## res_aware_patuniq_mean -0.331729 0.364071 -0.911 0.379
## res_use_patuniq_mean -0.591947 0.546715 -1.083 0.299
## pat_childcare_patuniq_mean 0.242410 0.473799 0.512 0.617
## child_issues_patuniq_mean 0.269685 0.442697 0.609 0.553
##
## Residual standard error: 0.9336 on 13 degrees of freedom
## (357 observations deleted due to missingness)
## Multiple R-squared: 0.6747, Adjusted R-squared: 0.2993
## F-statistic: 1.797 on 15 and 13 DF, p-value: 0.1475
reg_academic_diffty_patuniq_weighted<-lm(academic_diffty_patuniq_mean~
age + binary_gender + race3 + graduate +
socialsupport_patuniq_mean +
financial_ins_patuniq_mean +
physical_health_both_mean +
psycsocemo_health_patuniq_mean +
negative_exp_gen_patuniq_mean +
res_aware_patuniq_mean +
res_use_patuniq_mean +
pat_childcare_patuniq_mean +
child_issues_patuniq_mean,
data=data, weights = data$finalweight, var.equal=TRUE)
summary(reg_academic_diffty_patuniq_weighted)
##
## Call:
## lm(formula = academic_diffty_patuniq_mean ~ age + binary_gender +
## race3 + graduate + socialsupport_patuniq_mean + financial_ins_patuniq_mean +
## physical_health_both_mean + psycsocemo_health_patuniq_mean +
## negative_exp_gen_patuniq_mean + res_aware_patuniq_mean +
## res_use_patuniq_mean + pat_childcare_patuniq_mean + child_issues_patuniq_mean,
## data = data, weights = data$finalweight, var.equal = TRUE)
##
## Weighted Residuals:
## Min 1Q Median 3Q Max
## -3.8086 -1.3363 0.0186 1.3330 5.2665
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.950764 2.355961 1.252 0.232
## age -0.002173 0.029322 -0.074 0.942
## binary_gender2 -0.555495 0.522414 -1.063 0.307
## race32 -1.511742 0.954401 -1.584 0.137
## race33 -0.039922 1.237913 -0.032 0.975
## race34 -0.893452 0.687715 -1.299 0.216
## graduate1 -0.144753 0.510238 -0.284 0.781
## socialsupport_patuniq_mean -0.194763 0.295116 -0.660 0.521
## financial_ins_patuniq_mean 0.021849 0.285501 0.077 0.940
## physical_health_both_mean -0.130404 0.238990 -0.546 0.595
## psycsocemo_health_patuniq_mean 0.445744 0.413023 1.079 0.300
## negative_exp_gen_patuniq_mean 0.436357 0.424414 1.028 0.323
## res_aware_patuniq_mean -0.401957 0.360634 -1.115 0.285
## res_use_patuniq_mean -0.600448 0.587815 -1.021 0.326
## pat_childcare_patuniq_mean 0.319855 0.477955 0.669 0.515
## child_issues_patuniq_mean 0.367481 0.401148 0.916 0.376
##
## Residual standard error: 3.327 on 13 degrees of freedom
## (357 observations deleted due to missingness)
## Multiple R-squared: 0.7525, Adjusted R-squared: 0.4669
## F-statistic: 2.635 on 15 and 13 DF, p-value: 0.04346
Social Support