run.analysis: Run Analysis for Panel Data

Description Usage Arguments Value Author(s) See Also Examples

View source: R/run.analysis.R

Description

Provides a run analysis within each panel. Calculates number of runs per panel and returns start time, end time, and the length of each run.

Usage

1
run.analysis(object)

Arguments

object

an object of class "panelAR".

Value

The output of the function is an object of class "panelAR.runs".

run.count

a named vector indicating the number of runs per panel.

runs

a data frame, with each row corresponding to a run in the data. Panels with multiple runs appear in multiple rows. The data frame contains the start time of the run, the end time of the run, and the length of the run.

rho

autocorrelation parameters. Scalar if "ar1" option was used, vector of length N_p (number of panels) if "psar1" option was used, and NULL if "none" option was used.

Author(s)

Konstantin Kashin [email protected]rvard.edu

See Also

The function panelAR.

Examples

1
2
3
4
5
6
7
8
9
data(WhittenWilliams)
# expect warning urging to use 'complete.case=FALSE'
out <- panelAR(milex_gdp~lag_milex_gdp+GOV_rl+gthreat+GOV_min+GOV_npty+election_yr+
lag_real_GDP_gr+cinclag+lag_alliance+lag_cinc_ratio+lag_us_change_milex_gdp, 
data=WhittenWilliams, panelVar="ccode", timeVar="year", autoCorr="psar1", 
panelCorrMethod="pcse", complete.case=TRUE)

run.analysis(out) # overview
run.analysis(out)$runs # details of each run

Example output

The following units have non-consecutive observations. Use runs.analysis() on output for additional details: 235.
Warning message:
The number of time periods used for the calculation of correlated SEs / PCSEs (18) is less than half the average number of time periods per panel (40.84). Consider setting complete.case=FALSE. 
Calculation of autocorrelation coefficient restarted for each run for the following panels: 235

Run Counts:
 Unit Runs
   20    1
  200    1
  205    1
  210    1
  211    1
  220    1
  225    1
  230    1
  235    2
  305    1
  325    1
  350    1
  375    1
  380    1
  385    1
  390    1
  640    1
  900    1
  920    1
    Start  End Length
20   1952 1997     46
200  1952 1997     46
205  1952 1997     46
210  1952 1996     45
211  1954 1995     42
220  1952 1997     46
225  1952 1995     44
230  1977 1996     20
235  1976 1978      3
235  1980 1995     16
305  1957 1995     39
325  1952 1996     45
350  1974 1996     23
375  1952 1995     44
380  1953 1997     45
385  1952 1997     46
390  1952 1996     45
640  1952 1995     44
900  1952 1997     46
920  1952 1996     45

panelAR documentation built on May 1, 2019, 8:19 p.m.