We will be going through
library(tidyverse)
library(readxl)
library(ggplot2)
library (reshape2)
library(writexl)
library(lme4)
TAS_data_long_format_age <- read_excel("TAS_data_long_format_age.xlsx")
view(TAS_data_long_format_age)
head(TAS_data_long_format_age)
## # A tibble: 6 × 42
## TAS TAS05 TAS09 TAS15 `1968 Interview Number` `Person Number` Gender
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2 1 1 NA 4 180 2
## 2 2 1 1 NA 5 32 2
## 3 2 1 1 NA 6 34 1
## 4 2 1 1 NA 14 30 1
## 5 1 1 NA NA 18 38 2
## 6 2 1 1 NA 47 34 2
## # ℹ 35 more variables: `Individual is sample` <dbl>, `Year ID Number` <dbl>,
## # `Sequence Number` <dbl>, `Relationship to Head` <dbl>,
## # `Release Number` <dbl>, B5A <dbl>, B5D <dbl>, B6C <dbl>, C2D <dbl>,
## # C2E <dbl>, C2F <dbl>, D2D3_month <dbl>, D2D3_year <dbl>,
## # E1_1st_mention <dbl>, E1_2nd_mention <dbl>, E1_3rd_mention <dbl>, E3 <dbl>,
## # G1 <dbl>, G2_month <dbl>, G2_year <dbl>, G10 <dbl>, G11 <dbl>, G30A <dbl>,
## # G41A <dbl>, G41B <dbl>, G41C <dbl>, G41H <dbl>, G41P <dbl>, H1 <dbl>, …
Filter the data (2005 & 2015)
Long_format_2005_2015 <- TAS_data_long_format_age %>% filter(year==2005| year==2015) %>% filter(Age_18_graduate< 50) %>% mutate(year_new = case_when(year == 2005 ~ -1, year == 2009 ~ 0,year == 2015 ~ 1))
knitr::kable(head(Long_format_2005_2015[, 1:43]))
| TAS | TAS05 | TAS09 | TAS15 | 1968 Interview Number | Person Number | Gender | Individual is sample | Year ID Number | Sequence Number | Relationship to Head | Release Number | B5A | B5D | B6C | C2D | C2E | C2F | D2D3_month | D2D3_year | E1_1st_mention | E1_2nd_mention | E1_3rd_mention | E3 | G1 | G2_month | G2_year | G10 | G11 | G30A | G41A | G41B | G41C | G41H | G41P | H1 | L7_1st_mention | L7_2nd_mention | L7_3rd_mention | Age_17_graduate | Age_18_graduate | year | year_new |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 1 | 1 | NA | 5 | 32 | 2 | 2 | 624 | 3 | 30 | 5 | 5 | 5 | 5 | 7 | 7 | 7 | 0 | 0 | 1 | 7 | 0 | 0 | 1 | 5 | 2002 | 1 | 1 | 7 | 7 | 6 | 6 | 7 | 5 | 2 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
| 2 | 1 | 1 | NA | 6 | 34 | 1 | 2 | 1202 | 51 | 30 | 5 | 2 | 2 | 6 | 1 | 1 | 1 | 0 | 0 | 7 | 0 | 0 | 5 | 1 | 5 | 2002 | 1 | 1 | 0 | 7 | 5 | 7 | 5 | 3 | 1 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
| 2 | 1 | 1 | NA | 14 | 30 | 1 | 2 | 736 | 51 | 30 | 5 | 4 | 4 | 4 | 2 | 1 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 6 | 2003 | 1 | 5 | 6 | 5 | 6 | 6 | 5 | 5 | 2 | 1 | 0 | 0 | 19 | 20 | 2005 | -1 |
| 1 | 1 | NA | NA | 18 | 38 | 2 | 2 | 5647 | 3 | 98 | 5 | 3 | 4 | 3 | 4 | 2 | 2 | 0 | 0 | 3 | 7 | 0 | 5 | 1 | 6 | 2004 | 1 | 5 | 6 | 5 | 5 | 5 | 7 | 5 | 2 | 1 | 0 | 0 | 18 | 19 | 2005 | -1 |
| 2 | 1 | 1 | NA | 47 | 34 | 2 | 2 | 2516 | 3 | 30 | 5 | 4 | 5 | 6 | 4 | 5 | 2 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 5 | 2005 | 5 | 0 | 6 | 3 | 6 | 4 | 7 | 4 | 1 | 1 | 0 | 0 | 17 | 18 | 2005 | -1 |
| 2 | 1 | 1 | NA | 53 | 35 | 2 | 2 | 1392 | 3 | 33 | 5 | 4 | 5 | 5 | 3 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 6 | 2002 | 1 | 1 | 7 | 6 | 7 | 7 | 7 | 5 | 1 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
B5A_Regression_05_15 <- lm(B5A ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
B5A_Regression_05_15
##
## Call:
## lm(formula = B5A ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 0.15546 0.17709 0.49385
## Age_18_graduate:year_new
## -0.02312
summary(B5A_Regression_05_15)
##
## Call:
## lm(formula = B5A ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.8066 -0.6659 0.3341 0.7345 4.1172
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.15546 0.44715 0.348 0.728
## Age_18_graduate 0.17709 0.02280 7.768 1.62e-14 ***
## year_new 0.49385 0.44715 1.104 0.270
## Age_18_graduate:year_new -0.02312 0.02280 -1.014 0.311
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.108 on 1296 degrees of freedom
## Multiple R-squared: 0.1075, Adjusted R-squared: 0.1054
## F-statistic: 52.01 on 3 and 1296 DF, p-value: < 2.2e-16
Long_format_2005_2015$predicted_B5A <- predict(B5A_Regression_05_15)
Long_format_2005_2015$year_factor_B5A <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = B5A, color = year_factor_B5A)) + geom_point(aes(shape = year_factor_B5A), alpha = 0.5) + geom_line(aes(y = predicted_B5A), size = 1) + labs(title = "Responsibility for Self (B5A) by Age and Year",x = "Age", y = "Responsibility for Self (B5A)", color = "Year", shape = "Year") + theme_minimal()
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
B5D_Regression_05_15 <- lm(B5D ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
B5D_Regression_05_15
##
## Call:
## lm(formula = B5D ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 3.045448 0.069444 -0.128830
## Age_18_graduate:year_new
## 0.006945
summary(B5D_Regression_05_15)
##
## Call:
## lm(formula = B5D ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.6736 -0.3617 0.4028 0.6320 0.7084
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.045448 0.360022 8.459 < 2e-16 ***
## Age_18_graduate 0.069444 0.018357 3.783 0.000162 ***
## year_new -0.128830 0.360022 -0.358 0.720522
## Age_18_graduate:year_new 0.006945 0.018357 0.378 0.705238
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8921 on 1296 degrees of freedom
## Multiple R-squared: 0.03595, Adjusted R-squared: 0.03372
## F-statistic: 16.11 on 3 and 1296 DF, p-value: 2.77e-10
Long_format_2005_2015$predicted_B5D <- predict(B5D_Regression_05_15)
Long_format_2005_2015$year_factor_B5D <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = B5D, color = factor(year_factor_B5D))) + geom_point(aes(shape = year_factor_B5D), alpha = 0.5) + geom_line(aes(y = predicted_B5D), size = 1) + labs(title = "Responsibility for Others (B5D) by Age and Year", x = "Age",y = "Managing own money (B5D)", color = "Year", shape = "Year") + theme_minimal()
B6C_Regression_05_15 <- lm(B6C ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
B6C_Regression_05_15
##
## Call:
## lm(formula = B6C ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 6.31388 -0.05142 -0.98854
## Age_18_graduate:year_new
## 0.05295
summary(B6C_Regression_05_15)
##
## Call:
## lm(formula = B6C ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.4236 -0.4236 -0.2149 0.7851 1.9939
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.31388 0.54701 11.543 <2e-16 ***
## Age_18_graduate -0.05142 0.02789 -1.844 0.0654 .
## year_new -0.98854 0.54701 -1.807 0.0710 .
## Age_18_graduate:year_new 0.05295 0.02789 1.899 0.0578 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.355 on 1296 degrees of freedom
## Multiple R-squared: 0.003719, Adjusted R-squared: 0.001413
## F-statistic: 1.613 on 3 and 1296 DF, p-value: 0.1846
Long_format_2005_2015$predicted_B6C <- predict(B6C_Regression_05_15)
Long_format_2005_2015$year_factor_B6C <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = B6C, color = factor(year_factor_B6C))) + geom_point(aes(shape = year_factor_B6C), alpha = 0.5) + geom_line(aes(y = predicted_B6C), size = 1) + labs(title = "Money management skills (B6C) by Age and Year", x = "Age",y = "Money Management skills (B6C)", color = "Year", shape = "Year") + theme_minimal()
C2D_Regression_05_15 <- lm(C2D ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
C2D_Regression_05_15
##
## Call:
## lm(formula = C2D ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 3.570786 0.002447 0.115152
## Age_18_graduate:year_new
## -0.008905
summary(C2D_Regression_05_15)
##
## Call:
## lm(formula = C2D ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.6940 -1.5632 -0.5116 1.4303 3.4820
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.570786 0.743479 4.803 1.75e-06 ***
## Age_18_graduate 0.002447 0.037909 0.065 0.949
## year_new 0.115152 0.743479 0.155 0.877
## Age_18_graduate:year_new -0.008905 0.037909 -0.235 0.814
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.842 on 1296 degrees of freedom
## Multiple R-squared: 0.001239, Adjusted R-squared: -0.001073
## F-statistic: 0.536 on 3 and 1296 DF, p-value: 0.6577
Long_format_2005_2015$predicted_C2D <- predict(C2D_Regression_05_15)
Long_format_2005_2015$year_factor_C2D <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = C2D, color = factor(year_factor_C2D))) + geom_point(aes(shape = year_factor_C2D), alpha = 0.5) + geom_line(aes(y = predicted_C2D), size = 1) + labs(title = "Worry about expenses (C2D) by Age and Year", x = "Age",y = "Worry about expenses (C2D)", color = "Year", shape = "Year") + theme_minimal()
C2E_Regression_05_15 <- lm(C2E ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
C2E_Regression_05_15
##
## Call:
## lm(formula = C2E ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 4.25107 -0.03511 0.63715
## Age_18_graduate:year_new
## -0.03063
summary(C2E_Regression_05_15)
##
## Call:
## lm(formula = C2E ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.7051 -1.5333 -0.4421 1.4757 3.8208
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.25107 0.77492 5.486 4.94e-08 ***
## Age_18_graduate -0.03511 0.03951 -0.889 0.374
## year_new 0.63715 0.77492 0.822 0.411
## Age_18_graduate:year_new -0.03063 0.03951 -0.775 0.438
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.92 on 1296 degrees of freedom
## Multiple R-squared: 0.004197, Adjusted R-squared: 0.001892
## F-statistic: 1.821 on 3 and 1296 DF, p-value: 0.1415
Long_format_2005_2015$predicted_C2E <- predict(C2E_Regression_05_15)
Long_format_2005_2015$year_factor_C2E <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = C2E, color = factor(year_factor_C2E))) + geom_point(aes(shape = year_factor_C2E), alpha = 0.5) + geom_line(aes(y = predicted_C2E), size = 1) + labs(title = "Worry about future job (C2E) by Age and Year", x = "Age",y = "Worry about future job (C2E)", color = "Year", shape = "Year") + theme_minimal()
C2F_Regression_05_15 <- lm(C2F ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
C2F_Regression_05_15
##
## Call:
## lm(formula = C2F ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 3.178093 -0.007862 0.235240
## Age_18_graduate:year_new
## -0.009527
summary(C2F_Regression_05_15)
##
## Call:
## lm(formula = C2F ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.1003 -1.0829 -0.0829 1.0255 4.0272
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.178093 0.699068 4.546 5.97e-06 ***
## Age_18_graduate -0.007862 0.035644 -0.221 0.825
## year_new 0.235240 0.699068 0.337 0.737
## Age_18_graduate:year_new -0.009527 0.035644 -0.267 0.789
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.732 on 1296 degrees of freedom
## Multiple R-squared: 0.0007165, Adjusted R-squared: -0.001597
## F-statistic: 0.3098 on 3 and 1296 DF, p-value: 0.8183
Long_format_2005_2015$predicted_C2F <- predict(C2F_Regression_05_15)
Long_format_2005_2015$year_factor_C2F <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = C2F, color = factor(year_factor_C2F))) + geom_point(aes(shape = year_factor_C2F), alpha = 0.5) + geom_line(aes(y = predicted_C2F), size = 1) + labs(title = "Discouraged about future (C2F) by Age and Year", x = "Age",y = "Discouraged about future (C2F)", color = "Year", shape = "Year") + theme_minimal()
E3_Regression_05_15 <- lm(E3 ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
E3_Regression_05_15
##
## Call:
## lm(formula = E3 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 5.52955 -0.19787 -0.27701
## Age_18_graduate:year_new
## 0.01148
summary(E3_Regression_05_15)
##
## Call:
## lm(formula = E3 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.038 -1.711 -1.038 2.962 6.962
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.52955 0.88351 6.259 5.27e-10 ***
## Age_18_graduate -0.19787 0.04505 -4.392 1.21e-05 ***
## year_new -0.27701 0.88351 -0.314 0.754
## Age_18_graduate:year_new 0.01148 0.04505 0.255 0.799
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.189 on 1296 degrees of freedom
## Multiple R-squared: 0.0415, Adjusted R-squared: 0.03928
## F-statistic: 18.71 on 3 and 1296 DF, p-value: 7.011e-12
Long_format_2005_2015$predicted_E3 <- predict(E3_Regression_05_15)
Long_format_2005_2015$year_factor_E3 <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = E3, color = factor(year_factor_E3))) + geom_point(aes(shape = year_factor_E3), alpha = 0.5) + geom_line(aes(y = predicted_E3), size = 1) + labs(title = "Work for money (E3) by Age and Year", x = "Age",y = "Work for money (E3)", color = "Year", shape = "Year") + theme_minimal()
G10_Regression_05_15 <- lm(G10 ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G10_Regression_05_15
##
## Call:
## lm(formula = G10 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 6.0227 -0.2096 -0.3622
## Age_18_graduate:year_new
## 0.0247
summary(G10_Regression_05_15)
##
## Call:
## lm(formula = G10 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.1469 -1.1469 -0.6983 -0.4071 7.0673
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.02272 0.67882 8.872 < 2e-16 ***
## Age_18_graduate -0.20963 0.03461 -6.057 1.82e-09 ***
## year_new -0.36221 0.67882 -0.534 0.594
## Age_18_graduate:year_new 0.02470 0.03461 0.714 0.476
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.682 on 1296 degrees of freedom
## Multiple R-squared: 0.05172, Adjusted R-squared: 0.04952
## F-statistic: 23.56 on 3 and 1296 DF, p-value: 7.525e-15
Long_format_2005_2015$predicted_G10 <- predict(G10_Regression_05_15)
Long_format_2005_2015$year_factor_G10 <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G10, color = factor(year_factor_G10))) + geom_point(aes(shape = year_factor_G10), alpha = 0.5) + geom_line(aes(y = predicted_G10), size = 1) + labs(title = "Attended college (G10) by Age and Year", x = "Age",y = "Attended college (G10)", color = "Year", shape = "Year") + theme_minimal()
G11_Regression_05_15 <- lm(G11 ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G11_Regression_05_15
##
## Call:
## lm(formula = G11 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## -5.07994 0.34009 -0.74350
## Age_18_graduate:year_new
## 0.04566
summary(G11_Regression_05_15)
##
## Call:
## lm(formula = G11 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.3631 -1.1200 -0.5057 1.1798 4.0366
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -5.07994 0.70973 -7.158 1.37e-12 ***
## Age_18_graduate 0.34009 0.03619 9.398 < 2e-16 ***
## year_new -0.74350 0.70973 -1.048 0.295
## Age_18_graduate:year_new 0.04566 0.03619 1.262 0.207
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.759 on 1296 degrees of freedom
## Multiple R-squared: 0.2172, Adjusted R-squared: 0.2154
## F-statistic: 119.9 on 3 and 1296 DF, p-value: < 2.2e-16
Long_format_2005_2015$predicted_G11 <- predict(G11_Regression_05_15)
Long_format_2005_2015$year_factor_G11 <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G11, color = factor(year_factor_G11))) + geom_point(aes(shape = year_factor_G11), alpha = 0.5) + geom_line(aes(y = predicted_G11), size = 1) + labs(title = "Attending college (G11) by Age and Year", x = "Age",y = "Attending college (G11)", color = "Year", shape = "Year") + theme_minimal()
G30A_Regression_05_15 <- lm(G30A ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G30A_Regression_05_15
##
## Call:
## lm(formula = G30A ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 5.908619 -0.007911 0.258439
## Age_18_graduate:year_new
## 0.003302
summary(G30A_Regression_05_15)
##
## Call:
## lm(formula = G30A ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.4484 -0.4371 0.5516 0.9343 1.6077
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.908619 0.634683 9.310 <2e-16 ***
## Age_18_graduate -0.007911 0.032361 -0.244 0.807
## year_new 0.258439 0.634683 0.407 0.684
## Age_18_graduate:year_new 0.003302 0.032361 0.102 0.919
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.573 on 1296 degrees of freedom
## Multiple R-squared: 0.03903, Adjusted R-squared: 0.0368
## F-statistic: 17.54 on 3 and 1296 DF, p-value: 3.627e-11
Long_format_2005_2015$predicted_G30A <- predict(G30A_Regression_05_15)
Long_format_2005_2015$year_factor_G30A <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G30A, color = factor(year_factor_G30A))) + geom_point(aes(shape = year_factor_G30A), alpha = 0.5) + geom_line(aes(y = predicted_G30A), size = 1) + labs(title = "Likelihood of well-paying job (G30A) by Age and Year", x = "Age",y = "Likelihood of well-paying job (G30A)", color = "Year", shape = "Year") + theme_minimal()
G41A_Regression_05_15 <- lm(G41A ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G41A_Regression_05_15
##
## Call:
## lm(formula = G41A ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 5.58414 -0.02707 -0.50731
## Age_18_graduate:year_new
## 0.01674
summary(G41A_Regression_05_15)
##
## Call:
## lm(formula = G41A ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.3030 -0.8806 0.1504 1.1736 4.1504
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.58414 0.68628 8.137 9.43e-16 ***
## Age_18_graduate -0.02707 0.03499 -0.773 0.439
## year_new -0.50731 0.68628 -0.739 0.460
## Age_18_graduate:year_new 0.01674 0.03499 0.478 0.632
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.701 on 1296 degrees of freedom
## Multiple R-squared: 0.01348, Adjusted R-squared: 0.01119
## F-statistic: 5.902 on 3 and 1296 DF, p-value: 0.0005338
Long_format_2005_2015$predicted_G41A <- predict(G41A_Regression_05_15)
Long_format_2005_2015$year_factor_G41A <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G41A, color = factor(year_factor_G41A))) + geom_point(aes(shape = year_factor_G41A), alpha = 0.5) + geom_line(aes(y = predicted_G41A), size = 1) + labs(title = "Importance of job status (G41A) by Age and Year", x = "Age",y = "Importance of job status (G41A)", color = "Year", shape = "Year") + theme_minimal()
G41B_Regression_05_15 <- lm(G41B ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G41B_Regression_05_15
##
## Call:
## lm(formula = G41B ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 5.119286 0.028469 0.021745
## Age_18_graduate:year_new
## -0.005185
summary(G41B_Regression_05_15)
##
## Call:
## lm(formula = G41B ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.7697 -0.7033 0.2630 1.2294 3.3467
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.119286 0.493473 10.374 <2e-16 ***
## Age_18_graduate 0.028469 0.025161 1.131 0.258
## year_new 0.021745 0.493473 0.044 0.965
## Age_18_graduate:year_new -0.005185 0.025161 -0.206 0.837
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.223 on 1296 degrees of freedom
## Multiple R-squared: 0.003559, Adjusted R-squared: 0.001252
## F-statistic: 1.543 on 3 and 1296 DF, p-value: 0.2017
Long_format_2005_2015$predicted_G41A <- predict(G41A_Regression_05_15)
Long_format_2005_2015$year_factor_G41A <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G41A, color = factor(year_factor_G41A))) + geom_point(aes(shape = year_factor_G41A), alpha = 0.5) + geom_line(aes(y = predicted_G41A), size = 1) + labs(title = "Importance of decision-making (G41A) by Age and Year", x = "Age",y = "Importance of decision-making (G41A)", color = "Year", shape = "Year") + theme_minimal()
G41C_Regression_05_15 <- lm(G41C ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G41C_Regression_05_15
##
## Call:
## lm(formula = G41C ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 9.7681 -0.2160 4.7219
## Age_18_graduate:year_new
## -0.2397
summary(G41C_Regression_05_15)
##
## Call:
## lm(formula = G41C ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.8326 -0.8326 0.4456 1.1674 7.0908
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.76805 0.65631 14.883 < 2e-16 ***
## Age_18_graduate -0.21599 0.03346 -6.454 1.53e-10 ***
## year_new 4.72185 0.65631 7.195 1.06e-12 ***
## Age_18_graduate:year_new -0.23966 0.03346 -7.162 1.33e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.626 on 1296 degrees of freedom
## Multiple R-squared: 0.2466, Adjusted R-squared: 0.2448
## F-statistic: 141.4 on 3 and 1296 DF, p-value: < 2.2e-16
Long_format_2005_2015$predicted_G41C <- predict(G41C_Regression_05_15)
Long_format_2005_2015$year_factor_G41C <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G41C, color = factor(year_factor_G41C))) + geom_point(aes(shape = year_factor_G41C), alpha = 0.5) + geom_line(aes(y = predicted_G41C), size = 1) + labs(title = "Importance of challenging work (G41C) by Age and Year", x = "Age",y = "Importance of challenging work (G41C)", color = "Year", shape = "Year") + theme_minimal()
G41H_Regression_05_15 <- lm(G41H ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G41H_Regression_05_15
##
## Call:
## lm(formula = G41H ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 6.372599 -0.003932 0.007573
## Age_18_graduate:year_new
## -0.002837
summary(G41H_Regression_05_15)
##
## Call:
## lm(formula = G41H ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.3453 -0.3442 0.6547 0.7484 2.7687
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.372599 0.425545 14.975 <2e-16 ***
## Age_18_graduate -0.003932 0.021698 -0.181 0.856
## year_new 0.007573 0.425545 0.018 0.986
## Age_18_graduate:year_new -0.002837 0.021698 -0.131 0.896
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.054 on 1296 degrees of freedom
## Multiple R-squared: 0.002776, Adjusted R-squared: 0.0004676
## F-statistic: 1.203 on 3 and 1296 DF, p-value: 0.3075
Long_format_2005_2015$predicted_G41H <- predict(G41H_Regression_05_15)
Long_format_2005_2015$year_factor_G41H <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G41H, color = factor(year_factor_G41H))) + geom_point(aes(shape = year_factor_G41H), alpha = 0.5) + geom_line(aes(y = predicted_G41H), size = 1) + labs(title = "Importance of healthcare benefits (G41H) by Age and Year", x = "Age",y = "Importance of healthcare benefits (G41H)", color = "Year", shape = "Year") + theme_minimal()
G41P_Regression_05_15 <- lm(G41P ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
G41P_Regression_05_15
##
## Call:
## lm(formula = G41P ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 4.564503 0.019148 -0.123732
## Age_18_graduate:year_new
## 0.002194
summary(G41P_Regression_05_15)
##
## Call:
## lm(formula = G41P ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.0443 -0.9934 0.0684 1.0897 4.0897
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.564503 0.640747 7.124 1.74e-12 ***
## Age_18_graduate 0.019148 0.032670 0.586 0.558
## year_new -0.123732 0.640747 -0.193 0.847
## Age_18_graduate:year_new 0.002194 0.032670 0.067 0.946
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.588 on 1296 degrees of freedom
## Multiple R-squared: 0.002054, Adjusted R-squared: -0.0002561
## F-statistic: 0.8891 on 3 and 1296 DF, p-value: 0.4461
Long_format_2005_2015$predicted_G41P <- predict(G41P_Regression_05_15)
Long_format_2005_2015$year_factor_G41P <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = G41P, color = factor(year_factor_G41P))) + geom_point(aes(shape = year_factor_G41P), alpha = 0.5) + geom_line(aes(y = predicted_G41P), size = 1) + labs(title = "Importance of job central to identity (G41P) by Age and Year", x = "Age",y = "Importance of job central to identity (G41P)", color = "Year", shape = "Year") + theme_minimal()
H1_Regression_05_15 <- lm(H1 ~ Age_18_graduate + year_new + Age_18_graduate:year_new, data = Long_format_2005_2015)
H1_Regression_05_15
##
## Call:
## lm(formula = H1 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Coefficients:
## (Intercept) Age_18_graduate year_new
## 1.95956 0.01105 -0.17487
## Age_18_graduate:year_new
## 0.01162
summary(H1_Regression_05_15)
##
## Call:
## lm(formula = H1 ~ Age_18_graduate + year_new + Age_18_graduate:year_new,
## data = Long_format_2005_2015)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.5101 -0.3741 -0.1243 0.7676 6.7166
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.95956 0.37858 5.176 2.62e-07 ***
## Age_18_graduate 0.01105 0.01930 0.573 0.567
## year_new -0.17487 0.37858 -0.462 0.644
## Age_18_graduate:year_new 0.01162 0.01930 0.602 0.547
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.9381 on 1296 degrees of freedom
## Multiple R-squared: 0.008008, Adjusted R-squared: 0.005712
## F-statistic: 3.487 on 3 and 1296 DF, p-value: 0.01528
Long_format_2005_2015$predicted_H1 <- predict(H1_Regression_05_15)
Long_format_2005_2015$year_factor_H1 <- factor(Long_format_2005_2015$year)
ggplot(Long_format_2005_2015, aes(x = Age_18_graduate, y = H1, color = factor(year_factor_H1))) + geom_point(aes(shape = year_factor_H1), alpha = 0.5) + geom_line(aes(y = predicted_H1), size = 1) + labs(title = "General Health (H1) by Age and Year", x = "Age",y = "General Health (H1)", color = "Year", shape = "Year") + theme_minimal()
Filter the data (2005 & 2009)
Long_format_2005_2009 <- TAS_data_long_format_age %>% filter(TAS05 == 1 & TAS09 ==1) %>% filter(Age_18_graduate< 50) %>% unite("TAS_ID", c("1968 Interview Number", "Person Number")) %>% mutate(year_new = case_when(year == 2005 ~ -1, year == 2009 ~ 0,year == 2015 ~ 1))
knitr::kable(head(Long_format_2005_2009[, 1:42]))
| TAS | TAS05 | TAS09 | TAS15 | TAS_ID | Gender | Individual is sample | Year ID Number | Sequence Number | Relationship to Head | Release Number | B5A | B5D | B6C | C2D | C2E | C2F | D2D3_month | D2D3_year | E1_1st_mention | E1_2nd_mention | E1_3rd_mention | E3 | G1 | G2_month | G2_year | G10 | G11 | G30A | G41A | G41B | G41C | G41H | G41P | H1 | L7_1st_mention | L7_2nd_mention | L7_3rd_mention | Age_17_graduate | Age_18_graduate | year | year_new |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 1 | 1 | NA | 5_32 | 2 | 2 | 624 | 3 | 30 | 5 | 5 | 5 | 5 | 7 | 7 | 7 | 0 | 0 | 1 | 7 | 0 | 0 | 1 | 5 | 2002 | 1 | 1 | 7 | 7 | 6 | 6 | 7 | 5 | 2 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
| 2 | 1 | 1 | NA | 6_34 | 1 | 2 | 1202 | 51 | 30 | 5 | 2 | 2 | 6 | 1 | 1 | 1 | 0 | 0 | 7 | 0 | 0 | 5 | 1 | 5 | 2002 | 1 | 1 | 0 | 7 | 5 | 7 | 5 | 3 | 1 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
| 2 | 1 | 1 | NA | 14_30 | 1 | 2 | 736 | 51 | 30 | 5 | 4 | 4 | 4 | 2 | 1 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 6 | 2003 | 1 | 5 | 6 | 5 | 6 | 6 | 5 | 5 | 2 | 1 | 0 | 0 | 19 | 20 | 2005 | -1 |
| 2 | 1 | 1 | NA | 47_34 | 2 | 2 | 2516 | 3 | 30 | 5 | 4 | 5 | 6 | 4 | 5 | 2 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 5 | 2005 | 5 | 0 | 6 | 3 | 6 | 4 | 7 | 4 | 1 | 1 | 0 | 0 | 17 | 18 | 2005 | -1 |
| 2 | 1 | 1 | NA | 53_35 | 2 | 2 | 1392 | 3 | 33 | 5 | 4 | 5 | 5 | 3 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 6 | 2002 | 1 | 1 | 7 | 6 | 7 | 7 | 7 | 5 | 1 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
| 2 | 1 | 1 | NA | 53_36 | 2 | 2 | 1616 | 3 | 30 | 5 | 4 | 5 | 7 | 4 | 1 | 1 | 0 | 0 | 6 | 0 | 0 | 1 | 1 | 6 | 2005 | 1 | 5 | 7 | 7 | 7 | 5 | 7 | 6 | 2 | 1 | 0 | 0 | 17 | 18 | 2005 | -1 |
B5A_Regression_05_09 <- coef(summary(lmer(B5A ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
B5A_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 1.7049437 0.9504058 1.793911
## Age_18_graduate 0.1126495 0.0408727 2.756105
## year_new 2.3317636 1.0986019 2.122483
## Age_18_graduate:year_new -0.1010051 0.0515928 -1.957736
B5D_Regression_05_09 <- coef(summary(lmer(B5D ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
B5D_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 4.505982339 0.71030845 6.3436980
## Age_18_graduate 0.009647563 0.03054743 0.3158225
## year_new 1.274845187 0.88038463 1.4480548
## Age_18_graduate:year_new -0.049783106 0.04138611 -1.2028941
B6C_Regression_05_09 <- coef(summary(lmer(B6C ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
B6C_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 5.66943070 1.18544897 4.7825177
## Age_18_graduate -0.01261529 0.05097942 -0.2474585
## year_new -1.42473025 1.17359923 -1.2139836
## Age_18_graduate:year_new 0.08128567 0.05494172 1.4794890
C2D_Regression_05_09 <- coef(summary(lmer(C2D ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
C2D_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 7.3808857 1.64577392 4.484751
## Age_18_graduate -0.1487023 0.07077708 -2.100995
## year_new 4.0749749 1.85011017 2.202558
## Age_18_graduate:year_new -0.1667451 0.08684468 -1.920038
C2E_Regression_05_09 <- coef(summary(lmer(C2E ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
C2E_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 7.0530144 1.68229219 4.192503
## Age_18_graduate -0.1438851 0.07234711 -1.988815
## year_new 3.3268969 1.82167329 1.826286
## Age_18_graduate:year_new -0.1319676 0.08545059 -1.544373
C2F_Regression_05_09 <- coef(summary(lmer(C2F ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
C2F_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 6.1188117 1.50217000 4.073315
## Age_18_graduate -0.1258293 0.06460078 -1.947799
## year_new 3.5870015 1.60324775 2.237334
## Age_18_graduate:year_new -0.1495906 0.07518302 -1.989686
E3_Regression_05_09 <- coef(summary(lmer(E3 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
E3_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 4.39454794 1.94710064 2.2569701
## Age_18_graduate -0.13947927 0.08373681 -1.6656865
## year_new -1.37494309 2.43826456 -0.5639023
## Age_18_graduate:year_new 0.06563105 0.11463524 0.5725208
G10_Regression_05_09 <- coef(summary(lmer(G10 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G10_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 3.87117081 1.38495464 2.795161
## Age_18_graduate -0.09283685 0.05955689 -1.558793
## year_new -3.33951941 1.19289126 -2.799517
## Age_18_graduate:year_new 0.18346199 0.05561477 3.298800
G11_Regression_05_09 <- coef(summary(lmer(G11 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G11_Regression_05_09
## Estimate Std. Error t value
## (Intercept) -2.58439662 1.65548953 -1.5611072
## Age_18_graduate 0.23584693 0.07119582 3.3126515
## year_new 2.47459896 2.07684845 1.1915164
## Age_18_graduate:year_new -0.09394457 0.09764536 -0.9620997
G30A_Regression_05_09 <- coef(summary(lmer(G30A ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G30A_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 5.71825037 1.45407293 3.9325747
## Age_18_graduate 0.00812878 0.06253379 0.1299902
## year_new -0.34353683 1.86209960 -0.1844890
## Age_18_graduate:year_new 0.04118634 0.08756947 0.4703276
G41A_Regression_05_09 <- coef(summary(lmer(G41A ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G41A_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 7.8986891 1.52885014 5.166425
## Age_18_graduate -0.1408573 0.06574693 -2.142417
## year_new 2.3370043 1.49157273 1.566805
## Age_18_graduate:year_new -0.1241290 0.06980167 -1.778310
G41B_Regression_05_09 <- coef(summary(lmer(G41B ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G41B_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 6.80031590 1.02986629 6.603106
## Age_18_graduate -0.05036615 0.04428979 -1.137196
## year_new 1.99032948 1.16229166 1.712418
## Age_18_graduate:year_new -0.09823104 0.05456202 -1.800355
G41C_Regression_05_09 <- coef(summary(lmer(G41C ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G41C_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 5.82545975 1.02975422 5.6571361
## Age_18_graduate -0.01049655 0.04428473 -0.2370241
## year_new 1.51721683 1.12459077 1.3491279
## Age_18_graduate:year_new -0.07307065 0.05276067 -1.3849453
G41H_Regression_05_09 <- coef(summary(lmer(G41H ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G41H_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 7.12844553 0.94360861 7.5544515
## Age_18_graduate -0.03713494 0.04058027 -0.9150984
## year_new 1.23105564 1.06878854 1.1518234
## Age_18_graduate:year_new -0.06055932 0.05017577 -1.2069435
G41P_Regression_05_09 <- coef(summary(lmer(G41P ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
G41P_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 8.4518726 1.46542740 5.767514
## Age_18_graduate -0.1740935 0.06302088 -2.762474
## year_new 3.7624438 1.59441924 2.359758
## Age_18_graduate:year_new -0.1916155 0.07479753 -2.561789
H1_Regression_05_09 <- coef(summary(lmer(H1 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2005_2009)))
H1_Regression_05_09
## Estimate Std. Error t value
## (Intercept) 1.971501515 0.78278878 2.5185613
## Age_18_graduate 0.009647212 0.03366364 0.2865766
## year_new -0.316060912 0.81412977 -0.3882193
## Age_18_graduate:year_new 0.017558568 0.03815714 0.4601647
Filter the data (2009 & 2015)
Long_format_2009_2015 <- TAS_data_long_format_age %>% filter(TAS09 == 1 & TAS15 ==1) %>% filter(Age_18_graduate< 50) %>% unite("TAS_ID", c("1968 Interview Number", "Person Number")) %>% mutate(year_new = case_when(year == 2005 ~ -1, year == 2009 ~ 0,year == 2015 ~ 1))
knitr::kable(head(Long_format_2009_2015[, 1:42]))
| TAS | TAS05 | TAS09 | TAS15 | TAS_ID | Gender | Individual is sample | Year ID Number | Sequence Number | Relationship to Head | Release Number | B5A | B5D | B6C | C2D | C2E | C2F | D2D3_month | D2D3_year | E1_1st_mention | E1_2nd_mention | E1_3rd_mention | E3 | G1 | G2_month | G2_year | G10 | G11 | G30A | G41A | G41B | G41C | G41H | G41P | H1 | L7_1st_mention | L7_2nd_mention | L7_3rd_mention | Age_17_graduate | Age_18_graduate | year | year_new |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | NA | 1 | 1 | 4_39 | 2 | 2 | 13 | 3 | 60 | 3 | 4 | 5 | 4 | 6 | 7 | 5 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 5 | 2008 | 1 | 5 | 5 | 6 | 5 | 2 | 7 | 6 | 2 | 1 | 0 | 0 | 18 | 19 | 2009 | 0 |
| 2 | NA | 1 | 1 | 7_40 | 2 | 2 | 3836 | 2 | 22 | 3 | 2 | 2 | 7 | 7 | 3 | 4 | 0 | 0 | 6 | 0 | 0 | 5 | 1 | 6 | 2007 | 5 | 0 | 5 | 5 | 2 | 5 | 6 | 5 | 3 | 1 | 0 | 0 | 19 | 20 | 2009 | 0 |
| 2 | NA | 1 | 1 | 7_41 | 1 | 2 | 576 | 2 | 30 | 3 | 3 | 4 | 7 | 4 | 5 | 4 | 0 | 0 | 3 | 0 | 0 | 5 | 1 | 5 | 2009 | 5 | 0 | 7 | 5 | 6 | 5 | 7 | 5 | 2 | 1 | 0 | 0 | 17 | 18 | 2009 | 0 |
| 2 | NA | 1 | 1 | 10_34 | 2 | 2 | 3276 | 3 | 30 | 3 | 4 | 5 | 6 | 4 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 6 | 2008 | 1 | 5 | 7 | 7 | 5 | 4 | 7 | 5 | 2 | 2 | 0 | 0 | 18 | 19 | 2009 | 0 |
| 2 | NA | 1 | 1 | 14_31 | 2 | 2 | 713 | 1 | 10 | 3 | 5 | 5 | 7 | 4 | 4 | 4 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 6 | 2005 | 5 | 0 | 6 | 5 | 7 | 6 | 7 | 2 | 4 | 1 | 0 | 0 | 21 | 22 | 2009 | 0 |
| 2 | NA | 1 | 1 | 22_30 | 2 | 2 | 907 | 2 | 30 | 3 | 5 | 1 | 4 | 3 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 5 | 2006 | 1 | 1 | 7 | 6 | 6 | 6 | 6 | 6 | 1 | 2 | 0 | 0 | 20 | 21 | 2009 | 0 |
B5A_Regression_09_15 <- coef(summary(lmer(B5A ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
B5A_Regression_09_15
## Estimate Std. Error t value
## (Intercept) -0.06784334 0.90650139 -0.07484086
## Age_18_graduate 0.18195862 0.04683835 3.88482108
## year_new 8.18855845 2.13773121 3.83049019
## Age_18_graduate:year_new -0.32077226 0.08942129 -3.58720246
B5D_Regression_09_15 <- coef(summary(lmer(B5D ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
B5D_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 2.1596035 0.71917836 3.002876
## Age_18_graduate 0.1158126 0.03715993 3.116599
## year_new 2.6653056 1.64124639 1.623952
## Age_18_graduate:year_new -0.1169529 0.06859541 -1.704966
B6C_Regression_09_15 <- coef(summary(lmer(B6C ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
B6C_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 5.387665355 0.97147373 5.54586830
## Age_18_graduate 0.005874344 0.05019645 0.11702708
## year_new -0.023141367 2.16345717 -0.01069648
## Age_18_graduate:year_new -0.009995851 0.09038310 -0.11059425
C2D_Regression_09_15 <- coef(summary(lmer(C2D ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
C2D_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 4.13060635 1.49865491 2.7562091
## Age_18_graduate -0.02107251 0.07743331 -0.2721376
## year_new 2.39751228 3.70020892 0.6479397
## Age_18_graduate:year_new -0.10211535 0.15511410 -0.6583241
C2E_Regression_09_15 <- coef(summary(lmer(C2E ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
C2E_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 4.39942243 1.49336061 2.9459880
## Age_18_graduate -0.03992373 0.07716012 -0.5174140
## year_new -1.23602788 3.63452607 -0.3400795
## Age_18_graduate:year_new 0.03853863 0.15222947 0.2531614
C2F_Regression_09_15 <- coef(summary(lmer(C2F ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
C2F_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 3.233585058 1.31538304 2.4582840
## Age_18_graduate -0.008496079 0.06796569 -0.1250054
## year_new 3.266890918 3.01765574 1.0825923
## Age_18_graduate:year_new -0.137321119 0.12613599 -1.0886752
E3_Regression_09_15 <- coef(summary(lmer(E3 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
E3_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 12.1131294 1.76953564 6.845372
## Age_18_graduate -0.5192913 0.09142913 -5.679714
## year_new -9.5814818 4.40210705 -2.176567
## Age_18_graduate:year_new 0.4502147 0.18464166 2.438316
G10_Regression_09_15 <- coef(summary(lmer(G10 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G10_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 5.9448964 1.32392793 4.490347
## Age_18_graduate -0.2045299 0.06841002 -2.989765
## year_new -4.2356131 2.58746648 -1.636973
## Age_18_graduate:year_new 0.1752695 0.10803679 1.622313
G11_Regression_09_15 <- coef(summary(lmer(G11 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G11_Regression_09_15
## Estimate Std. Error t value
## (Intercept) -4.1480226 1.24457562 -3.332881
## Age_18_graduate 0.2785812 0.06430516 4.332175
## year_new 6.0329273 3.11954157 1.933915
## Age_18_graduate:year_new -0.2078620 0.13093333 -1.587541
G30A_Regression_09_15 <- coef(summary(lmer(G30A ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G30A_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 6.27869137 0.78012521 8.0483124
## Age_18_graduate -0.01196506 0.04030851 -0.2968369
## year_new -1.19472620 1.84737398 -0.6467159
## Age_18_graduate:year_new 0.05204445 0.07728628 0.6733984
G41A_Regression_09_15 <- coef(summary(lmer(G41A ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G41A_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 10.4620335 1.29529818 8.076931
## Age_18_graduate -0.2749885 0.06692972 -4.108616
## year_new -3.1765831 2.72347032 -1.166373
## Age_18_graduate:year_new 0.1716292 0.11371924 1.509236
G41B_Regression_09_15 <- coef(summary(lmer(G41B ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G41B_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 7.381505151 0.93290003 7.91242885
## Age_18_graduate -0.086371067 0.04820305 -1.79181748
## year_new 0.590214017 2.11366219 0.27923763
## Age_18_graduate:year_new -0.003997973 0.08832756 -0.04526303
G41C_Regression_09_15 <- coef(summary(lmer(G41C ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G41C_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 6.29767447 1.21980546 5.162852
## Age_18_graduate -0.03876255 0.06302525 -0.615032
## year_new 25.15586480 3.07690464 8.175705
## Age_18_graduate:year_new -1.14267489 0.12923163 -8.842068
G41H_Regression_09_15 <- coef(summary(lmer(G41H ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G41H_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 7.13997793 0.84018263 8.4981261
## Age_18_graduate -0.04077900 0.04341277 -0.9393320
## year_new -1.42772553 1.84671752 -0.7731153
## Age_18_graduate:year_new 0.05882735 0.07713752 0.7626296
G41P_Regression_09_15 <- coef(summary(lmer(G41P ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
G41P_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 9.3552436 1.28054155 7.305693
## Age_18_graduate -0.2298414 0.06616616 -3.473701
## year_new -4.5067094 2.84500405 -1.584078
## Age_18_graduate:year_new 0.2374688 0.11885225 1.998017
H1_Regression_09_15 <- coef(summary(lmer(H1 ~ Age_18_graduate + year_new + Age_18_graduate*year_new + (1 | TAS_ID), data = Long_format_2009_2015)))
H1_Regression_09_15
## Estimate Std. Error t value
## (Intercept) 0.76614503 0.69569144 1.1012713
## Age_18_graduate 0.07040371 0.03594607 1.9585926
## year_new 1.31170836 1.62367933 0.8078617
## Age_18_graduate:year_new -0.06162274 0.06789749 -0.9075849
Filter the data (2005 & 2015)
Long_format_2005_2015 <- TAS_data_long_format_age %>% filter(year==2005| year==2015) %>% filter(Age_18_graduate< 50) %>% mutate(year_new = case_when(year == 2005 ~ -1, year == 2009 ~ 0,year == 2015 ~ 1))
knitr::kable(head(Long_format_2005_2015[, 1:43]))
| TAS | TAS05 | TAS09 | TAS15 | 1968 Interview Number | Person Number | Gender | Individual is sample | Year ID Number | Sequence Number | Relationship to Head | Release Number | B5A | B5D | B6C | C2D | C2E | C2F | D2D3_month | D2D3_year | E1_1st_mention | E1_2nd_mention | E1_3rd_mention | E3 | G1 | G2_month | G2_year | G10 | G11 | G30A | G41A | G41B | G41C | G41H | G41P | H1 | L7_1st_mention | L7_2nd_mention | L7_3rd_mention | Age_17_graduate | Age_18_graduate | year | year_new |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 1 | 1 | NA | 5 | 32 | 2 | 2 | 624 | 3 | 30 | 5 | 5 | 5 | 5 | 7 | 7 | 7 | 0 | 0 | 1 | 7 | 0 | 0 | 1 | 5 | 2002 | 1 | 1 | 7 | 7 | 6 | 6 | 7 | 5 | 2 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
| 2 | 1 | 1 | NA | 6 | 34 | 1 | 2 | 1202 | 51 | 30 | 5 | 2 | 2 | 6 | 1 | 1 | 1 | 0 | 0 | 7 | 0 | 0 | 5 | 1 | 5 | 2002 | 1 | 1 | 0 | 7 | 5 | 7 | 5 | 3 | 1 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
| 2 | 1 | 1 | NA | 14 | 30 | 1 | 2 | 736 | 51 | 30 | 5 | 4 | 4 | 4 | 2 | 1 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 6 | 2003 | 1 | 5 | 6 | 5 | 6 | 6 | 5 | 5 | 2 | 1 | 0 | 0 | 19 | 20 | 2005 | -1 |
| 1 | 1 | NA | NA | 18 | 38 | 2 | 2 | 5647 | 3 | 98 | 5 | 3 | 4 | 3 | 4 | 2 | 2 | 0 | 0 | 3 | 7 | 0 | 5 | 1 | 6 | 2004 | 1 | 5 | 6 | 5 | 5 | 5 | 7 | 5 | 2 | 1 | 0 | 0 | 18 | 19 | 2005 | -1 |
| 2 | 1 | 1 | NA | 47 | 34 | 2 | 2 | 2516 | 3 | 30 | 5 | 4 | 5 | 6 | 4 | 5 | 2 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 5 | 2005 | 5 | 0 | 6 | 3 | 6 | 4 | 7 | 4 | 1 | 1 | 0 | 0 | 17 | 18 | 2005 | -1 |
| 2 | 1 | 1 | NA | 53 | 35 | 2 | 2 | 1392 | 3 | 33 | 5 | 4 | 5 | 5 | 3 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 6 | 2002 | 1 | 1 | 7 | 6 | 7 | 7 | 7 | 5 | 1 | 1 | 0 | 0 | 20 | 21 | 2005 | -1 |
coef(summary(lm(B5A ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.0315954 0.1018711 39.575457 2.803596e-225
## Gender -0.1979421 0.0638855 -3.098388 1.987583e-03
## year_new 0.2047267 0.0320330 6.391119 2.291367e-10
coef(summary(lm(B5D ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.56326308 0.08011094 56.961793 0.0000000000
## Gender -0.06503111 0.05023925 -1.294428 0.1957479412
## year_new 0.08376591 0.02519060 3.325285 0.0009079731
coef(summary(lm(B6C ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.38049049 0.12029882 44.7260459 4.563815e-265
## Gender -0.03713145 0.07544191 -0.4921860 6.226712e-01
## year_new 0.03260448 0.03782753 0.8619247 3.888883e-01
coef(summary(lm(C2D ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.47868097 0.16322806 21.311782 1.194268e-86
## Gender 0.08747606 0.10236374 0.854561 3.929520e-01
## year_new -0.06054635 0.05132647 -1.179632 2.383629e-01
coef(summary(lm(C2E ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.05782814 0.17001859 17.9852572 9.625869e-65
## Gender 0.29525591 0.10662222 2.7691780 5.699871e-03
## year_new -0.01327876 0.05346173 -0.2483788 8.038807e-01
coef(summary(lm(C2F ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.70300273 0.15328352 17.634007 1.489996e-62
## Gender 0.20155433 0.09612731 2.096744 3.620954e-02
## year_new 0.03962929 0.04819945 0.822194 4.111176e-01
coef(summary(lm(E3 ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.44293314 0.19689620 7.3283952 4.082580e-13
## Gender 0.04978551 0.12347773 0.4031943 6.868718e-01
## year_new -0.25138842 0.06191329 -4.0603303 5.193669e-05
coef(summary(lm(G10 ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.20322884 0.15242429 14.454578 5.087477e-44
## Gender -0.27530220 0.09558847 -2.880078 4.041110e-03
## year_new -0.09047707 0.04792927 -1.887721 5.928652e-02
coef(summary(lm(G11 ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.8481899 0.16943878 10.9077145 1.448750e-26
## Gender 0.0232750 0.10625861 0.2190411 8.266525e-01
## year_new 0.5452727 0.05327941 10.2342115 1.077770e-23
coef(summary(lm(G30A ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.67676303 0.13936409 40.7333270 2.759724e-234
## Gender 0.04920755 0.08739814 0.5630274 5.735135e-01
## year_new 0.31877671 0.04382253 7.2742650 6.008737e-13
coef(summary(lm(G41A ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.91622778 0.15069224 32.624293 5.831102e-171
## Gender 0.08934479 0.09450226 0.945425 3.446181e-01
## year_new -0.19273169 0.04738463 -4.067389 5.040812e-05
coef(summary(lm(G41B ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.55242121 0.10837947 51.231303 6.452355e-314
## Gender 0.09262916 0.06796703 1.362854 1.731650e-01
## year_new -0.05062620 0.03407953 -1.485531 1.376462e-01
coef(summary(lm(G41C ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.05045819 0.16259746 31.0611133 8.107273e-159
## Gender 0.04782299 0.10196827 0.4689987 6.391494e-01
## year_new -0.37811595 0.05112818 -7.3954509 2.520449e-13
coef(summary(lm(G41H ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.88255589 0.09269561 63.461000 0.000000e+00
## Gender 0.26887442 0.05813136 4.625291 4.114766e-06
## year_new -0.04569501 0.02914780 -1.567700 1.171950e-01
coef(summary(lm(G41P ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.92899976 0.14075490 35.018318 1.170615e-189
## Gender 0.01793715 0.08827034 0.203207 8.390051e-01
## year_new -0.05829606 0.04425987 -1.317131 1.880272e-01
coef(summary(lm(H1 ~ Gender + year_new, data = Long_format_2005_2015)))
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.96972544 0.08295675 23.744003 8.884067e-104
## Gender 0.14983206 0.05202392 2.880061 4.041321e-03
## year_new 0.07781306 0.02608545 2.983006 2.907658e-03