predict.panelAR: Predict method for fitted objects of class '"panelAR"'.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/predict.panelAR.R

Description

Predicted values from Prais-Winsten regression.

Usage

1
2
3
## S3 method for class 'panelAR'
predict(object,newdata=NULL,se.fit = FALSE,
      conf.interval = FALSE, conf.level = 0.95, na.action=na.pass,...)

Arguments

object

an object of class "panelAR".

newdata

an optional data frame used for prediction. If omitted, the fitted values are used.

se.fit

logical. If TRUE, standard errors of predicted values are reported. Default: FALSE.

conf.interval

logical. If TRUE, a confidence interval for predicted values is returned. Default: FALSE.

conf.level

A number in the range (0,1) denoting the confidence level. Default: 0.95.

na.action

function denoting how to handle missing values in newdata. See predict.lm for details. Default: na.pass, which predicts NA values.

...

further arguments passed to or from other methods.

Value

fit

either a vector or a data frame containing the fitted values, as well as standard errors and/or intervals (if specified). If se.fit="TRUE", se.fit column provides the standard errors. If interval is set, lb and ub provide the lower and upper bounds of the interval, respectively.

df

degrees of freedom.

Author(s)

Konstantin Kashin kkashin@fas.harvard.edu

See Also

The function panelAR.

See predict.lm and napredict for additional details.

Examples

1
2
3
4
5
6
7
data(Rehm)
out <- panelAR(NURR ~ gini, data=Rehm, panelVar='ccode', timeVar='year', autoCorr='ar1', 
panelCorrMethod='pcse', rho.na.rm=TRUE, panel.weight='t-1', bound.rho=TRUE)
summary(out)

# fitted values (with SE and CI)
predict(out, se.fit=TRUE, conf.interval=TRUE)

Example output

Panel-specific correlations bounded to [-1,1]

Panel Regression with AR(1) Prais-Winsten correction and panel-corrected standard errors

Unbalanced Panel Design:                                             
 Total obs.:       75 Avg obs. per panel 3.75
 Number of panels: 20 Max obs. per panel 4   
 Number of times:  4  Min obs. per panel 1   

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  94.2887     9.6489   9.772 6.75e-15 ***
gini         -1.2134     0.3652  -3.322   0.0014 ** 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

R-squared: 0.8319
Wald statistic: 11.0372, Pr(>Chisq(1)): 9e-04
$fit
        fit        se       lb       ub
68 60.36728 0.7616628 58.84929 61.88527
69 61.92821 0.5109242 60.90994 62.94648
70 60.20905 0.7981990 58.61824 61.79986
71 58.32543 1.2899736 55.75452 60.89635
38 61.56198 0.5443038 60.47719 62.64678
39 61.70639 0.5286547 60.65278 62.76000
40 66.87043 1.4706202 63.93948 69.80137
41 68.34179 1.8931127 64.56882 72.11476
18 56.67940 1.7572163 53.17727 60.18153
19 59.59881 0.9483705 57.70871 61.48891
20 59.08853 1.0819136 56.93228 61.24478
21 63.07510 0.5549498 61.96909 64.18112
5  66.33817 1.3210819 63.70526 68.97109
6  67.61404 1.6828321 64.26016 70.96791
7  67.60532 1.6803285 64.25643 70.95421
8  66.36361 1.3281710 63.71657 69.01065
62 65.67735 1.1394639 63.40640 67.94829
63 68.45400 1.9257089 64.61607 72.29193
64 71.17488 2.7249149 65.74413 76.60562
65 69.06518 2.1039070 64.87210 73.25826
50 63.63655 0.6464076 62.34826 64.92484
51 63.82385 0.6835219 62.46159 65.18611
52 65.89868 1.1996845 63.50772 68.28965
53 63.40967 0.6054458 62.20301 64.61632
34 63.95644 0.7113273 62.53876 65.37411
35 63.95443 0.7108979 62.53761 65.37125
36 65.12903 0.9938087 63.14838 67.10969
37 63.01000 0.5467397 61.92035 64.09965
46 55.49935 2.1001626 51.31373 59.68496
47 52.17629 3.0808631 46.03613 58.31644
48 53.34394 2.7346512 47.89379 58.79409
49 58.69862 1.1872273 56.33248 61.06476
66 62.16354 0.5012349 61.16458 63.16250
67 55.11641 2.2122829 50.70733 59.52548
13 51.89029 3.1658370 45.58079 58.19980
14 48.93872 4.0455490 40.87596 57.00149
15 56.15795 1.9082085 52.35489 59.96100
16 52.89522 2.8675480 47.18020 58.61023
42 56.80857 1.7199798 53.38065 60.23648
43 56.47988 1.8148701 52.86285 60.09691
44 56.30780 1.8647167 52.59142 60.02417
45 54.75028 2.3197712 50.12698 59.37357
58 60.51041 0.7297174 59.05608 61.96473
59 67.79605 1.7352193 64.33776 71.25433
60 69.25753 2.1601887 64.95228 73.56278
61 63.34649 0.5949335 62.16078 64.53219
17 66.14220 1.2666804 63.61771 68.66669
72 62.10726 0.5026617 61.10546 63.10907
73 61.67835 0.5314513 60.61917 62.73753
74 60.44500 0.7441764 58.96186 61.92814
75 59.33263 1.0173253 57.30510 61.36016
30 68.11131 1.8262943 64.47152 71.75111
31 73.36648 3.3755624 66.63900 80.09397
32 72.82403 3.2141746 66.41819 79.22987
33 73.65820 3.4624267 66.75760 80.55881
26 57.66576 1.4750186 54.72605 60.60547
27 59.21907 1.0472259 57.13196 61.30619
28 59.52606 0.9670461 57.59874 61.45338
29 60.56669 0.7174735 59.13677 61.99661
54 66.17294 1.2751864 63.63150 68.71438
55 70.21019 2.4400548 65.34717 75.07321
56 65.75122 1.1594862 63.44037 68.06208
57 66.34046 1.3217203 63.70628 68.97465
22 64.06155 0.7341657 62.59836 65.52475
23 71.30810 2.7643460 65.79877 76.81744
24 76.05122 4.1764756 67.72752 84.37492
25 72.25072 3.0438267 66.18438 78.31706
9  58.34682 1.2840403 55.78774 60.90591
10 64.08759 0.7399229 62.61293 65.56226
11 66.01586 1.2318308 63.56082 68.47089
12 63.12312 0.5613669 62.00432 64.24192
1  59.48625 0.9773228 57.53845 61.43405
2  63.11870 0.5607640 62.00110 64.23630
3  64.38054 0.8071157 62.77196 65.98912
4  64.90374 0.9358285 63.03864 66.76884

$df
[1] 73

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