x <- matrix(rep(0,1,25), nrow = 5, dimnames = list(c("O", "X","Y","Z", "A"), c("D","A","B","C", "E")))
colnames(x)<- c("wellbeing", "int", "ext", "age", "mathability")
row.names(x)<- c("wellbeing", "int", "ext", "age", "mathability")
traits<-c("wellbeing", "int", "ext", "age", "mathability")
# let's think about these variables and populate a correlation matrix.
# we know int, ext and wellbeing likely correlate
# we'll throw in age as a covariate
# and the always random math ability
x
## wellbeing int ext age mathability
## wellbeing 0 0 0 0 0
## int 0 0 0 0 0
## ext 0 0 0 0 0
## age 0 0 0 0 0
## mathability 0 0 0 0 0
cmat <- matrix(c(1, -.5, -.3, .3, .1,
-.5, 1, .7, .3, .001,
-.3, .7, 1, .4, .002,
.3, .3, .4, 1, .3,
.1, .001, .002, .3, 1), nrow=5, dimnames = list(c("wellbeing", "int", "ext", "age", "mathability"), c("wellbeing", "int", "ext", "age", "mathability")))
# here is our filled correlation matrix!
cmat
## wellbeing int ext age mathability
## wellbeing 1.0 -0.500 -0.300 0.3 0.100
## int -0.5 1.000 0.700 0.3 0.001
## ext -0.3 0.700 1.000 0.4 0.002
## age 0.3 0.300 0.400 1.0 0.300
## mathability 0.1 0.001 0.002 0.3 1.000
set.seed(2)
dat <- rnorm_multi(n = 100,
mu = c(14, 11, 7, 15, 10),
sd = c(3, 2, 5, 3, 4),
r = cmat,
varnames = c("wellbeing", "int", "ext", "age", "mathability"),
empirical = FALSE)
math abiltiy does not predict wellbeing. surprise! internalizing, externalizing and age do all separately predict wellbeing.
when we allow int, ext, age and math ability to predict wellbeing, only internalizing and age are significant predictors. the tolerance for externalizing is the lowest (.379) – indicating maybe it isn’t such a useful predictor because it overlaps a lot with the other covariates (int, age and math ability). on the other hand, math ability has the highest tolerance (.892), which means it is a unique predictor in the model. does this automatically make it a good predictor though? not if it isn’t explaining variance in wellbeing (PRE=.029)! Funny enough the PRE for externalizing is the same… all things to think about when you ask your research questions!
# mod 1 - math predicting wellbeing
mcSummary(lm(wellbeing~mathability, data=dat))
## lm(formula = wellbeing ~ mathability, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 0.340 1 0.340 0 0.035 0.851
## Error 943.961 98 9.632
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 3.104 -0.01
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 14.536 0.834 17.436 2928.253 0.756 NA 12.882 16.190 0.000
## mathability 0.015 0.077 0.188 0.340 0.000 NA -0.139 0.168 0.851
# mod 2 - age predicting wellbeing
mcSummary(lm(wellbeing~age, data=dat))
## lm(formula = wellbeing ~ age, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 74.383 1 74.383 0.079 8.38 0.005
## Error 869.918 98 8.877
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 2.979 0.069
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 10.474 1.484 7.060 442.432 0.337 NA 7.530 13.418 0.000
## age 0.283 0.098 2.895 74.383 0.079 NA 0.089 0.477 0.005
# mod 3 - int predicting wellbeing
mcSummary(lm(wellbeing~int, data=dat))
## lm(formula = wellbeing ~ int, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 246.099 1 246.099 0.261 34.543 0
## Error 698.202 98 7.125
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 2.669 0.253
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 22.402 1.34 16.712 1989.836 0.740 NA 19.742 25.062 0
## int -0.705 0.12 -5.877 246.099 0.261 NA -0.943 -0.467 0
# mod 4 - ext predicting wellbeing
mcSummary(lm(wellbeing~ext, data=dat))
## lm(formula = wellbeing ~ ext, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 83.451 1 83.451 0.088 9.5 0.003
## Error 860.850 98 8.784
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 2.964 0.079
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 15.860 0.484 32.781 9439.549 0.916 NA 14.900 16.820 0.000
## ext -0.159 0.052 -3.082 83.451 0.088 NA -0.262 -0.057 0.003
# mod 5 - all of the above predicting wellbeing
mcSummary(lm(wellbeing~int+ext+age+mathability, data=dat))
## lm(formula = wellbeing ~ int + ext + age + mathability, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 542.757 4 135.689 0.575 32.102 0
## Error 401.544 95 4.227
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 2.056 0.557
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 15.860 1.606 9.875 412.170 0.507 NA 12.671 19.048 0.000
## int -0.894 0.137 -6.509 179.078 0.308 0.453 -1.166 -0.621 0.000
## ext -0.099 0.058 -1.698 12.180 0.029 0.379 -0.215 0.017 0.093
## age 0.690 0.085 8.134 279.640 0.411 0.634 0.521 0.858 0.000
## mathability -0.091 0.054 -1.679 11.917 0.029 0.892 -0.199 0.017 0.096
# mod 6 - age and math predicting wellbeing
mcSummary(lm(wellbeing~age+mathability, data=dat))
## lm(formula = wellbeing ~ age + mathability, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 78.661 2 39.331 0.083 4.407 0.015
## Error 865.640 97 8.924
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 2.987 0.064
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 10.701 1.523 7.025 440.466 0.337 NA 7.678 13.724 0.000
## age 0.304 0.103 2.962 78.321 0.083 0.912 0.100 0.508 0.004
## mathability -0.054 0.078 -0.692 4.278 0.005 0.912 -0.209 0.101 0.490
how does tolerance change if we have different Y variables?
mcSummary(lm(int~ext+age+mathability, data=dat))
## lm(formula = int ~ ext + age + mathability, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 270.700 3 90.233 0.547 38.642 0
## Error 224.168 96 2.335
## Corr Total 494.868 99 4.999
##
## RMSE AdjEtaSq
## 1.528 0.533
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 8.578 0.812 10.570 260.909 0.538 NA 6.967 10.189 0.00
## ext 0.285 0.032 8.907 185.272 0.453 0.693 0.222 0.349 0.00
## age 0.001 0.063 0.013 0.000 0.000 0.634 -0.124 0.126 0.99
## mathability 0.025 0.040 0.616 0.885 0.004 0.896 -0.055 0.105 0.54
mcSummary(lm(wellbeing~ext+age+mathability, data=dat))
## lm(formula = wellbeing ~ ext + age + mathability, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 363.679 3 121.226 0.385 20.044 0
## Error 580.622 96 6.048
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 2.459 0.366
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 8.193 1.306 6.273 238.009 0.291 NA 5.601 10.785 0.000
## ext -0.354 0.052 -6.865 285.018 0.329 0.693 -0.456 -0.252 0.000
## age 0.689 0.101 6.793 279.061 0.325 0.634 0.488 0.890 0.000
## mathability -0.113 0.065 -1.748 18.486 0.031 0.896 -0.242 0.015 0.084
it doesnt :-) because tolerance is how the X variables relate and has nothing to do with Y.
communicate to the reader (a) the question, (b) the nature of the data, (c) the nature of the analysis used to test the question, including enough information that the reader can determine Models A & C, (d) the statistical conclusion, (e), and what the result means (the “what it means” section should include an interpretation of the partial regression coefficient).
does internalizing significantly predict wellbeing above and beyond other psychopathology?
mcSummary(lm(wellbeing~int+ext+age, data=dat))
## lm(formula = wellbeing ~ int + ext + age, data = dat)
##
## Omnibus ANOVA
## SS df MS EtaSq F p
## Model 530.839 3 176.946 0.562 41.085 0
## Error 413.461 96 4.307
## Corr Total 944.301 99 9.538
##
## RMSE AdjEtaSq
## 2.075 0.548
##
## Coefficients
## Est StErr t SSR(3) EtaSq tol CI_2.5 CI_97.5 p
## (Intercept) 15.678 1.618 9.693 404.613 0.495 NA 12.467 18.889 0.000
## int -0.908 0.138 -6.565 185.647 0.310 0.455 -1.183 -0.634 0.000
## ext -0.085 0.058 -1.462 9.211 0.022 0.387 -0.201 0.030 0.147
## age 0.645 0.081 7.941 271.591 0.396 0.705 0.483 0.806 0.000
Wellbeing is a subjective report of how well someone perceives their health and livelihood. Internalizing psychopathology typically consists of disorders such as anxiety, depression or PTSD, and can be a detriment to wellbeing. Here, we had sample of 100 people and had them rate their wellbeing, internalizing and externalizing symptoms, math ability and age.
In this model, we allowed internalizing to predict wellbeing, while controlling for externalizing psychopathology and age. We added externalizing psychopathology as a covariate because it correlates very strongly with internalizing (r=.7) as many disorders are comborbid across internalizing and externalizing. Similarly, prevalence rates of internalizing and externalizing differ across ages so we controlled for age as well.
Internalizing does significantly predict wellbeing, controlling for externalizing and age. For each one unit increase in internalizing, wellbeing decreases .908, holding externalizing and age constant (t=6.565, PRE=310, p<.001). Externalizing does not significantly predict wellbeing controlling for internalizing and age, but age does significantly predict wellbeing holding internalizing and externalizing constant.
The tolerance for internalizing is .455, which is the unique variance in internalizing not explained by externalizing and age. Similarly, the tolerance for externalizing is .455, which is the unique variance in externalizing not explained by internalizing and age. This demonstrates the overlap in mainly internalizing and externalizing. We can infer the large overlap in internalizing and externalizing because the tolerance for age is .705, meaning internalizing and externalizing do not explain a ton of variance in age – or that age is a unique predictor. Further, age explains almost more error in this model than internalizing, our main predictor of interest (age PRE= .396). This means age is a useful covariate to control for. It is explaining variance unique from internalizing, but is soaking up more error, thus making it a useful predictor and improving our model.
Even though externalizing only reduced a small amount of error in this model (PRE=.022), we thought it was a useful predictor to include because we wanted to know if internalizing predicts wellbeing above and beyond externalizing. Externalizing is significantly related to wellbeing, but does not predict enough unique variance in wellbeing, over and above externalizing and age, to be significant.
In this project, we found having more internalizing disorder symptoms significantly reduces wellbeing even after accounting for externalizing disorder symptoms and age. This means, regardless of externalizing symptoms and age, as internalizing disorder symptoms increase, wellbeing is likely to decrease.