全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4194 2
2010-09-27
如题,比如模型是y=a1x1+a2X2+a3x3+u,限制是a1=a2,这个回归的命令是什么呢?
谢谢了...
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2010-9-27 12:41:32
[R] cnsreg -- Constrained linear regression


Syntax

        cnsreg depvar indepvars [if] [in] [weight] , constraints(constraints) [options]

    options                       description
    ---------------------------------------------------------------------------------------------------------------
    Model
    * constraints(constraints)    apply specified linear constraints
      noconstant                  suppress constant term

    SE/Robust
      vce(vcetype)                vcetype may be ols, robust, cluster clustvar, bootstrap, or jackknife

    Reporting
      level(#)                    set confidence level; default is level(95)
      nocnsreport                 do not display constraints
      display_options             control spacing and display of omitted variables and base and empty cells

    + mse1                        force MSE to 1
    + coeflegend                  display coefficients' legend instead of coefficient table
    ---------------------------------------------------------------------------------------------------------------
    * constraints(constraints) is required.
    + mse1 and coeflegend do not appear in the dialog box.
    indepvars may contain factor variables; see fvvarlist.
    depvar and indepvars may contain time-series operators; see tsvarlist.
    bootstrap, by, jackknife, mi estimate, rolling, statsby, and svy are allowed; see prefix.
    vce(bootstrap) and vce(jackknife) are not allowed with the mi estimate prefix.
    Weights are not allowed with the bootstrap prefix.
    aweights are not allowed with the jackknife prefix.
    vce(), mse1, and weights are not allowed with the svy prefix.
    aweights, fweights, pweights, and iweights are allowed; see weight.
    See [R] cnsreg postestimation for features available after estimation.


Menu

    Statistics > Linear models and related > Constrained linear regression


Description

    cnsreg fits constrained linear regression models.  cnsreg typed without arguments redisplays the previous
    cnsreg results.


Options

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

    constraints(constraints), noconstant; see [R] estimation options.

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

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

        vce(ols), the default, uses the standard variance estimator for ordinary least-squares regression.

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

    level(#); see [R] estimation options.

    nocnsreport; see [R] estimation options.

    display_options:  noomitted, vsquish, noemptycells, baselevels, allbaselevels; see [R] estimation options.

    The following options are available with cnsreg but are not shown in the dialog box:

    mse1 is used only in programs and ado-files that use cnsreg to fit models other than constrained linear
        regression.  mse1 sets the mean squared error to 1, thus forcing the variance-covariance matrix of the
        estimators to be (X'DX)^-1 (see Methods and formulas in [R] regress) and affecting calculated standard
        errors.  Degrees of freedom for t statistics are calculated as n rather than n-p+c, where p is the total
        number of parameters (prior to restrictions and including the constant) and c is the number of constraints.

        mse1 is not allowed with the svy prefix.

    coeflegend; see [R] estimation options.


Examples

    . sysuse auto
    . constraint 1 price = weight
    . cnsreg mpg price weight, constraints(1)

    . constraint 2 displ = weight
    . constraint 3 gear_ratio = -foreign
    . cnsreg mpg price weight displ gear_ratio foreign length, c(1-3)

    . constraint 99 _cons = 0
    . cnsreg mpg price weight displ gear_ratio foreign length, c(1-3,99)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-9-27 15:57:37
版主,这个好像只是截面数据或者时序数据,那面板数据时用什么命令?怎么处理
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群