关于本站
人大经济论坛-经管之家:分享大学、考研、论文、会计、留学、数据、经济学、金融学、管理学、统计学、博弈论、统计年鉴、行业分析包括等相关资源。
经管之家是国内活跃的在线教育咨询平台!
经管之家新媒体交易平台
提供"微信号、微博、抖音、快手、头条、小红书、百家号、企鹅号、UC号、一点资讯"等虚拟账号交易,真正实现买卖双方的共赢。【请点击这里访问】
论文
- 毕业论文 | 写毕业论文
- 毕业论文 | 为毕业论文找思路
- 毕业论文 | 可以有时间好好写 ...
- 毕业论文 | 毕业论文如何选较 ...
- 毕业论文 | 毕业论文选题通过 ...
- 毕业论文 | 还有三人的毕业论 ...
- 毕业论文 | 毕业论文答辩过程 ...
- 毕业论文 | 本科毕业论文,wi ...
考研考博
- 考博 | 南大考博经济类资 ...
- 考博 | 考博英语10000词汇 ...
- 考博 | 如果复旦、南大这 ...
- 考博 | 有谁知道春招秋季 ...
- 考博 | 工作与考博?到底 ...
- 考博 | 考博应该如何选择 ...
- 考博 | 考博失败了
- 考博 | 考博考研英语作文 ...
留学
- 日本留学 | 在日本留学心得
- 日本留学 | 日本留学生活必需 ...
- 日本留学 | 【留学日本】2015 ...
- 日本留学 | 日本海外留学8年来 ...
- 日本留学 | 日本留学费用_日本 ...
- 日本留学 | 求在日本留学的师 ...
- 日本留学 | 日本留学的有没有 ...
- 日本留学 | 日本留学
TOP热门关键词
免费学术公开课,扫码加入![]() |
*****Prepare data for calculation of EITC, send to TAXSIM, and createdataset for IV
*****Setup
*Baseline without state
**001 is wage income only
**002 is wage plus unearned income
**012, 011 include state taxes and credits
foreach j in 012 011 211 311 411 511 611 711 {
***KEY to datasets***
*hat=0: real data, hat=4: baseline predicted, hat=2,3 needed for Table 4,hat=5,6,7 needed for Table 5
*state=0: no state tax information calculated, state=1: state taxesincluded
*spec=1: excludes unearned income, spec2: includes unearned income
local hat=substr("`j'",1,1)
local state=substr("`j'",2,1)
local spec=substr("`j'",3,1)
use main, replace
sort idchild year
*IMPORTANT NOTE: all income variables are in 1979 dollars, and need to beconverted to nominal dollars before sending through taxsim
*(convert to nominal dollars by multiplying by cpily)
replace earnincrimp=earnincrimp*cpily
replace earnincsimp=earnincsimp*cpily
replace earnincrsimp=earnincrsimp*cpily
replace unearnincrsimp=unearnincrsimp*cpily
replace nontaxincrsimp=nontaxincrsimp*cpily
gen pretaxinc=earnincrsimp+unearnincrsimp+nontaxincrsimp
*****As needed, make variable changes or sample restrictions
*note: one year already subtracted off to reflect that NLSY reports laggedincome
gen trend=year-1986
***Set state variable to missing if necessary (for state=0 samples)
replace state=0 if `state'==0
*****Sample restrictions
gen samp=1
replace samp = (year==1985|year==1987|year==1989|year==1991|year==1993|year==1995|year==1997|year==1999)& (piamatsn!=. | piarecsn!=. | piarersn!=.) if `hat'==2 | `hat'==3 |`hat'==4 | `hat'==5
replace samp = samp |(year==1988|year==1990|year==1992|year==1994|year==1996|year==1998) if `hat'==6| `hat'==7
sort idchild year
xtset idchild year, yearly delta(1)
*create variables for SIV and to define sample
gen test=(2.295/(10000*cpily))*earnincrsimp
gen x0=L2.test==0
gen x1=L2.test
gen x2=x1^2
gen x3=x1^3
gen x4=x1^4
gen x5=x1^5
gen getdiv02=marrlyimp==0 & (L1.marrlyimp==1|L2.marrlyimp==1)
gen getmarr02=marrlyimp==1 & (L1.marrlyimp==0|L2.marrlyimp==0)
gen flag1 = (2.295/(10000*cpily))*pretaxinc<10 &(2.295/(10000*L2.cpily))*L2.pretaxinc<10
gen flag = year>=1989 & !getmarr02 & !getdiv02 & flag1 if`hat'==2 | `hat'==3 | `hat'==4 | `hat'==6 | `hat'==7
replace flag = year>=1987 & !getmarr02 & !getdiv02 & flag1if `hat'==5
keep if samp
*drop poor oversample
keep if ((samprandom&sampnm)|sampnmblack|sampnmhisp) | (year==1994|year==1996|year==1998)
*****Get predicted income
*Need to have earned income (for eitc credit) and unearned income (forlocation on eitc schedule)
gen earninc=.
gen unearninc=.
*Use actual data (for hat=0 samples)
replace earninc=earnincrsimp if `hat'==0
replace unearninc=unearnincrsimp if `hat'==0
*year trend
if `hat'==2 {
reg test x0 x1 x2 x3 x4 x5 trend ifsamp & flag
predict earninchat if samp &flag
replaceearninc=earninchat*((10000*cpily)/2.295) if samp & flag
}
*year dummies
if `hat'==3 {
reg test x0 x1 x2 x3 x4 x5 yy* ifsamp & flag
predict earninchat if samp &flag
replaceearninc=earninchat*((10000*cpily)/2.295) if samp & flag
}
*baseline
if `hat'==4 {
reg test x0 x1 x2 x3 x4 x5 if samp& flag
predict earninchat if samp &flag
replaceearninc=earninchat*((10000*cpily)/2.295) if samp & flag
}
*for Table 5
if `hat'==5 {
gen f0=F2.test==0
gen f1=F2.test
gen f2=f1^2
gen f3=f1^3
gen f4=f1^4
gen f5=f1^5
reg test f0 f1 f2 f3 f4 f5 if samp& flag
predict earninchat if samp &flag
replaceearninc=earninchat*((10000*cpily)/2.295) if samp & flag
}
*for Table 5
if `hat'==6 {
gen f0=L1.test==0
gen f1=L1.test
gen f2=f1^2
gen f3=f1^3
gen f4=f1^4
gen f5=f1^5
reg test f0 f1 f2 f3 f4 f5 if samp& flag & (year==1987|year==1989|year==1991|year==1993|year==1995|year==1997|year==1999)& (piamatsn!=. | piarecsn!=. | piarersn!=.)
predict earninchat if samp &flag
replaceearninc=earninchat*((10000*cpily)/2.295) if samp & flag
}
*for Table 5
if `hat'==7 {
gen f0=F1.test==0
gen f1=F1.test
gen f2=f1^2
gen f3=f1^3
gen f4=f1^4
gen f5=f1^5
reg test f0 f1 f2 f3 f4 f5 if samp& flag &(year==1987|year==1989|year==1991|year==1993|year==1995|year==1997|year==1999)& (piamatsn!=. | piarecsn!=. | piarersn!=.)
predict earninchat if samp &flag
replaceearninc=earninchat*((10000*cpily)/2.295) if samp & flag
}
gen oldyear=year
*****Replace pwages and ui with predicted values earninc and unearninc andsave pre-eitc dataset
replace swages=0
replace pwages=earninc
replace ui=unearninc
*Set non-wage income (unearnincrsimp, which we are feeding through taxsimas "ui") equal to zero if necessary (for spec=1 samples)
replace ui=0 if `spec'==1
drop earninc unearninc
*Save pre-eitc master dataset, using real data, for later merging in futureprogram
if "`j'"=="012" {
save preeitcinput, replace
}
keep idchild cpily year state mstat depx agex pwages swages dividendsotherprop pensions gssi transfers rentpaid proptax otheritem childcare uidepchild mortgage stcg ltcg oldyear
*Note: don't send idchild to taxsim if using state identifiers
*****Send data to TAXSIM and get after tax income and EITC
taxsim9, replace full
replace year=oldyear
sort idchild year
save taxsimout`j', replace
}
*****Now rename taxsim variables and merge taxsim datasets together
*****Rename variables from taxsim output
local datasets 012 011 211 311 411 511 611 711
foreach i of local datasets {
use taxsimout`i', replace
rename v10 fedagi
rename v25 eitc
rename v28 fedinctax
rename v39 stateeitc
rename v40 statetotcredit
keep idchild year fedagi eitcfedinctax stateeitc statetotcredit siitax cpily pwages otherprop
*Put dollar values back in realterms (2000 dollars, so divide by cpily and multiply by 2.295) and divide allmonetary variables by 10,000
local vars "fedagi eitcfedinctax stateeitc statetotcredit siitax pwages"
foreach var of varlist `vars' {
qui replace `var' =`var'*(2.295/(10000*cpily))
}
*Create income variables
geninc=fedagi-fedinctax-siitax+statetotcredit
gen incnotax=pwages+eitc
gen tax=fedagi-eitc
*rename variables with appropriateextension
local vars "fedagi eitcfedinctax stateeitc statetotcredit siitax pwages inc incnotax tax"
foreach var of varlist `vars' {
rename `var' `var'`i'
}
save taxsim`i', replace
}
*****Merge all datasets together
*Start with preeitcinput for real data
use preeitcinput, replace
sort idchild year
foreach dataset of local datasets {
merge idchild year usingtaxsim`dataset'
tab _merge
drop _merge
sort idchild year
}
*Now for additional variables, put back in real terms (into 2000 dollars,so divide by cpily and multiply by 2.295) and divide all monetary variables by10,000
local vars "ui otherpropnontaxincrsimp earnincrsimp unearnincrsimp"
foreach var of varlist `vars' {
replace `var' =`var'*(2.295/(10000*cpily))
}
*Now for some variables, put into year 2000 dollars in real terms (convertfrom 1979 dollars to 2000 dollars, so multiply by 2.295) and divide allmonetary variables by 10,000
local vars "totweadimp2"
foreach var of varlist `vars' {
replace `var' =`var'/(10000*(1/2.295))
}
save taxsim-merged, replace
求大神解决,谢谢!!!
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
![](static/2016/reg/jgewm.png)
您可能感兴趣的文章
本站推荐的文章
- 哲学名言 | 【独家发布】经典哲学名言
- 哲学书籍 | 求推荐一本讲人生目标的哲学书籍 ...
- 哲学书籍 | 20部必读的哲学书籍
- 哲学书籍 | 经济人,开拓你逻辑思维的哲学书 ...
- 哲学书籍 | 哲学书籍
- 哲学书籍 | 哲学书籍
- 哲学书籍 | 哲学书籍
- 哲学书籍 | 经典的哲学书籍
人气文章
本文标题:运行do文件时出现AppData\Local\Temp\ST_00000002.tmp not found
本文链接网址:https://bbs.pinggu.org/jg/huiji_huijiku_4155448_1.html
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。