rewie_rsq: Computes R-squared for RE panel models

Description Usage Arguments Details Value Author(s) Examples

Description

Calculates R-squared for BW, REWE, REWIE, and BW. Includes idiosyncratic R-squared, between R-squared, homogneous-within R-squared, and within R-Squared.

Usage

1
  rewie.rsq(model,timevar,csvar,df)

Arguments

model

is an lmerMod object fitted by calling the lmer() function in lme4.

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 the R-squared for each level of variation. It is calculated by computing the proportion of remaining variance to overall variance the model and then subtracting the quotient from 1.

Value

Returns the results for R-squares

Rsq.total

is the overall R-squared.

Rsq.within

is the within R-squared.

Rsq.time

is the time (homogenous-within) R-squared.

Rsq.idio

is the idiosyncratic R-squared.

Rsq.betw

is the between R-squared.

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
10
11
  
  
    require(plm)
    require(lme4)

    data("Crime")
    output<-lmer(lcrmrte~ldensity+(1|county)+(1|year),data=Crime)
    rewie.rsq(output,csvar="county",timevar="year",df=Crime)


  

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

Related to rewie_rsq in rewie...