楼主: shaoqinglong11
3006 7

[编程问题求助] 求PVAR模型的STATA命令 [推广有奖]

已卖:631份资源

院士

51%

还不是VIP/贵宾

-

威望
3
论坛币
12100 个
通用积分
189.1728
学术水平
323 点
热心指数
357 点
信用等级
246 点
经验
84742 点
帖子
2571
精华
1
在线时间
2575 小时
注册时间
2013-8-21
最后登录
2025-7-15

楼主
shaoqinglong11 发表于 2019-9-14 16:41:58 |AI写论文
100论坛币
求PVAR模型的stata命令,先给100金币,其余的可以再商议。多谢!

关键词:stata命令 Stata VAR模型 AR模型 PVaR

沙发
黃河泉 在职认证  发表于 2019-9-14 16:50:57
  1. search pvar
复制代码
并安装 (或 net install st0455)。

藤椅
shaoqinglong11 发表于 2019-9-14 16:51:53
黃河泉 发表于 2019-9-14 16:50
请并安装 (或 net install st0455)。
有具体的STATA命令吗?

板凳
xujingjun 发表于 2019-9-14 16:52:13

报纸
蓝色 发表于 2019-9-14 17:19:39
安装完pvar就有例子
看帮助就可以了



help pvar
----------------------------------------------------------------------------------------------

Title

    pvar -- Panel vector autoregressive models


