ICC: Computes intraclass correlation coefficient (ICC)

Description Usage Arguments Details Value Author(s) Examples

View source: R/ICC.R

Description

Calculates the ICC for the idiosyncratic, within, and between variation. Calculates the ICC for total variation and for within variation.

Usage

1
ICC(y,timevar,csvar,df)

Arguments

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

Details

Calculates ICC foreach level of variation.

Value

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.

Author(s)

Scott Duxbury, Assistant Professor of Sociology at University of North Carolina, Chapel Hill

Examples

1
2
3
4
5
6
7
8
9
library(plm)
library(lme4)


##not run
data("Crime")


ICC("lcrmrte",csvar="county", timevar="year",Crime)

rewie documentation built on July 1, 2020, 6:53 p.m.

Related to ICC in rewie...