# Generate a design matrix for the data
design <- model.matrix(~ 0 + factor(rep(1:2, each = 3)))
# Set correct colnames, this is important for calculate_mean_sd_trends
colnames(design) <- paste0("ng", c(50, 100))
# Normalize and log-transform the data
yeast_norm <- psrn(yeast, "identifier") %>%
# Add row means and variances
calculate_mean_sd_trends(design)
# Fit gamma regression model for the mean-variance trends
gamma_model <- fit_gamma_regression(yeast_norm, sd ~ mean)
Run the code above in your browser using DataLab