ICC {rewie} | R Documentation |
Calculates the ICC for the idiosyncratic, within, and between variation. Calculates the ICC for total variation and for within variation.
ICC(y,timevar,csvar,df)
y |
is the name of the response vector provided as a character string. |
timevar |
is a character string providing the name of the time indicator variable. |
csvar |
is a character string providing the name of the cross-section indicator variable. |
df |
is a dataframe containing y, timevar, and csvar |
Calculates ICC foreach level of variation.
Returns the ICC results in a list.
ICC.mat |
is the matrix of ICCs and variance components for each level of variation. |
within.ICC.mat |
is the matrix of ICCs and variance components only examining the within variation. |
Scott Duxbury, Assistant Professor of Sociology at University of North Carolina, Chapel Hill
library(plm)
library(lme4)
##not run
data("Crime")
ICC("lcrmrte",csvar="county", timevar="year",Crime)