Dependent variables: no.intersections Independent variables: dist.soma.um Unit of measure: n is a cell Fixed Effects: group (MIA, CON), trt (SAL, LPS), region (dorsal striatum (DS) & ventral striatum (VS)) Random Effects: id (mice), litter (mom id to identify siblings)
data <- read.csv("mg.sholl.csv",header=TRUE, stringsAsFactors = TRUE)
data$trt <- factor(data$trt, levels = c("SAL", "LPS"))
data$group2 <- factor(data$group2, levels=c("CON:SAL","CON:LPS","MIA:SAL","MIA:LPS"))
data$cellID <- paste(data$id, data$slice, data$cell, sep = ".")
data %>% group_by(group, trt, region) %>% summarise(n = length(unique(cellID)), mouse = length(unique(id)), litter = length(unique(litter)))
## `summarise()` has grouped output by 'group', 'trt'. You can override using the `.groups` argument.
## # A tibble: 8 x 6
## # Groups: group, trt [4]
## group trt region n mouse litter
## <fct> <fct> <fct> <int> <int> <int>
## 1 CON SAL DS 34 4 4
## 2 CON SAL VS 25 4 4
## 3 CON LPS DS 33 4 4
## 4 CON LPS VS 29 4 4
## 5 MIA SAL DS 19 4 3
## 6 MIA SAL VS 26 4 3
## 7 MIA LPS DS 25 3 2
## 8 MIA LPS VS 19 3 2
lme.fit <- lmer(no.intersections ~ dist.soma.um + group * trt + region + (1|litter), data=data)
summary(lme.fit)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: no.intersections ~ dist.soma.um + group * trt + region + (1 |
## litter)
## Data: data
##
## REML criterion at convergence: 51438.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.4758 -0.6811 -0.1697 0.5996 4.8468
##
## Random effects:
## Groups Name Variance Std.Dev.
## litter (Intercept) 2.011 1.418
## Residual 37.855 6.153
## Number of obs: 7942, groups: litter, 10
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.296e+01 5.830e-01 1.044e+01 22.229 3.95e-10 ***
## dist.soma.um -1.856e-01 5.678e-03 7.931e+03 -32.694 < 2e-16 ***
## groupMIA 9.023e-01 1.009e+00 8.500e+00 0.895 0.39561
## trtLPS -7.098e-01 3.468e-01 9.481e+02 -2.047 0.04097 *
## regionVS -3.835e-01 1.411e-01 7.936e+03 -2.718 0.00657 **
## groupMIA:trtLPS -3.017e+00 4.363e-01 1.873e+03 -6.915 6.41e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) dst.s. grpMIA trtLPS regnVS
## dist.soma.m -0.199
## groupMIA -0.549 0.001
## trtLPS -0.283 0.006 0.169
## regionVS -0.088 0.033 -0.034 -0.075
## grpMIA:tLPS 0.210 0.059 -0.184 -0.796 0.087
mod0 <- lmer(no.intersections ~ dist.soma.um + group * trt + region + (1|litter), data=data)
mod1 <- lmer(no.intersections ~ dist.soma.um + group + trt + region + (1|litter), data=data)
mod2 <- lmer(no.intersections ~ dist.soma.um + trt + region + (1|litter), data=data)
anova(mod0, mod1) # interaction effect # SIG
## refitting model(s) with ML (instead of REML)
## Data: data
## Models:
## mod1: no.intersections ~ dist.soma.um + group + trt + region + (1 | litter)
## mod0: no.intersections ~ dist.soma.um + group * trt + region + (1 | litter)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## mod1 7 51490 51539 -25738 51476
## mod0 8 51444 51500 -25714 51428 47.956 1 4.359e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## refitting model(s) with ML (instead of REML)
## Data: data
## Models:
## mod2: no.intersections ~ dist.soma.um + trt + region + (1 | litter)
## mod0: no.intersections ~ dist.soma.um + group * trt + region + (1 | litter)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## mod2 6 51488 51530 -25738 51476
## mod0 8 51444 51500 -25714 51428 48.098 2 3.595e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [1] "2021-09-07 13:06:25 EDT"
## ─ Session info ───────────────────────────────────────────────────────────────
## setting value
## version R version 4.0.3 (2020-10-10)
## os macOS Big Sur 10.16
## system x86_64, darwin17.0
## ui X11
## language (EN)
## collate en_US.UTF-8
## ctype en_US.UTF-8
## tz America/New_York
## date 2021-09-07
##
## ─ Packages ───────────────────────────────────────────────────────────────────
## package * version date lib source
## assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.2)
## backports 1.2.1 2020-12-09 [1] CRAN (R 4.0.2)
## boot 1.3-28 2021-05-03 [1] CRAN (R 4.0.2)
## broom 0.7.8 2021-06-24 [1] CRAN (R 4.0.2)
## bslib 0.2.5.1 2021-05-18 [1] CRAN (R 4.0.2)
## cachem 1.0.5 2021-05-15 [1] CRAN (R 4.0.2)
## callr 3.7.0 2021-04-20 [1] CRAN (R 4.0.2)
## cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.2)
## cli 3.0.0 2021-06-30 [1] CRAN (R 4.0.2)
## colorspace 2.0-2 2021-06-24 [1] CRAN (R 4.0.2)
## cowplot * 1.1.1 2020-12-30 [1] CRAN (R 4.0.2)
## crayon 1.4.1 2021-02-08 [1] CRAN (R 4.0.2)
## DBI 1.1.1 2021-01-15 [1] CRAN (R 4.0.2)
## dbplyr 2.1.1 2021-04-06 [1] CRAN (R 4.0.2)
## desc 1.3.0 2021-03-05 [1] CRAN (R 4.0.2)
## devtools 2.4.2 2021-06-07 [1] CRAN (R 4.0.2)
## digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.2)
## dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.0.2)
## ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.0.2)
## evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.1)
## fansi 0.5.0 2021-05-25 [1] CRAN (R 4.0.3)
## farver 2.1.0 2021-02-28 [1] CRAN (R 4.0.2)
## fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.2)
## forcats * 0.5.1 2021-01-27 [1] CRAN (R 4.0.3)
## fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2)
## generics 0.1.0 2020-10-31 [1] CRAN (R 4.0.2)
## ggplot2 * 3.3.5 2021-06-25 [1] CRAN (R 4.0.2)
## glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2)
## gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.2)
## haven 2.4.1 2021-04-23 [1] CRAN (R 4.0.2)
## highr 0.9 2021-04-16 [1] CRAN (R 4.0.2)
## hms 1.1.0 2021-05-17 [1] CRAN (R 4.0.2)
## htmltools 0.5.1.1 2021-01-22 [1] CRAN (R 4.0.2)
## httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.2)
## jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.0.3)
## jsonlite 1.7.2 2020-12-09 [1] CRAN (R 4.0.2)
## knitr 1.33 2021-04-24 [1] CRAN (R 4.0.2)
## labeling 0.4.2 2020-10-20 [1] CRAN (R 4.0.2)
## lattice 0.20-44 2021-05-02 [1] CRAN (R 4.0.2)
## lifecycle 1.0.0 2021-02-15 [1] CRAN (R 4.0.2)
## lme4 * 1.1-27.1 2021-06-22 [1] CRAN (R 4.0.2)
## lmerTest * 3.1-3 2020-10-23 [1] CRAN (R 4.0.2)
## lubridate 1.7.10 2021-02-26 [1] CRAN (R 4.0.2)
## magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.2)
## MASS 7.3-54 2021-05-03 [1] CRAN (R 4.0.2)
## Matrix * 1.3-4 2021-06-01 [1] CRAN (R 4.0.2)
## memoise 2.0.0 2021-01-26 [1] CRAN (R 4.0.2)
## mgcv 1.8-36 2021-06-01 [1] CRAN (R 4.0.2)
## minqa 1.2.4 2014-10-09 [1] CRAN (R 4.0.2)
## modelr 0.1.8 2020-05-19 [1] CRAN (R 4.0.2)
## munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.2)
## nlme 3.1-152 2021-02-04 [1] CRAN (R 4.0.2)
## nloptr 1.2.2.2 2020-07-02 [1] CRAN (R 4.0.2)
## numDeriv 2016.8-1.1 2019-06-06 [1] CRAN (R 4.0.2)
## pillar 1.6.1 2021-05-16 [1] CRAN (R 4.0.2)
## pkgbuild 1.2.0 2020-12-15 [1] CRAN (R 4.0.3)
## pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2)
## pkgload 1.2.1 2021-04-06 [1] CRAN (R 4.0.2)
## prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.2)
## processx 3.5.2 2021-04-30 [1] CRAN (R 4.0.2)
## ps 1.6.0 2021-02-28 [1] CRAN (R 4.0.2)
## purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.0.2)
## R6 2.5.0 2020-10-28 [1] CRAN (R 4.0.2)
## Rcpp 1.0.7 2021-07-07 [1] CRAN (R 4.0.3)
## readr * 1.4.0 2020-10-05 [1] CRAN (R 4.0.2)
## readxl 1.3.1 2019-03-13 [1] CRAN (R 4.0.2)
## remotes 2.4.0 2021-06-02 [1] CRAN (R 4.0.2)
## reprex 2.0.0 2021-04-02 [1] CRAN (R 4.0.2)
## rlang 0.4.11 2021-04-30 [1] CRAN (R 4.0.2)
## rmarkdown 2.9 2021-06-15 [1] CRAN (R 4.0.2)
## rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.0.2)
## rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.2)
## rvest 1.0.0 2021-03-09 [1] CRAN (R 4.0.3)
## sass 0.4.0 2021-05-12 [1] CRAN (R 4.0.2)
## scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.2)
## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.2)
## stringi 1.6.2 2021-05-17 [1] CRAN (R 4.0.2)
## stringr * 1.4.0 2019-02-10 [1] CRAN (R 4.0.2)
## testthat 3.0.4 2021-07-01 [1] CRAN (R 4.0.2)
## tibble * 3.1.2 2021-05-16 [1] CRAN (R 4.0.2)
## tidyr * 1.1.3 2021-03-03 [1] CRAN (R 4.0.2)
## tidyselect 1.1.1 2021-04-30 [1] CRAN (R 4.0.2)
## tidyverse * 1.3.1 2021-04-15 [1] CRAN (R 4.0.2)
## usethis 2.0.1 2021-02-10 [1] CRAN (R 4.0.2)
## utf8 1.2.1 2021-03-12 [1] CRAN (R 4.0.3)
## vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.0.2)
## withr 2.4.2 2021-04-18 [1] CRAN (R 4.0.2)
## xfun 0.24 2021-06-15 [1] CRAN (R 4.0.2)
## xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.2)
## yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.2)
##
## [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library