Syntax

        pvar depvarlist [if] [in] [, options]

    options                       Description
    ----------------------------------------------------------------------------------------
    Model
      lags(#)                     use first # lags in the underlying pVAR; default is
                                    lags(1)
      exog(varlist)               use time-varying exogenous variables in varlist
      *fod                        use Helmert transformation to remove panel-specific fixed
                                    effects; the default
      *fd                         use first difference to remove panel-specific fixed
                                    effects

    Model 2
      td                          remove cross-sectional mean from each variable in
                                    depvarlist and in varlist if specified
      instlags(numlist)           specify lag orders of depvarlist to be used as instruments
      gmmstyle                    use "GMM-style" instruments; may only be used with
                                    instlags()
      gmmopts(options)            override the default GMM options

    SE/Robust
      vce(vcetype[, independent]) vcetype may be robust, cluster clustervar, bootstrap,
                                    jackknife, hac kernel lags or unadjusted; default is
                                    vce(unadjusted)

    Reporting
      overid                      report Hansen's J statistic of overidentying restrictions
      level(#)                    set confidence level; default is level(95)
      noprint                     do not display coefficient table
    ----------------------------------------------------------------------------------------
    You must xtset your data before using pvar; see [XT] xtset.


Description

    pvar fits a multivariate panel regression of each dependent variable on lags of itself
    and on lags of all other dependent variables using generalized method of moments (GMM).
    pvar also fits a variant of panel vector autoregressive models (pVAR) known as pVARX,
    which also includes exogenous explanatory variables. See [R] gmm for GMM estimation
    option details.


Options

        +-------+
    ----+ Model +---------------------------------------------------------------------------

    lags(#) specifies the maximum lag order # to be included in the model.  The default is
        to use the first lag of each variable in depvarlist.

    exog(varlist) specifies a list of exogenous variables to be included in the pVAR.

    fod specifies that the panel-specific fixed effects be removed using forward orthogonal
        deviation or Helmert transformation. By default, the first # lags of depvarlist in
        the model are instrumented by the same lags. This is the default option.

    fd specifies that the panel-specific fixed effects be removed using first difference
        instead of forward orthogonal deviations. By default, the first # lags of depvarlist
        in the model are instrumented by the #+1 to 2#+1 lags of depvarlist.

        +---------+
    ----+ Model 2 +-------------------------------------------------------------------------

    td specifies that the cross-sectional mean be removed by differencing from each series.

    instlags(numlist) overrides the default lag orders of depvarlist used as instruments in
        the model. Instead the numlist-th lags are used as instruments.

    gmmstyle specifies that "GMM-style" instruments as proposed by Holtz-Eakin, Newey and
        Rosen (1988) be used. For each instrument based on lags of depvarlist, missing
        values are substituted with zero. Observations with no valid instruments are
        excluded.

    gmmopts(options) overrides the default pvar options. Equations in the model are named
        using each variable in depvarlist. See [R] gmm for options.

        +-----------+
    ----+ SE/Robust +-----------------------------------------------------------------------

    vce(vcetype[, independent]) specifies the type of standard error reported, which
        includes types that are robust to some types of misspecification, that allow for
        intragroup correlation, and that use bootstrap or jackknife methods; see [R]
        vce_option.

        +-----------+
    ----+ Reporting +-----------------------------------------------------------------------

    overid specifies that Hansen's J statistic of overidentifying restriction be reported.
        This option is available only for over-identified systems.

    level(#); see [R] estimation_options.

    noprint suppresses printing of the coefficient table.


Remarks

    This version is in beta mode. No warranties whatsoever.


Examples

    Setup
        . webuse nlswork2
        . xtset idcode year
        . gen wage = exp(ln_wage)
   
    Fit panel vector autoregressive model with 1 lag by Helmert transformation (the default)
        . pvar wage hours

    Same as above but with standard errors clustered by industry-occupation
        . egen indocc = group(ind_code occ_code)
        . pvar wage hours, vce(cluster indocc)

    Same as first, but use the first three lags as instruments
        . pvar wage hours, instl(1/3)

    Same as above, but use "GMM-style" instruments
        . pvar wage hours, instl(1/3) gmms

    Same as above, but report over-identification test
        . pvar wage hours, instl(1/3) gmms overid

    Fit default pvar options using gmmopts(options)
        . pvar wage hours, gmmo(winitial(identity) wmatrix(robust) twostep vce(unadjusted))


Saved results

    pvar saves the following in e():

    Scalars        
      e(N)                number of observations
      e(n)                number of panels
      e(tmin)             first time period in sample
      e(tmax)             last time period in sample
      e(tbar)             average time periods among panels
      e(mlag)             maximum lag order in pVAR
      e(N_clust)          number of clusters
      e(Q)                criterion function
      e(J)                Hansen's J chi-squared statistic
      e(J_df)             J statistic degrees of freedom
      e(rank)             rank of e(V)
      e(ic)               number of iterations used by iterative GMM estimator
      e(converged)        1 if converged, 0 otherwise

    Macros         
      e(cmd)              pvar
      e(cmdline)          command as typed
      e(depvar)           names of dependent variables
      e(exog)             names of exogenous variables, if specified
      e(clustvar)         name of cluster variable
      e(instr)            instruments
      e(eqnames)          equation names
      e(timevar)          name of time variable
      e(panelvar)         name of panel variable
      e(properties)       b V

    Matrices      
      e(b)                coefficient vector
      e(V)                Variance-covariance matrix of the estimator
      e(Sigma)            Variance-covariance matrix of the model residuals
      e(W)                weight matrix used for final round of estimation
      e(init)             initial values of the estimators

    Functions      
      e(sample)           mark estimation sample


References

    Alvarez, J. and M. Arellano (2003). The time-series and cross-section asymptotics of
        dynamic panel data estimators. Econometrica, 71(4), 1121-1159.

    Holtz-Eakin, D., W. Newey and H.S. Rosen (1988). Estimating vector autoregressions with
        panel data.  Econometrica, 56(6), 1371-1395.


Also see
      Help:  pvarirf, pvarfevd, pvargranger, pvarsoc, pvarstable

地板
蓝色 发表于 2019-9-14 17:20:37
你安装好,然后看pvar的帮助里面就有命令格式和例子
help  pvar

7
黃河泉 在职认证  发表于 2019-9-14 17:58:27
shaoqinglong11 发表于 2019-9-14 16:51
有具体的STATA命令吗?
除了蓝色版主之建议外,也请看看 https://www.stata-journal.com/article.html?article=st0455

8
L-Sofia 发表于 2019-9-14 20:25:31
连享会-空间计量专题研讨-电子科技大学
https://gitee.com/arlionn/Course/blob/master/2019Spatial.md

连享会-内生性专题研讨-南京财经大学
https://gitee.com/arlionn/Course/blob/master/Done/2019Endog.md

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-5 21:42