楼主: ccpoo
7609 6

[求助]请教如何编写Ordered probit model 的sas程序? [推广有奖]

  • 0关注
  • 16粉丝

少林寺小沙弥

副教授

31%

还不是VIP/贵宾

-

威望
0
论坛币
347314 个
通用积分
1348.4303
学术水平
40 点
热心指数
64 点
信用等级
41 点
经验
15644 点
帖子
617
精华
0
在线时间
480 小时
注册时间
2006-9-26
最后登录
2024-4-27

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
在看蔡瑞胸教授的Analysis of Financial Time Series的Ordered probit model的时候,很好奇他是怎么编写程序得到模型参数的极大似然估计的,哪位能指点一下吗?Thanks!
二维码

扫码加我 拉你入群

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

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

关键词:ordered Probit Order sas程序 model 程序 SAS Probit model ordered

本帖被以下文库推荐

沙发
ccpoo 发表于 2008-7-16 20:21:00 |只看作者 |坛友微信交流群

听说用stata软件也可以做,哪位能推荐一本有详细例子的书吗?thanks

使用道具

藤椅
hanszhu 发表于 2008-7-16 23:47:00 |只看作者 |坛友微信交流群

*SAS Ordered Probit Regression in PROC LOGISTIC

data cheese;
  input x1 x2 x3 y f;
  cards;
  1    0    0    1    0
  1    0    0    2    0
  1    0    0    3    1
  1    0    0    4    7
  1    0    0    5    8
  1    0    0    6    8
  1    0    0    7   19
  1    0    0    8    8
  1    0    0    9    1
  0    1    0    1    6
  0    1    0    2    9
  0    1    0    3   12
  0    1    0    4   11
  0    1    0    5    7
  0    1    0    6    6
  0    1    0    7    1
  0    1    0    8    0
  0    1    0    9    0
  0    0    1    1    1
  0    0    1    2    1
  0    0    1    3    6
  0    0    1    4    8
  0    0    1    5   23
  0    0    1    6    7
  0    0    1    7    5
  0    0    1    8    1
  0    0    1    9    0
  0    0    0    1    0
  0    0    0    2    0
  0    0    0    3    0
  0    0    0    4    1
  0    0    0    5    3
  0    0    0    6    7
  0    0    0    7   14
  0    0    0    8   16
  0    0    0    9   11
  ;

 proc logistic data=cheese;
  freq f;
  model y=x1-x3 / link=normit;
  run;

[此贴子已经被作者于2008-7-16 23:50:02编辑过]

使用道具

板凳
hanszhu 发表于 2008-7-16 23:47:00 |只看作者 |坛友微信交流群

You can use the SAS PROC PROBIT to fit an ordered probit model:

  proc probit data=cheese2; class y; model y = x1-x3; run; 

[此贴子已经被作者于2008-7-16 23:48:12编辑过]

使用道具

报纸
hanszhu 发表于 2008-7-16 23:49:00 |只看作者 |坛友微信交流群

Predicted probability computation can be easily obtained using:

 proc probit data=cheese2; class y; model y = x1-x3; output out=prob2 prob=phat; run; proc print data=prob2; run; 

使用道具

地板
ccpoo 发表于 2008-7-18 19:06:00 |只看作者 |坛友微信交流群
以下是引用hanszhu在2008-7-16 23:49:00的发言:

Predicted probability computation can be easily obtained using:

  proc probit data=cheese2;
  class y;
  model y = x1-x3;
  output out=prob2 prob=phat;
  run;
  proc print data=prob2;
  run;

Thanks。但是我这里说的ordered probit model里的因变量y是无法直接观测到的。

请参见pdf文件里page 118-221,我是想知道page 221里的table 5.4的参数怎么样用程序算出来?Thanks

228565.pdf (418.25 KB)

使用道具

7
蓝色 发表于 2008-7-19 08:10:00 |只看作者 |坛友微信交流群

stata里面有oprobit命令

