ercomp: Estimation of the error components

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/tool_ercomp.R

Description

This function enables the estimation of the variance components of a panel model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ercomp(object, ...)

## S3 method for class 'plm'
ercomp(object, ...)

## S3 method for class 'pdata.frame'
ercomp(
  object,
  effect = c("individual", "time", "twoways", "nested"),
  method = NULL,
  models = NULL,
  dfcor = NULL,
  index = NULL,
  ...
)

## S3 method for class 'formula'
ercomp(
  object,
  data,
  effect = c("individual", "time", "twoways", "nested"),
  method = NULL,
  models = NULL,
  dfcor = NULL,
  index = NULL,
  ...
)

## S3 method for class 'ercomp'
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

object

a formula or a plm object,

...

further arguments.

effect

the effects introduced in the model, see plm() for details,

method

method of estimation for the variance components, see plm() for details,

models

the models used to estimate the variance components (an alternative to the previous argument),

dfcor

a numeric vector of length 2 indicating which degree of freedom should be used,

index

the indexes,

data

a data.frame,

x

an ercomp object,

digits

digits,

Value

An object of class "ercomp": a list containing

Author(s)

Yves Croissant

References

\insertRef

AMEM:71plm

\insertRef

NERLO:71plm

\insertRef

SWAM:AROR:72plm

\insertRef

WALL:HUSS:69plm

See Also

plm() where the estimates of the variance components are used if a random effects model is estimated

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data("Produc", package = "plm")
# an example of the formula method
ercomp(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc,
       method = "walhus", effect = "time")
# same with the plm method
z <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
         data = Produc, random.method = "walhus",
         effect = "time", model = "random")
ercomp(z)
# a two-ways model
ercomp(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc,
       method = "amemiya", effect = "twoways")

plm documentation built on Sept. 21, 2021, 3:01 p.m.