library(tidyverse)
library(tidycensus)
library(broom)
library(ggplot2)
options(tigris_use_cache = TRUE)
census_api_key("35ef8d24e494f8be80cce76ed2cba22372d69b12", overwrite = TRUE)
tx_data <- get_acs(
geography = "county",
state = "TX",
variables = c(
edu = "B15003_022", # Bachelor's degree or higher
income = "B19013_001",
age = "B01001_020", # Median age approximation
english = "B16004_001" # English proficiency
),
survey = "acs1",
year = 2024,
output = "wide"
)
tx_df <- tx_data %>%
rename(
educational_attainment = eduE,
income = incomeE,
age = ageE,
english_proficiency = englishE
) %>%
drop_na()
model <- lm(educational_attainment ~ income + age + english_proficiency, data = tx_df)
summary(model)
## 
## Call:
## lm(formula = educational_attainment ~ income + age + english_proficiency, 
##     data = tx_df)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -51724 -12588   1428   8894  77536 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)         -1.617e+05  6.714e+04  -2.408  0.03937 * 
## income               2.098e+00  6.214e-01   3.376  0.00817 **
## age                 -2.066e+01  1.131e+01  -1.827  0.10096   
## english_proficiency  3.542e-01  1.067e-01   3.319  0.00895 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 35730 on 9 degrees of freedom
## Multiple R-squared:  0.9713, Adjusted R-squared:  0.9617 
## F-statistic: 101.5 on 3 and 9 DF,  p-value: 2.938e-07

Both income and English proficiency are indicators of educational attainment.

97.1% of the variation in educational attainment among Latino adults in Texas counties. This is quite strong suggesting income, age, and English proficiency collectively capture a major part of the education pattern.

For the independent variables, higher income levels are associated with higher educational attainment becaue of the 2 stars, and the 2 stars English proficiency also means it is Significant, many those who speak/understand English “very well” tend to have more education.

As income goes up, so does educational attainment by 2%, and as english proficiency goes up educational attainemnt goes up by 3.5%.

coef(summary(model))
##                          Estimate   Std. Error   t value    Pr(>|t|)
## (Intercept)         -1.616704e+05 6.713659e+04 -2.408083 0.039372618
## income               2.098030e+00 6.213944e-01  3.376326 0.008174487
## age                 -2.066054e+01 1.130776e+01 -1.827112 0.100957481
## english_proficiency  3.542293e-01 1.067153e-01  3.319386 0.008949062
plot(model, which = 1)