The purpose of this project was to examine how differences in measuring socioeconomic status (SES) affect outcomes.
While a variety of ways exist to measure poverty, there are two common approaches. The first is by using reported income as a continuous variable to see if higher levels of income result in differences in behavioral outcomes. The second is by using an income-to-needs ratio (INR), which utilize federal poverty thresholds to establish if someone is at or above the poverty line based on total family income and household size.
This report uses data provided by the Fragile Families study to determine
First, I wanted to see how correlated each of the SES measures were with each other, with a particular focus on the constructed Scarcity Score value.
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1644 rows containing non-finite values (stat_smooth).
## Warning: Removed 1644 rows containing non-finite values (stat_cor).
## Warning: Removed 1644 rows containing missing values (geom_point).
## Warning: Removed 1644 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1644 rows containing non-finite values (stat_smooth).
## Warning: Removed 1644 rows containing non-finite values (stat_cor).
## Warning: Removed 1644 rows containing missing values (geom_point).
## Warning: Removed 1644 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
############# PPVT RAW SCORES #############
ggscatter(data9, x = "IncomeGroup", y = "ch3ppvtraw",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "Income Group", ylab = "PPVT Raw Score") +
geom_jitter() + theme(axis.text.x =
element_text(angle = 45, hjust = 1)) +
ggtitle("Distribution of PPVT Scores by Income Group")
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1969 rows containing non-finite values (stat_smooth).
## Warning: Removed 1969 rows containing non-finite values (stat_cor).
## Warning: Removed 1969 rows containing missing values (geom_point).
## Warning: Removed 1969 rows containing missing values (geom_point).
ggscatter(data9, x = "TotalIncome", y = "ch3ppvtraw",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "Income", ylab = "PPVT Raw Score") +
geom_jitter() +
ggtitle("Scatter Plot of PPVT Scores by Income")
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1969 rows containing non-finite values (stat_smooth).
## Warning: Removed 1969 rows containing non-finite values (stat_cor).
## Warning: Removed 1969 rows containing missing values (geom_point).
## Warning: Removed 1969 rows containing missing values (geom_point).
ggscatter(data9, x = "cf5povco", y = "ch3ppvtraw",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "Poverty Index", ylab = "PPVT Raw Score") +
geom_jitter() +
ggtitle("Scatter Plot of PPVT Scores by Poverty Index")
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2712 rows containing non-finite values (stat_smooth).
## Warning: Removed 2712 rows containing non-finite values (stat_cor).
## Warning: Removed 2712 rows containing missing values (geom_point).
## Warning: Removed 2712 rows containing missing values (geom_point).
ggscatter(data9, x = "ScarcityScore", y = "ch3ppvtraw",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "Scarcity Score", ylab = "PPVT Raw Score") +
geom_jitter() +
ggtitle("Scatter Plot of PPVT Scores by Scarcity Score")
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1969 rows containing non-finite values (stat_smooth).
## Warning: Removed 1969 rows containing non-finite values (stat_cor).
## Warning: Removed 1969 rows containing missing values (geom_point).
## Warning: Removed 1969 rows containing missing values (geom_point).
############### PPVT SCORES!! ###############
ppvt_summary1 <- data9 %>%
select(idnum, ch3ppvtraw, IncomeGroup) %>%
group_by(IncomeGroup) %>%
drop_na() %>%
summarise(AvgPPVTScore = mean(ch3ppvtraw),
sd_rawscore = sd(ch3ppvtraw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgPPVTScore - ci,
ci_upper = AvgPPVTScore + ci)
ppvt_summary2 <- data9 %>%
select(idnum, ch3ppvtraw, cf5povca) %>%
group_by(cf5povca) %>%
drop_na() %>%
summarise(AvgPPVTScore = mean(ch3ppvtraw),
sd_rawscore = sd(ch3ppvtraw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgPPVTScore - ci,
ci_upper = AvgPPVTScore + ci)
ppvt_summary3 <- data9 %>%
select(idnum, ch3ppvtraw, ScarcityScore) %>%
group_by(ScarcityScore) %>%
drop_na() %>%
summarise(AvgPPVTScore = mean(ch3ppvtraw),
sd_rawscore = sd(ch3ppvtraw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgPPVTScore - ci,
ci_upper = AvgPPVTScore + ci)
############### MORE GRAPHS!! ###############
ggplot(ppvt_summary1, aes(x=IncomeGroup, y=AvgPPVTScore, group = 1)) +
geom_line(position="dodge", stat="identity") +
scale_fill_brewer(palette="Set1") +
geom_errorbar(aes(ymin = AvgPPVTScore - ci,
ymax = AvgPPVTScore + ci), width=.2,
position=position_dodge(.9)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
ggtitle("Mean PPVT Scores by Income Group")
## Warning: Width not defined. Set with `position_dodge(width = ?)`
ggplot(ppvt_summary2, aes(x=cf5povca, y=AvgPPVTScore, group = 1)) +
geom_line(position="dodge", stat="identity") +
scale_fill_brewer(palette="Set1") +
geom_errorbar(aes(ymin = AvgPPVTScore - ci,
ymax = AvgPPVTScore + ci), width=.2,
position=position_dodge(.9)) +
ggtitle("Mean PPVT Scores by Poverty Index Scores")
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## Warning: Width not defined. Set with `position_dodge(width = ?)`
ggplot(ppvt_summary3, aes(x=ScarcityScore, y=AvgPPVTScore, group = 1)) +
geom_line(position="dodge", stat="identity") +
scale_fill_brewer(palette="Set1") +
geom_errorbar(aes(ymin = AvgPPVTScore - ci,
ymax = AvgPPVTScore + ci), width=.2,
position=position_dodge(.9)) +
ggtitle("Mean PPVT Scores by Scarcity Scores")
## Warning: Width not defined. Set with `position_dodge(width = ?)`
Regression Analysis are report below:
############### REGRESSION!! ###############
scarcity_mod_ppvt <- lm(ch3ppvtraw ~ ScarcityScore, data = data9,
na.action = na.omit)
summary(scarcity_mod_ppvt)
##
## Call:
## lm(formula = ch3ppvtraw ~ ScarcityScore, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -27.846 -11.846 -1.736 10.154 57.154
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 27.8464 0.4046 68.825 < 2e-16 ***
## ScarcityScore -0.5549 0.1205 -4.606 4.34e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 14.79 on 2231 degrees of freedom
## (1969 observations deleted due to missingness)
## Multiple R-squared: 0.009419, Adjusted R-squared: 0.008975
## F-statistic: 21.21 on 1 and 2231 DF, p-value: 4.338e-06
income_mod_ppvt <- lm(ch3ppvtraw ~ TotalIncome, data = data9,
na.action = na.omit)
summary(income_mod_ppvt)
##
## Call:
## lm(formula = ch3ppvtraw ~ TotalIncome, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -39.431 -10.864 -1.742 9.812 62.258
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.274e+01 4.060e-01 56.01 <2e-16 ***
## TotalIncome 5.098e-05 3.542e-06 14.39 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 14.22 on 2231 degrees of freedom
## (1969 observations deleted due to missingness)
## Multiple R-squared: 0.08498, Adjusted R-squared: 0.08457
## F-statistic: 207.2 on 1 and 2231 DF, p-value: < 2.2e-16
poverty_mod_ppvt <- lm(ch3ppvtraw ~ cf5povco, data = data9,
na.action = na.omit)
summary(poverty_mod_ppvt)
##
## Call:
## lm(formula = ch3ppvtraw ~ cf5povco, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -39.158 -11.004 -1.572 9.644 50.300
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 22.8234 0.5441 41.94 <2e-16 ***
## cf5povco 1.8030 0.1544 11.68 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 14.39 on 1488 degrees of freedom
## (2712 observations deleted due to missingness)
## Multiple R-squared: 0.08397, Adjusted R-squared: 0.08336
## F-statistic: 136.4 on 1 and 1488 DF, p-value: < 2.2e-16
This is from the WJ Task.
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 869 rows containing non-finite values (stat_smooth).
## Warning: Removed 869 rows containing non-finite values (stat_cor).
## Warning: Removed 869 rows containing missing values (geom_point).
## Warning: Removed 869 rows containing missing values (geom_point).
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 869 rows containing non-finite values (stat_smooth).
## Warning: Removed 869 rows containing non-finite values (stat_cor).
## Warning: Removed 869 rows containing missing values (geom_point).
## Warning: Removed 869 rows containing missing values (geom_point).
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1914 rows containing non-finite values (stat_smooth).
## Warning: Removed 1914 rows containing non-finite values (stat_cor).
## Warning: Removed 1914 rows containing missing values (geom_point).
## Warning: Removed 1914 rows containing missing values (geom_point).
############### WJ 9 + 10 SCORES!! ###############
wj9_summary1 <- data9 %>%
select(idnum, ch5wj9raw, IncomeGroup) %>%
group_by(IncomeGroup) %>%
drop_na() %>%
summarise(AvgWJ9Score = mean(ch5wj9raw),
sd_rawscore = sd(ch5wj9raw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgWJ9Score - ci,
ci_upper = AvgWJ9Score + ci)
wj9_summary2 <- data9 %>%
select(idnum, ch5wj9raw, cf5povca) %>%
group_by(cf5povca) %>%
drop_na() %>%
summarise(AvgWJ9Score = mean(ch5wj9raw),
sd_rawscore = sd(ch5wj9raw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgWJ9Score - ci,
ci_upper = AvgWJ9Score + ci)
wj9_summary3 <- data9 %>%
select(idnum, ch5wj9raw, ScarcityScore) %>%
group_by(ScarcityScore) %>%
drop_na() %>%
summarise(AvgWJ9Score = mean(ch5wj9raw),
sd_rawscore = sd(ch5wj9raw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgWJ9Score - ci,
ci_upper = AvgWJ9Score + ci)
Regression Analysis are report below:
############### REGRESSION!! ###############
scarcity_mod_wj9 <- lm(ch5wj9raw ~ ScarcityScore, data = data9,
na.action = na.omit)
summary(scarcity_mod_wj9)
##
## Call:
## lm(formula = ch5wj9raw ~ ScarcityScore, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -25.9245 -3.5479 0.6404 4.0755 15.0170
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 25.92446 0.12795 202.612 < 2e-16 ***
## ScarcityScore -0.18829 0.03896 -4.832 1.41e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.69 on 3331 degrees of freedom
## (869 observations deleted due to missingness)
## Multiple R-squared: 0.006962, Adjusted R-squared: 0.006664
## F-statistic: 23.35 on 1 and 3331 DF, p-value: 1.409e-06
income_mod_wj9 <- lm(ch5wj9raw ~ TotalIncome, data = data9,
na.action = na.omit)
summary(income_mod_wj9)
##
## Call:
## lm(formula = ch5wj9raw ~ TotalIncome, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -25.8019 -3.3920 0.6328 3.7640 15.6781
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.424e+01 1.289e-01 188.12 <2e-16 ***
## TotalIncome 1.558e-05 1.045e-06 14.91 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.528 on 3331 degrees of freedom
## (869 observations deleted due to missingness)
## Multiple R-squared: 0.06258, Adjusted R-squared: 0.0623
## F-statistic: 222.4 on 1 and 3331 DF, p-value: < 2.2e-16
poverty_mod_wj9 <- lm(ch5wj9raw ~ cf5povco, data = data9,
na.action = na.omit)
summary(poverty_mod_wj9)
##
## Call:
## lm(formula = ch5wj9raw ~ cf5povco, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -25.9401 -3.2944 0.7347 3.7887 15.2632
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 24.58108 0.16218 151.6 <2e-16 ***
## cf5povco 0.49455 0.04337 11.4 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.463 on 2286 degrees of freedom
## (1914 observations deleted due to missingness)
## Multiple R-squared: 0.05382, Adjusted R-squared: 0.05341
## F-statistic: 130 on 1 and 2286 DF, p-value: < 2.2e-16
This is from the woodcock johnson task
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 859 rows containing non-finite values (stat_smooth).
## Warning: Removed 859 rows containing non-finite values (stat_cor).
## Warning: Removed 859 rows containing missing values (geom_point).
## Warning: Removed 859 rows containing missing values (geom_point).
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 859 rows containing non-finite values (stat_smooth).
## Warning: Removed 859 rows containing non-finite values (stat_cor).
## Warning: Removed 859 rows containing missing values (geom_point).
## Warning: Removed 859 rows containing missing values (geom_point).
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1909 rows containing non-finite values (stat_smooth).
## Warning: Removed 1909 rows containing non-finite values (stat_cor).
## Warning: Removed 1909 rows containing missing values (geom_point).
## Warning: Removed 1909 rows containing missing values (geom_point).
wj10_summary1 <- data9 %>%
select(idnum, ch5wj10raw, IncomeGroup) %>%
group_by(IncomeGroup) %>%
drop_na() %>%
summarise(AvgWJ10Score = mean(ch5wj10raw),
sd_rawscore = sd(ch5wj10raw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgWJ10Score - ci,
ci_upper = AvgWJ10Score + ci)
wj10_summary2 <- data9 %>%
select(idnum, ch5wj10raw, cf5povca) %>%
group_by(cf5povca) %>%
drop_na() %>%
summarise(AvgWJ10Score = mean(ch5wj10raw),
sd_rawscore = sd(ch5wj10raw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgWJ10Score - ci,
ci_upper = AvgWJ10Score + ci)
wj10_summary3 <- data9 %>%
select(idnum, ch5wj10raw, ScarcityScore) %>%
group_by(ScarcityScore) %>%
drop_na() %>%
summarise(AvgWJ10Score = mean(ch5wj10raw),
sd_rawscore = sd(ch5wj10raw),
n_obs = length(idnum),
sem = sd_rawscore / sqrt(n_obs),
ci = sem * 1.96,
ci_lower = AvgWJ10Score - ci,
ci_upper = AvgWJ10Score + ci)
Regression Analysis are report below:
############### REGRESSION!! ###############
scarcity_mod_wj10 <- lm(ch5wj10raw ~ ScarcityScore, data = data9,
na.action = na.omit)
summary(scarcity_mod_wj10)
##
## Call:
## lm(formula = ch5wj10raw ~ ScarcityScore, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -32.701 -3.701 -0.153 3.847 21.299
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 32.70132 0.13702 238.667 < 2e-16 ***
## ScarcityScore -0.27410 0.04172 -6.571 5.79e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.102 on 3341 degrees of freedom
## (859 observations deleted due to missingness)
## Multiple R-squared: 0.01276, Adjusted R-squared: 0.01246
## F-statistic: 43.17 on 1 and 3341 DF, p-value: 5.79e-11
income_mod_wj10 <- lm(ch5wj10raw ~ TotalIncome, data = data9,
na.action = na.omit)
summary(income_mod_wj10)
##
## Call:
## lm(formula = ch5wj10raw ~ TotalIncome, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -32.317 -3.493 -0.038 3.651 21.483
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.062e+01 1.376e-01 222.51 <2e-16 ***
## TotalIncome 1.826e-05 1.115e-06 16.37 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.909 on 3341 degrees of freedom
## (859 observations deleted due to missingness)
## Multiple R-squared: 0.07427, Adjusted R-squared: 0.074
## F-statistic: 268.1 on 1 and 3341 DF, p-value: < 2.2e-16
poverty_mod_wj10 <- lm(ch5wj10raw ~ cf5povco, data = data9,
na.action = na.omit)
summary(poverty_mod_wj10)
##
## Call:
## lm(formula = ch5wj10raw ~ cf5povco, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -32.426 -3.546 -0.052 3.867 21.789
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 30.9432 0.1795 172.40 <2e-16 ***
## cf5povco 0.5717 0.0480 11.91 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.052 on 2291 degrees of freedom
## (1909 observations deleted due to missingness)
## Multiple R-squared: 0.0583, Adjusted R-squared: 0.05789
## F-statistic: 141.8 on 1 and 2291 DF, p-value: < 2.2e-16
Below are graphs for the ds task
############### DIGIT SPAN RAW SCORES ###############
ggscatter(data9, x = "TotalIncome", y = "ch5dsraw",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "Income", ylab = "Digit Span Raw Score") +
geom_jitter() + expand_limits(x = c(0, 25000, 50000, 75000,
100000, 150000))
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 833 rows containing non-finite values (stat_smooth).
## Warning: Removed 833 rows containing non-finite values (stat_cor).
## Warning: Removed 833 rows containing missing values (geom_point).
## Warning: Removed 833 rows containing missing values (geom_point).
ggscatter(data9, x = "ScarcityScore", y = "ch5dsraw",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "Scarcity Score", ylab = "Digit Span Raw Score") +
geom_jitter()
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 833 rows containing non-finite values (stat_smooth).
## Warning: Removed 833 rows containing non-finite values (stat_cor).
## Warning: Removed 833 rows containing missing values (geom_point).
## Warning: Removed 833 rows containing missing values (geom_point).
ggscatter(data9, x = "cf5povco", y = "ch5dsraw",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "Poverty Index", ylab = "Digit Span Raw Score") +
geom_jitter()
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## Don't know how to automatically pick scale for object of type haven_labelled/vctrs_vctr/double. Defaulting to continuous.
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1889 rows containing non-finite values (stat_smooth).
## Warning: Removed 1889 rows containing non-finite values (stat_cor).
## Warning: Removed 1889 rows containing missing values (geom_point).
## Warning: Removed 1889 rows containing missing values (geom_point).
############### REGRESSION!! ###############
scarcity_mod <- lm(ch5dsraw ~ ScarcityScore, data = data9,
na.action = na.omit)
summary(scarcity_mod)
##
## Call:
## lm(formula = ch5dsraw ~ ScarcityScore, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -13.9917 -1.9917 0.0083 2.0083 18.3485
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 13.99165 0.06988 200.224 < 2e-16 ***
## ScarcityScore -0.06802 0.02131 -3.191 0.00143 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.125 on 3367 degrees of freedom
## (833 observations deleted due to missingness)
## Multiple R-squared: 0.003016, Adjusted R-squared: 0.00272
## F-statistic: 10.18 on 1 and 3367 DF, p-value: 0.001429
income_mod <- lm(ch5dsraw ~ TotalIncome, data = data9,
na.action = na.omit)
summary(income_mod)
##
## Call:
## lm(formula = ch5dsraw ~ TotalIncome, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -14.1900 -1.8744 -0.4211 1.6494 18.5284
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.338e+01 7.162e-02 186.754 <2e-16 ***
## TotalIncome 5.738e-06 5.805e-07 9.884 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.086 on 3367 degrees of freedom
## (833 observations deleted due to missingness)
## Multiple R-squared: 0.0282, Adjusted R-squared: 0.02791
## F-statistic: 97.7 on 1 and 3367 DF, p-value: < 2.2e-16
poverty_mod <- lm(ch5dsraw ~ cf5povco, data = data9,
na.action = na.omit)
summary(poverty_mod)
##
## Call:
## lm(formula = ch5dsraw ~ cf5povco, data = data9, na.action = na.omit)
##
## Residuals:
## Min 1Q Median 3Q Max
## -14.0879 -1.8790 -0.3987 1.7083 12.7723
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 13.38250 0.08963 149.303 <2e-16 ***
## cf5povco 0.20131 0.02402 8.382 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.032 on 2311 degrees of freedom
## (1889 observations deleted due to missingness)
## Multiple R-squared: 0.0295, Adjusted R-squared: 0.02908
## F-statistic: 70.25 on 1 and 2311 DF, p-value: < 2.2e-16