Gratitude scale
The following questions are about this friend: For the questions on this page, please consider the interactions you have had with this person since the last time you filled out this questionnaire.
Over the past two weeks how grateful have you been toward this person?
Over the past two weeks how thankful have you been toward this person?
Over the past two weeks how appreciative have you been toward this person?
library(psych)
library(car)
library(lmSupport)
library(lmerTest)
library(lme4)
source('http://psych.colorado.edu/~jclab/R/mcSummaryLm.R')
library(dplyr)
library(tidyverse)
library(pwr)
library(sjPlot)
library(readr)
library(ggplot2)
library(ggcorrplot)
d <- read.csv("C:/Users/Dani Grant/Dropbox/graduate school records/research projects/longitudinal gratitude/analyses/short_long_grat.csv", header = T)
h1 <- lmer(wtr ~ rank + (rank | subID), data = d)
tab_model(h1,
show.df = T,
show.ci = .95,
show.se = T,
show.stat = T,
string.stat = "t",
string.se="SE",
string.est = "Est",
digits = 3)
| wtr | ||||||
|---|---|---|---|---|---|---|
| Predictors | Est | SE | CI | t | p | df |
| (Intercept) | 0.791 | 0.025 | 0.741 – 0.841 | 31.127 | <0.001 | 1343.000 |
| rank | -0.071 | 0.007 | -0.084 – -0.057 | -10.217 | <0.001 | 1343.000 |
| Random Effects | ||||||
| σ2 | 0.03 | |||||
| τ00 subID | 0.05 | |||||
| τ11 subID.rank | 0.00 | |||||
| ρ01 subID | -0.24 | |||||
| ICC | 0.68 | |||||
| N subID | 99 | |||||
| Observations | 1349 | |||||
| Marginal R2 / Conditional R2 | 0.068 / 0.706 | |||||
plot_model(h1, type = "pred", terms = c("rank")) +
ggtitle("") +
ylab("WTR") +
xlab("Friend Ranking") +
theme_minimal() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black"),
legend.position = "none",
legend.background = element_rect(fill = "white", color = "white"),
legend.title = element_blank()) +
scale_y_continuous(breaks = c(0, .2, .4, .6, .8, 1.0, 1.2),
limits = c(0, 1.2))
h2<- lmer(gratScale ~ wtr + (wtr | subID), data = d)
tab_model(h2,
show.df = T,
show.ci = .95,
show.se = T,
show.stat = T,
string.stat = "t",
string.se="SE",
string.est = "Est",
digits = 3)
| gratScale | ||||||
|---|---|---|---|---|---|---|
| Predictors | Est | SE | CI | t | p | df |
| (Intercept) | 1.895 | 0.198 | 1.507 – 2.283 | 9.574 | <0.001 | 1123.000 |
| wtr | 2.854 | 0.294 | 2.278 – 3.430 | 9.718 | <0.001 | 1123.000 |
| Random Effects | ||||||
| σ2 | 1.34 | |||||
| τ00 subID | 1.92 | |||||
| τ11 subID.wtr | 3.72 | |||||
| ρ01 subID | -0.60 | |||||
| ICC | 0.56 | |||||
| N subID | 99 | |||||
| Observations | 1129 | |||||
| Marginal R2 / Conditional R2 | 0.210 / 0.652 | |||||
plot_model(h2, type = "pred", terms = c("wtr")) +
ggtitle("") +
ylab("Gratitude Scale") +
xlab("WTR") +
theme_minimal() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black"),
legend.position = "none",
legend.background = element_rect(fill = "white", color = "white"),
legend.title = element_blank()) +
scale_y_continuous(breaks = c(0, 1, 2, 3, 4, 5, 6),
limits = c(0, 6)) +
scale_x_continuous(breaks = c(0, .2, .4, .6, .8, 1.0, 1.2),
limits = c(0, 1.2))
h3 <- lmer(gratScale ~ wtrDiff + (wtrDiff | subID), data = d)
tab_model(h3,
show.df = T,
show.ci = .95,
show.se = T,
show.stat = T,
string.stat = "t",
string.se="SE",
string.est = "Est",
digits = 3)
| gratScale | ||||||
|---|---|---|---|---|---|---|
| Predictors | Est | SE | CI | t | p | df |
| (Intercept) | 3.509 | 0.123 | 3.268 – 3.749 | 28.578 | <0.001 | 1036.000 |
| wtrDiff | 1.375 | 0.242 | 0.900 – 1.849 | 5.680 | <0.001 | 1036.000 |
| Random Effects | ||||||
| σ2 | 1.73 | |||||
| τ00 subID | 1.26 | |||||
| τ11 subID.wtrDiff | 0.25 | |||||
| ρ01 subID | -0.05 | |||||
| ICC | 0.42 | |||||
| N subID | 98 | |||||
| Observations | 1042 | |||||
| Marginal R2 / Conditional R2 | 0.023 / 0.437 | |||||
plot_model(h3, type = "pred", terms = c("wtrDiff")) +
ggtitle("") +
ylab("Gratitude Scale") +
xlab("Change in WTR") +
theme_minimal() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black"),
legend.position = "none",
legend.background = element_rect(fill = "white", color = "white"),
legend.title = element_blank()) +
scale_y_continuous(breaks = c(0, 1, 2, 3, 4, 5, 6),
limits = c(0, 6))