Learn R Programming

rewie (version 0.1.0)

ICC: Computes intraclass correlation coefficient (ICC)

Description

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

Usage

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

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.

%% ~Describe the value returned %% If it is a LIST, use %% \item{comp1 }{Description of 'comp1'} %% \item{comp2 }{Description of 'comp2'} %% ...

Details

Calculates ICC foreach level of variation.

Examples

Run this code
# NOT RUN {
library(plm)
library(lme4)


##not run
data("Crime")


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


# }

Run the code above in your browser using DataLab