levpet算出的TFP显示器多大尺寸合适合适

苹果/安卓/wp
积分 134, 距离下一级还需 11 积分
权限: 自定义头衔
道具: 彩虹炫, 雷达卡, 热点灯, 雷鸣之声, 涂鸦板, 金钱卡, 显身卡下一级可获得
道具: 匿名卡
购买后可立即获得
权限: 隐身
道具: 金钱卡, 雷鸣之声, 彩虹炫, 雷达卡, 涂鸦板, 热点灯
悲催签到天数: 6 天连续签到: 1 天[LV.2]偶尔看看I
看到其它论文用levpet命令来估计TFP,却找不到具体的代码。我的因变量数据是产出(output/revenue;不是 valueadd),自变量数据是资本、劳动力、中间产品投入、、、、想通过这些数据来估计某几个国家的TFP(全要素生产率),但是我不会这个命令,希望会的大神帮个忙呀,论文急用。
需要先下载levpet的程序包,或者
www./software/sj4-2/st0060/levpet.ado 复制粘贴再运行就可以了
支持楼主:、
购买后,论坛将把您花费的资金全部奖励给楼主,以表示您对TA发好贴的支持
载入中......
需要先下载levpet的程序包,或者
www./software/sj4-2/st0060/levpet.ado 复制粘贴再运行就可以了
help lpreg
亲,根本就找不到呀~~有具体一点的没呀
在stata里面输入 findit lpreg,就可以找到,另外在stata journal 里面也可以找到。
help levpet
王琪媛 发表于
需要先下载levpet的程序包,或者
www./software/sj4-2/st0060/levpet.ado 复制粘贴再运行 ...你好,我尝试着复制粘贴了还是不行,请问有levpet的安装包吗
本帖最后由 王琪媛 于
02:17 编辑
02:14:49 上传
售价: 1 个论坛币
王琪媛 发表于
02:15 @hdwangliyuan
@TaraGrace
自己下载一下吧,比较缺论坛币,,,理解一下咯
论坛好贴推荐
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
如有投资本站或合作意向,请联系(010-);
邮箱:service@pinggu.org
投诉或不良信息处理:(010-)
京ICP证090565号
京公网安备号
论坛法律顾问:王进律师苹果/安卓/wp
积分 60, 距离下一级还需 25 积分
道具: 彩虹炫, 雷达卡, 热点灯, 雷鸣之声, 涂鸦板, 金钱卡, 显身卡下一级可获得
权限: 自定义头衔
购买后可立即获得
权限: 隐身
道具: 金钱卡, 雷鸣之声, 彩虹炫, 雷达卡, 涂鸦板, 热点灯
表示用opreg算了TFP, 用predict得到了tfp变量,以下有几个问题想向各位大?
首先,因为我在opreg命令下用的被解释变量是lny,解释变量是lnk,lnl,是不是得到的数值应该是lntfp?
其次,我看了一下,我predict得到的新变量的数值在3-4之间这样,这个结果对吗?表示模型还蛮显著的,变量也没有多重共线性和其他问题。
谢谢大家了。
载入中......
同问,predict的时候下面就显示为(option tfp assumed),这不是就是tcp的意思了呀,为也在纠结是不是lntfp。还有我predict出来都是10--12之间,求交流,请问你现在解决这个问题了吗?是怎么个情况?
同问,我用compustat 数据根据 stata journal 上的文章“Production function estimation in Stata using
the Olley and Pakes method”对文章进行了复制,只是没有处理价格,也没有使用age这一变量。最后,predict tfp得到的数字大概在2-5之间,根据命令说明,这一值是一个对数值,水平值需要取幂。请问,这一对数值是tfp增长率吗?取幂后又如何解释?
夜殇月痕 发表于
表示用opreg算了TFP, 用predict得到了tfp变量,以下有几个问题想向各位大?
首先,因为我在opreg命令下用 ...想用stata求tfp,完全不知从哪开始,求入门资料~
论坛好贴推荐
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
如有投资本站或合作意向,请联系(010-);
邮箱:service@pinggu.org
投诉或不良信息处理:(010-)
京ICP证090565号
京公网安备号
论坛法律顾问:王进律师苹果/安卓/wp
积分 447, 距离下一级还需 3 积分
权限: 自定义头衔, 签名中使用图片
道具: 彩虹炫, 雷达卡, 热点灯, 雷鸣之声, 涂鸦板, 金钱卡, 显身卡, 匿名卡下一级可获得
道具: 抢沙发
购买后可立即获得
权限: 隐身
道具: 金钱卡, 雷鸣之声, 彩虹炫, 雷达卡, 涂鸦板, 热点灯
苦逼签到天数: 243 天连续签到: 1 天[LV.8]以坛为家I
levpet lny, free(lnl) proxy(lnm) capital (lnk) i(var1) t(year) reps(5) revenue
predict tfp, omega
用的如上语句,lny,lnl,lnm,lnk是营业收入、劳动投入、中间投入、资本投入,已经求出对数形式,var1是股票代码,用来标属面板,year是时间序列,共五年,可以计算出结果,但是最后求出的tfp很小,到了0.0000XX的地步,求问,问题到底出在哪里??!
载入中......
重新计算之后得到了我要的结果。。。但是数据从Excel复制过来的时候有一行错序了。。。调整之后还是原来的结果,TFP特别小的那个。。。。一头雾水
您好,您找到问题所在了吗,可以分享一下吗
hustchen2012 发表于
您好,您找到问题所在了吗,可以分享一下吗没有。。换了种方法。。我已经不记得了~~
楼主能否说明你的测算步骤吗?能不能用一年的数据分行业,分地区测算?还有就是你的企业年龄重复的需要删除吗?
请问楼主中间品投入时这么计算的呀~
楼主,请问你有levpet的安装包吗,求分享。感激不尽!
论坛好贴推荐
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
如有投资本站或合作意向,请联系(010-);
邮箱:service@pinggu.org
投诉或不良信息处理:(010-)
京ICP证090565号
京公网安备号
论坛法律顾问:王进律师苹果/安卓/wp
积分 556, 距离下一级还需 244 积分
权限: 自定义头衔, 签名中使用图片
道具: 彩虹炫, 雷达卡, 热点灯, 雷鸣之声, 涂鸦板, 金钱卡, 显身卡, 匿名卡, 抢沙发下一级可获得
权限: 隐身
购买后可立即获得
权限: 隐身
道具: 金钱卡, 雷鸣之声, 彩虹炫, 雷达卡, 涂鸦板, 热点灯
开心签到天数: 15 天连续签到: 1 天[LV.4]偶尔看看III
我用stata的levpet算企业的TFP, predict TFP, omega得到的结果,各企业TFP值都大于0,均值20多,最大的10000都多了。我觉得这个结果不合理,是不是我算错了?由于样本较大,reps(5),因为如果用reps(50)算不出来,时间太长。
哪位老师同学告诉我,我算的结果合理吗?万分感谢!
载入中......
哪个伟大的老师,同学帮助分析一下,谢谢
哪位帮个忙,着急!!
使用的变量经过对数化了么
fgleric 发表于
使用的变量经过对数化了么使用的变量对数化了的,用stata的levepet做的,然后用predict TFP,ogema,得到的。得到的TFP再对数化均值在2.03左右
fgleric 发表于
使用的变量经过对数化了么谢谢您的回应,TFP多大合适呢?0.8-1.8?1左右?
in stata, predict tfp command gives you &lntfp&. read the stata journal.
同问!prdict得到的到底是水平值还是对数值?如果是对数值,10000那么大肯定有点离谱了
keithkang 发表于
同问!prdict得到的到底是水平值还是对数值?如果是对数值,10000那么大肯定有点离谱了Amil Petrin et al,.(2004) 在stata journal上的文章写的很清楚,options for predict一节,omega=exp(vt-betal*lt-betak*kt)。因此predict出的omega应该是取了指数函数后的结果,并非对数求值结果。
楼主的结果肯定错了。
论坛好贴推荐
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
如有投资本站或合作意向,请联系(010-);
邮箱:service@pinggu.org
投诉或不良信息处理:(010-)
京ICP证090565号
京公网安备号
论坛法律顾问:王进律师st: Repeated time values within panel in levpet STATA output
Notice: On March 31, it was
that Statalist is moving from an email list to a .
The old list will shut down on April 23, and its replacement,
is already up and running.
[][][][][][]
st: Repeated time values within panel in levpet STATA output
Worku Gebeyehu &&
st: Repeated time values within panel in levpet STATA output
Sun, 28 Feb :10 -0800 (PST)
Dear Sir/Madam,
I am a PhD student doing my research on TFP of a panel of firms for the period 1996 to 2007 and the total number of observations are 8395. I have been trying to excute the following levpet command.
levpet lny , free(lnl2 lnirm lnlrm) proxy (lnpower) capital (lnk) revenue justid grid i (eid) t (yr) reps (50)
However, I have been facing a problem of 'repeated time values within panel'. I have not faced a similar problem while estimating the same using FE, RE, OP, etc. I also tried to check the existence of dublications of years or firm idenity numbers using the stata 'dublicate report' command, I got a report of 'surplus=0'. Using set tr on, I found the following report. Because I am unable to understand what it means due to lack of knowldge in programming, I sent you with all the junk. I am sorry for that. I am stuck and strongly need your support.
Sincerly yours,
version 10
- if `&`0'&' == && {
= if `&eid yr&' == && {
_ts tvar pvar, panel
local fmt: format `tvar'
local tsdelta : char _dta[_TSdelta]
if &`tsdelta'& == && {
local tsdelta 1
tsset `pvar' `tvar', format(`fmt') delta((`tsdelta'))
- syntax [varlist(numeric max=2 default=none)] [, CLEAR Daily Format(passthru) Generic Halfy
& early Monthly Quarterly Weekly Yearly DELta(string) Clocktime FORCE ]
- if &`clear'& != && {
= if && != && {
syntax [, CLEAR]
- if &`varlist'&==&& {
= if &eid yr&==&& {
_ts tvar pvar, panel
tsset `pvar' `tvar', `daily' `format' `generic' `halfyearly' `monthly' `quarterly' `weekly
& ' `yearly' `clocktime'
- syntax varlist(numeric max=2 default=none) [ , CLEAR Daily Format(string) Generic Halfyear
& ly Monthly Quarterly Weekly Yearly DELta(string) Clocktime FORCE ]
- local ct : word count `varlist'
= local ct : word count eid yr
- if `ct'==2 {
= if 2==2 {
- tokenize `varlist'
= tokenize eid yr
- local panel `1'
= local panel eid
- local timevar `2'
= local timevar yr
local timevar `varlist'
- local period `daily' `weekly' `monthly' `quarterly' `halfyearly' `yearly' `generic' `clock
= local period
- if `&`format'&'!=&& {
= if `&&'!=&& {
local dfltfmt &no&
if &`period'& != && {
di in red &may not specify both format() and `period'&
local try : di `format' 2
- else if &`period'& != && {
= else if && != && {
local ct : word count `period'
if `ct' & 1 {
di in red &may only specify one time-scale from & &daily, weekly, monthly, &
di in red &quarterly, halfyearly, yearly, and generic&
local curfmt : format `timevar'
local fmttype = substr(&`curfmt'&, 2, 1)
if &`fmttype'& != &d& & &`fmttype'& != &t& {
local format = &%t& + substr(&`period'&,1,1)
if substr(&`period'&, 1, 1) == &c& {
local dfltfmt &yes&
local format `curfmt'
- local format : format `timevar'
= local format : format yr
- capture assert int(`timevar')==`timevar'
= capture assert int(yr)==yr
- if _rc {
di in red &time variable must contain only integer values&
- sort `panel' `timevar'
= sort eid yr
- if &`panel'& != && {
= if &eid& != && {
- local bypfx &by `panel': &
= local bypfx &by eid: &
- if `&`format'&' != && {
= if `&%8.0g&' != && {
- format `timevar' `format'
= format yr %8.0g
- tempname scdelta
- mata: _TS_p_delta(&`scdelta'&, &`delta'&, &`timevar'&)
= mata: _TS_p_delta(&__000002&, &&, &yr&)
- if `scdelta' == -2 {
= if __000002 == -2 {
di as err &invalid time-series format on `timevar'&
- if `scdelta' == -1 {
= if __000002 == -1 {
di as err &invalid argument in delta()&
- tempvar timedif
- qui `bypfx' gen double `timedif' = `timevar'[_n+1] - `timevar'
= qui by eid:
gen double __000003 = yr[_n+1] - yr
- qui sum `timedif', meanonly
= qui sum __000003, meanonly
- if r(min) == 0 {
if &`panel'& != && {
di in red &repeated time values within panel&
di in red &repeated time values in sample&
- if &`force'& == && {
= if && == && {
- if r(min) & `scdelta' {
= if r(min) & __000002 {
di in red &time values with period less than delta() found&
-------------------------------------------------------------------- begin tsset.Clear ---
- char _dta[_TStvar]
- char _dta[_TSpanel]
- char _dta[_TSdelta]
- char _dta[_TSitrvl]
- char _dta[tis]
- char _dta[iis]
---------------------------------------------------------------------- end tsset.Clear ---
- nobreak {
- char _dta[_TStvar] &`timevar'&
= char _dta[_TStvar] &yr&
- char _dta[_TSpanel] &`panel'&
= char _dta[_TSpanel] &eid&
- char _dta[_TSdelta] `: di %21x `scdelta''
= char _dta[_TSdelta] +1.0X+000
- char _dta[_TSitrvl] 1
- char _dta[tis] &`timevar'&
= char _dta[tis] &yr&
- char _dta[iis] &`panel'&
= char _dta[iis] &eid&
- if &`dfltfmt'& == &yes& & substr(&`format'&, 3, 1) == &c& {
= if && == &yes& & substr(&%8.0g&, 3, 1) == &c& {
format `timevar' %tcDDmonCCYY_HH:MM:SS.sss
-------------------------------------------------------------------- begin tsset.Query ---
- local timevar `_dta[_TStvar]'
= local timevar yr
- local panel `_dta[_TSpanel]'
= local panel eid
- local delta : char _dta[_TSdelta]
- if &`panel'& == && {
= if &eid& == && {
qui count if `timevar' - `timevar'[_n-1] != `delta' & `timevar' != . in 2/l
local gaps = r(N)
- qui count if `timevar' - `timevar'[_n-1] != `delta' & `timevar' != . & `panel' == `panel
& '[_n-1] in 2/l
= qui count if yr - yr[_n-1] != +1.0X+000 & yr != . & eid == eid[_n-1] in 2/l
- local gaps = r(N)
- if &`panel'& == && {
= if &eid& == && {
tempvar seenvar
local t0 = `timevar'[1]
gen long `seenvar' = sum(`timevar' != .)
local t1 = `timevar'[`seenvar'[_N]]
- tempname firstob lastob
- qui gen byte `firstob' = `panel' != . & `panel' != `panel'[_n-1]
= qui gen byte __000004 = eid != . & eid != eid[_n-1]
- qui sum `timevar' if `firstob', meanonly
= qui sum yr if __000004, meanonly
- local t0 = r(min)
- qui gen byte `lastob' = `panel' != . & `timevar' != . & (`panel' != `panel'[_n+1] | `tim
& evar'[_n+1] == .)
= qui gen byte __000005 = eid != . & yr != . & (eid != eid[_n+1] | yr[_n+1] == .)
- qui sum `timevar' if `lastob', meanonly
= qui sum yr if __000005, meanonly
- local t1 = r(max)
- local npanel = r(N)
- sum `panel', meanonly
= sum eid, meanonly
- ret scalar imin = r(min)
- ret scalar imax = r(max)
- tempvar tmin tmax tcount
- qui by `panel' : gen double `tcount' = _N if !missing(`timevar')
= qui by eid : gen double __000008 = _N if !missing(yr)
- capture assert `tcount' == `tcount'[1]
= capture assert __000008 == __]
- if c(rc) {
- local bal unbalanced
CheckStrongBal `npanel' `panel' `timevar'
if r(rc) {
local bal &weakly balanced&
local bal &strongly balanced&
- di in gr _col(8) &panel variable:
& in ye &`panel' (`bal')&
= di in gr _col(8) &panel variable:
& in ye &eid (unbalanced)&
- return local balanced &`bal'&
= return local balanced &unbalanced&
- local fmt : format `timevar'
= local fmt : format yr
- local t0s = trim(string(`t0', &`fmt'&))
= local t0s = trim(string(1996, &%8.0g&))
- local t1s = trim(string(`t1', &`fmt'&))
= local t1s = trim(string(2007, &%8.0g&))
- di in gr _col(9) &time variable:
- local i 1
- local line`i' `=abbrev(&`timevar'&,13)',
= local line1 yr,
- local linelen = length(`&`line`i''&')
= local linelen = length(`&yr,&')
- if (`linelen' + length(`&`t0s'&')) & 53 {
= if (3 + length(`&1996&')) & 53 {
- local line`i' `line`i'' `t0s'
= local line1 yr, 1996
- local linelen = length(`&`line`i''&')
= local linelen = length(`&yr, 1996&')
local `++i'
local line`i' `t0s'
local linelen = length(`&`line`i''&')
- if (`linelen' + 3) & 53 {
= if (8 + 3) & 53 {
- local line`i' `&`line`i'' to&'
= local line1 `&yr, 1996 to&'
- local linelen = length(`&`line`i''&')
= local linelen = length(`&yr, 1996 to&')
local `++i'
local line`i' &to&
local linelen = 3
- if (`linelen' + length(`&`t1s'&')) & 53 {
= if (11 + length(`&2007&')) & 53 {
- local line`i' `line`i'' `t1s'
= local line1 yr, 1996 to 2007
- local linelen = length(`&`line`i''&')
= local linelen = length(`&yr, 1996 to 2007&')
local `++i'
local line`i' `t1s'
local linelen = length(`&`t1s'&')
- if `gaps' & 0 {
= if 0 & 0 {
if `gaps' == 1 {
local note &but with a gap&
local note &but with gaps&
if (`linelen' + length(`&, `note'&')) & 53 {
local line`i' `line`i'', `note'
local `++i'
local line`i' `note'
- forvalues j = 1/`i' {
= forvalues j = 1/1 {
- di in ye _col(25) `&`line`j''&'
= di in ye _col(25) `&yr, 1996 to 2007&'
- tempname fancyd
- mata:_TS_p_delta2str(&`fancyd'&, `=`delta'', &`timevar'&)
= mata:_TS_p_delta2str(&__000009&, 1, &yr&)
- di in gr _col(17) &delta:
& in ye &`=`fancyd''&
= di in gr _col(17) &delta:
& in ye &1 unit&
- ret scalar tmin = `t0'
= ret scalar tmin = 1996
- ret scalar tmax = `t1'
= ret scalar tmax = 2007
- ret scalar tdelta = `delta'
- ret scalar tdelta = `delta'
= ret scalar tdelta = +1.0X+000
- ret local tmins `t0s'
= ret local tmins 1996
- ret local tmaxs `t1s'
= ret local tmaxs 2007
- ret local tdeltas &`=`fancyd''&
= ret local tdeltas &1 unit&
---------------------------------------------------------------------- end tsset.Query ---
- if &`dfltfmt'& == &yes& & substr(&`format'&, 3, 1) == &c& {
= if && == &yes& & substr(&%8.0g&, 3, 1) == &c& {
format `timevar' %tc
- local fmt : format `timevar'
= local fmt : format yr
- return local tsfmt `fmt'
= return local tsfmt %8.0g
- return local unit1 = substr(&`fmt'&, 3, 1)
= return local unit1 = substr(&%8.0g&, 3, 1)
- Period per : &`period'& `return(unit1)'
= Period per : && .
------------------------------------------------------------------- begin tsset.Period ---
- args newper colon per unit1
- if &`per'& == && {
= if && == && {
- if &`unit1'& != && {
= if &.& != && {
- local c &clocktime&
- local g &generic&
- local d &daily&
- local w &weekly&
- local m &monthly&
- local q &quarterly&
- local h &halfyearly&
- local y &yearly&
- capture c_local `newper' ``unit1''
= capture c_local per
c_local `newper' &generic&
c_local `newper' `per'
--------------------------------------------------------------------- end tsset.Period ---
- return local unit `per'
= return local unit
- ret local timevar &`timevar'&
= ret local timevar &yr&
- ret local panelvar &`panel'&
= ret local panelvar &eid&
------------------------------------------------------------------------------ end tsset ---
- if (`level' & 10 | `level' & 99) {
= if (95 & 10 | 95 & 99) {
di as error &level must be between 10 and 99&
- if (&`revenue'& != && & &`valueadded'& != &&) {
= if (&revenue& != && & && != &&) {
di as error &Only one of revenue and valueadded can be specified.&
- if (&`revenue'& != &&) {
= if (&revenue& != &&) {
- local model &revenue&
local model &valueadded&
- local numprox : word count `proxy'
= local numprox : word count lnpower
- if (&`model'& == &revenue& & `numprox' & 1) {
= if (&revenue& == &revenue& & 1 & 1) {
di as error &Only one proxy variable can be used with revenue.&
- if (`reps' & 2) {
= if (50 & 2) {
di as error &reps() must be at least 2.&
- local just = 0
- if (&`justid'& != && & &`model'& != &revenue&) {
= if (&justid& != && & &revenue& != &revenue&) {
di as error &justid can only be used with revenue (GMM) model.&
- else if &`justid'& != && {
= else if &justid& != && {
- local just = 1
- local gsrch = 0
- if (&`grid'& != && & &`model'& != &revenue&) {
= if (&grid& != && & &revenue& != &revenue&) {
di as error &grid can only be used with revenue (GMM) model.&
- else if &`grid'& != && {
= else if &grid& != && {
- local gsrch = 1
- qui count if `touse'
= qui count if __000001
- loc capn = r(N)
- local rmacs &&
- foreach var in `free' `capital' {
= foreach var in lnl2 lnirm lnlrm lnk {
- foreach var in `free' `capital' {
- local rmacs &`rmacs' (r(`var'))&
= local rmacs & (r(lnl2))&
- local rmacs &`rmacs' (r(`var'))&
= local rmacs & (r(lnl2)) (r(lnirm))&
- local rmacs &`rmacs' (r(`var'))&
= local rmacs & (r(lnl2)) (r(lnirm)) (r(lnlrm))&
- local rmacs &`rmacs' (r(`var'))&
= local rmacs & (r(lnl2)) (r(lnirm)) (r(lnlrm)) (r(lnk))&
- if (&`model'& == &revenue&) {
= if (&revenue& == &revenue&) {
- local rmacs &`rmacs' (r(`proxy'))&
= local rmacs & (r(lnl2)) (r(lnirm)) (r(lnlrm)) (r(lnk)) (r(lnpower))&
- quietly {
- tempfile postfile datafile
- tempname post
- tempvar idvar
- gen `idvar' = `i'
= gen __000003 = eid
- preserve
- keep if `touse'
= keep if __000001
- loc cmd &`depvar' , free(`free') proxy(`proxy') capital(`capital') &
= loc cmd &lny , free(lnl2 lnirm lnlrm) proxy(lnpower) capital(lnk) &
- tsset `idvar' `t'
= tsset __000003 yr
---------------------------------------------------------------------------- begin tsset ---
- version 10
- if `&`0'&' == && {
= if `&__000003 yr&' == && {
_ts tvar pvar, panel
local fmt: format `tvar'
local tsdelta : char _dta[_TSdelta]
if &`tsdelta'& == && {
local tsdelta 1
tsset `pvar' `tvar', format(`fmt') delta((`tsdelta'))
- syntax [varlist(numeric max=2 default=none)] [, CLEAR Daily Format(passthru) Generic Halfy
& early Monthly Quarterly Weekly Yearly DELta(string) Clocktime FORCE ]
- if &`clear'& != && {
= if && != && {
syntax [, CLEAR]
- if &`varlist'&==&& {
= if &__000003 yr&==&& {
_ts tvar pvar, panel
tsset `pvar' `tvar', `daily' `format' `generic' `halfyearly' `monthly' `quarterly' `weekly
& ' `yearly' `clocktime'
- syntax varlist(numeric max=2 default=none) [ , CLEAR Daily Format(string) Generic Halfyear
& ly Monthly Quarterly Weekly Yearly DELta(string) Clocktime FORCE ]
- local ct : word count `varlist'
= local ct : word count __000003 yr
- if `ct'==2 {
= if 2==2 {
- tokenize `varlist'
= tokenize __000003 yr
- local panel `1'
= local panel __000003
- local timevar `2'
= local timevar yr
local timevar `varlist'
- local period `daily' `weekly' `monthly' `quarterly' `halfyearly' `yearly' `generic' `clock
= local period
- if `&`format'&'!=&& {
= if `&&'!=&& {
local dfltfmt &no&
if &`period'& != && {
di in red &may not specify both format() and `period'&
local try : di `format' 2
- else if &`period'& != && {
= else if && != && {
local ct : word count `period'
if `ct' & 1 {
di in red &may only specify one time-scale from & &daily, weekly, monthly, &
di in red &quarterly, halfyearly, yearly, and generic&
local curfmt : format `timevar'
local fmttype = substr(&`curfmt'&, 2, 1)
if &`fmttype'& != &d& & &`fmttype'& != &t& {
local format = &%t& + substr(&`period'&,1,1)
if substr(&`period'&, 1, 1) == &c& {
local dfltfmt &yes&
local format `curfmt'
- local format : format `timevar'
= local format : format yr
- capture assert int(`timevar')==`timevar'
= capture assert int(yr)==yr
- if _rc {
di in red &time variable must contain only integer values&
- sort `panel' `timevar'
= sort __000003 yr
- if &`panel'& != && {
= if &__000003& != && {
- local bypfx &by `panel': &
= local bypfx &by __000003: &
- if `&`format'&' != && {
= if `&%8.0g&' != && {
- format `timevar' `format'
= format yr %8.0g
- tempname scdelta
- mata: _TS_p_delta(&`scdelta'&, &`delta'&, &`timevar'&)
= mata: _TS_p_delta(&__000004&, &&, &yr&)
- if `scdelta' == -2 {
= if __000004 == -2 {
di as err &invalid time-series format on `timevar'&
- if `scdelta' == -1 {
= if __000004 == -1 {
di as err &invalid argument in delta()&
- tempvar timedif
- qui `bypfx' gen double `timedif' = `timevar'[_n+1] - `timevar'
= qui by __000003:
gen double __000005 = yr[_n+1] - yr
- qui sum `timedif', meanonly
= qui sum __000005, meanonly
- if r(min) == 0 {
- if &`panel'& != && {
= if &__000003& != && {
- di in red &repeated time values within panel&
repeated time values within panel
di in red &repeated time values in sample&
- exit 451
------------------------------------------------------------------------------ end tsset ---
if (&`model'& == &valueadded&) {
lp_srch `cmd' i(`idvar') t(`t')
global LPone = 1
lp_gmm `cmd' i(`idvar') t(`t') converrs(0) just(`just') grid(`gsrch')
global LPone = 0
local converrs = 0
foreach x of local rmacs {
if (`x' &= .) {
local converrs = 1
noi di as error &Insufficient variation to identify the capital and intermediate input&
noi di as error &coefficients separately.
Bootstrapping for first-stage parameters only.&
if (&`model'& == &valueadded&) {
postfile `post' `free' `capital' using `&`postfile'&', double replace
local rmacs &&
foreach var in `free' `capital' {
local rmacs &`rmacs' (r(`var'))&
if `converrs' == 0 {
postfile `post' `free' `capital' `proxy' using `&`postfile'&', double replace
local rmacs &&
foreach var in `free' `capital' {
local rmacs &`rmacs' (r(`var'))&
local rmacs &`rmacs' (r(`proxy'))&
postfile `post' `free' using `&`postfile'&', double replace
local rmacs &&
foreach var in `free' {
local rmacs &`rmacs' (r(`var'))&
post `post' `rmacs'
forvalues cnt = 1/`reps' {
noi di &.& _continue
restore, preserve
keep if `touse'
tempvar idvar
bsample, cluster(`i') idcluster(`idvar')
if (&`model'& == &valueadded&) {
lp_srch `cmd' i(`idvar') t(`t')
lp_gmm `cmd' i(`idvar') t(`t') converrs(`converrs') just(`just') grid(`gsrch')
post `post' `rmacs'
postclose `post'
if (&`model'& == &revenue&) {
macro drop LPone
mat drop LPmoments
tempname evar eb
use `&`postfile'&', clear
mat accum `evar' = * in 2/l , deviations noconstant
if (&`model'& == &revenue&) {
macro drop LPone
mat drop LPmoments
tempname evar eb
use `&`postfile'&', clear
mat accum `evar' = * in 2/l , deviations noconstant
mat `evar' = `evar' / (r(N) - 1)
mkmat * in 1, matrix(`eb')
if `converrs' == 0 {
tempname capr diff rvri waldcrs junk
loc bsize = colsof(`eb')
mat `capr' = J(1, `bsize', 1)
mat `rvri' = syminv(`capr'*`evar'*`capr'')
mat `diff' = `eb'*`capr'' - 1
mat `junk' = `diff'*`rvri'*`diff'
scalar `waldcrs' = trace(`junk')
estimates post `eb' `evar' , esample(`touse') depname(`&`depvar'&') obs(`capn')
if `converrs' == 0 {
estimates scalar waldcrs = `waldcrs'
estimates local depvar `depvar'
if (&`model'& == &revenue&) {
estimates local model &revenue&
estimates local model &value added&
estimates local predict &levpet_p&
estimates local cmd &levpet&
tsset `i' `t'
------------------------------------------------------------------------------- end levpet ---
For searches and help try:
Follow-Ups:
From: &Nick Cox& &n.j.cox@durham.ac.uk&
Prev by Date:
Next by Date:
Previous by thread:
Next by thread:
Index(es):
& Copyright
StataCorp LP

我要回帖

更多关于 固态硬盘多大合适 的文章

 

随机推荐