help oprobit                                                                        dialogs:  oprobit  svy: oprobit
                                                                                   also see:  oprobit postestimation
--------------------------------------------------------------------------------------------------------------------

Title

    [R] oprobit -- Ordered probit regression


Syntax

        oprobit depvar [indepvars] [if] [in] [weight] [, options]

    options               description
    --------------------------------------------------------------------------------------------------------------
    Model
      offset(varname)     include varname in model with coefficient constrained to 1

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

    Reporting
      level(#)            set confidence level; default is level(95)

    Max option
      maximize_options    control the maximization process; seldom used
    --------------------------------------------------------------------------------------------------------------
    bootstrap, by, jackknife, nestreg, rolling, statsby, stepwise, svy, and xi are allowed; see prefix.
    Weights are not allowed with the bootstrap prefix.
    vce() and weights are not allowed with the svy prefix.
    fweights, iweights, and pweights are allowed; see weight.
    See [R] oprobit postestimation for features available after estimation.


Description

    oprobit fits ordered probit models of ordinal variable depvar on the independent variables indepvars.  The
    actual values taken on by the dependent variable are irrelevant, except that larger values are assumed to
    correspond to "higher" outcomes.  Up to 50 outcomes are allowed in Stata/MP, Stata/SE, and Stata/IC, and up to
    20 outcomes in Small Stata.

    See logistic estimation commands for a list of related estimation commands.


Options

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

    offset(varname); 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.

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

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

        +-------------+
    ----+ Max options +-------------------------------------------------------------------------------------------

    maximize_options:  iterate(#), [no]log, trace, tolerance(#), ltolerance(#), nrtolerance(#), nonrtolerance; see
        >  [R] maximize.  These options are seldom used.


Example

    ----------------------------------------------------------------------------------------------------------------
    Setup
        . webuse fullauto

    Ordered probit regression
        . oprobit rep77 foreign length mpg

    ----------------------------------------------------------------------------------------------------------------
    Setup
        . webuse nhanes2f
        . svyset psuid [pw=finalwgt], strata(stratid)

    Ordered probit regression using survey data
        . svy: oprobit health female black age age2
    ----------------------------------------------------------------------------------------------------------------


Saved Results

    oprobit saves the following in e():

    Scalars  
      e(N)           number of observations
      e(k_cat)       number of categories
      e(N_cd)        number of completely determined observations
      e(k_eq)        number of equations in e(b)
      e(k_aux)       number of auxiliary parameters
      e(df_m)        model degrees of freedom
      e(r2_p)        pseudo-R-squared
      e(ll)          log likelihood
      e(ll_0)        log likelihood, constant-only model
      e(N_clust)     number of clusters
      e(chi2)        chi-squared
      e(converged)   1 if converged, 0 otherwise

    Macros   
      e(cmd)         oprobit
      e(cmdline)     command as typed
      e(depvar)      name of dependent variable
      e(wtype)       weight type
      e(wexp)        weight expression
      e(title)       title in estimation output
      e(clustvar)    name of cluster variable
      e(offset)      offset
      e(chi2type)    Wald or LR; type of model chi-squared test
      e(crittype)    optimization criterion
      e(vce)         vcetype specified in vce()
      e(vcetype)     title used to label Std. Err.
      e(predict)     program used to implement predict
      e(properties)  b V

    Matrices 
      e(b)           coefficient vector
      e(cat)         category values
      e(V)           variance-covariance matrix of the estimators

    Functions
      e(sample)      marks estimation sample


Also see

    Manual:  [R] oprobit

    Online:  [R] oprobit postestimation;
             [R] logistic, [R] mlogit, [R] mprobit, [R] ologit, [R] probit, [SVY] svy estimation

已有 1 人评分经验 论坛币 收起 理由
胖胖小龟宝 + 10 + 10 热心帮助其他会员

总评分: 经验 + 10  论坛币 + 10   查看全部评分

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 07:26