I am a beginner using R. I use the package "lmer" and write the code to do multilevel analysis in R below. But, there is no result of variance which should be shown up. How should I revise it? Thank you.
model_0 <- lmer
( medicine ~ 1 + (1 | community), data=df, REML = FALSE)
[code]
write.csv(df,"df.csv")
df <- read.csv("df.csv", header = T, sep = ",", as.is = T, na.strings=".")
library(dplyr)
library(tableone)
library(lme4)
#outcome: medicine
##Model_0 null
model_0 <- `lmer`( medicine ~ 1 + (1 | community), data=df, REML = FALSE)
summary(model0)
[Result]
Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: medicine ~ 1 + (1 | community)
Data: df
AIC BIC logLik deviance df.resid
2400.0 2407.8 -1197.0 2394.0 97
Scaled residuals:
Min 1Q Median 3Q Max
-2.4732 -0.5024 -0.1183 0.5035 2.5060
Random effects:
Groups Name Variance Std.Dev.
community (Intercept) 9.020e+08 30033
Residual 1.109e+09 33300
Number of obs: 100, groups: community, 20
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 388914.00 8100.66 19.85 48.01 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1