You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
## Interactions
df <- read.csv("final_unal0_functions_complete.csv")
# fit a smooth which varies by comparison_type
df$comparison_type <- factor(df$comparison_type)
fit.in1 <- lm(ssim_exp_scale ~ stage*comparison_type, data=df)
visreg(fit.in1, "stage", by="comparison_type")
GAM Model with factor smooth interaction ( Gaussian Family )
library(mgcv)
library(visreg)
df <- read.csv("final_unal0_functions_complete.csv")
# fit a smooth which varies by comparison_type
df$comparison_type <- factor(df$comparison_type)
# separate smooth functions for each level of the factor
# each has its own smoothness parameter
# centred ( no group means ) so include factor as a fixed effect
a2 <- gam(ssim_exp_scale ~ s(stage, k = 3, fx = TRUE, by = comparison_type) + comparison_type, data = df, family = gaussian())
summary(a2)
visreg(a2, xvar = "stage", by = "comparison_type", data = df, method = "REML")
Bayesian Analysis with Zero-One-Inflated Beta Model
library('brms')
library('lmerTest')
df <- read.csv("final_unal0_functions_complete.csv")
# fit a smooth which varies by comparison_type
df$comparison_type <- factor(df$comparison_type)
# separate smooth functions for each level of the factor
# each has its own smoothness parameter
# centred ( no group means ) so include factor as a fixed effect
a1 <- brm(ssim_exp_scale ~ s(stage, k = 3, fx = TRUE, by = comparison_type) + comparison_type, data = df, family = zero_one_inflated_beta(), iter = 3000)
summary(a1)