黃河泉 发表于 2017-12-18 15:47
建议请用 dataex (先 ssc install dataex 并见说明) 将原始 Stata 资料中具有”代表性”的一部分资料列出 ...
感谢黄老师今天又让我学到一招,下面是数据,其中分别以va、va2005和emp为因变量,以pgdp作为自变量分别进行回归,得到三条倒U型曲线,然后进行合并。三条倒u曲线分别在pgdp=6000左右便出现拐点.但是根据下面的数据在pgdp=6000时,va2005与emp似乎还未到达拐点而是一直在增加,6724、7308和8031处,甚至都在增加。
- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input int year double(va va2005 emp pgdp)
- 1952 .163154 .010735 .056218 537.6140338542125
- 1953 .182575 .015375 .061103 552.1766800254563
- 1954 .192727 .017958 .065616 556.936722043977
- 1955 .190652 .018022 .065215 576.5302182681487
- 1956 .21001 .025129 .081613 616.1119290708245
- 1957 .231948 .02636 .068589 635.9913901300266
- 1958 .28827 .050766 .201551 690.374826823425
- 1959 .33495 .070178 .15549 686.3897418187552
- 1960 .349624 .079383 .118954 662.1404050549418
- 1961 .25688 .062102 .083478 552.8932503445247
- 1962 .250698 .055861 .060488 550.4378388933116
- 1963 .263974 .058582 .05823 590.2906929880484
- 1964 .281321 .066842 .059909 644.8181798655411
- 1965 .279431 .076945 .063931 701.5932940428002
- 1966 .301466 .092159 .066399 746.3162904541746
- 1967 .269293 .080947 .065732 706.9206812007157
- 1968 .248888 .075867 .06542 674.9144620469716
- 1969 .282447 .102448 .069416 712.9738387613454
- 1970 .319888 .135805 .07777 778.3518571699162
- 1971 .332733 .146526 .085263 794.9613900761499
- 1972 .340925 .153907 .090778 798.3318445993759
- 1973 .341176 .15482 .093287 838.3949021475385
- 1974 .337687 .152169 .095979 835.146331982007
- 1975 .361179 .169151 .102744 871.1810954882992
- 1976 .358501 .166816 .109979 852.6708821996701
- 1977 .372952 .183506 .112715 893.6271470287402
- 1978 .380881 .196162 .131654 977.9515041859929
- 1979 .376199 .19934 .13333 1039.4094973710146
- 1980 .380049 .212995 .138136 1061.0526530341865
- 1981 .362444 .202425 .13888 1110.1934777599686
- 1982 .352498 .19583 .138641 1186.0537189049878
- 1983 .346118 .192566 .139121 1257.7436655174301
- 1984 .336421 .191138 .144954 1395.859474839052
- 1985 .332441 .199909 .147835 1519.1534099558532
- 1986 .336099 .20191 .155647 1597.0059711845818
- 1987 .331178 .205745 .15769 1737.053692915819
- 1988 .335108 .214801 .15673 1830.037308352169
- 1989 .334345 .212353 .150072 1834.1867429490903
- 1990 .325766 .210225 .14888 1870.9302888956424
- 1991 .327454 .222869 .149978 1967.1822589895548
- 1992 .341298 .243413 .151229 2132.1759358610093
- 1993 .359504 .264238 .152799 2311.822409286854
- 1994 .363554 .295741 .153242 2514.660166885517
- 1995 .362022 .326739 .153501 2863.4848176751557
- 1996 .368044 .338704 .156678 2891.9888300275143
- 1997 .368017 .342814 .156951 3013.350405463081
- 1998 .356255 .345327 .155804 2993.1936856598777
- 1999 .350009 .344499 .15001 3162.233832374764
- 2000 .349377 .345178 .145166 3420.86572235268
- 2001 .346241 .348246 .142648 3758.9314777686045
- 2002 .343831 .351242 .13522 4197.145423305217
- 2003 .353116 .359613 .138959 4802.843061161129
- 2004 .338881 .346508 .151252 5168.708600968309
- 2005 .347395 .347395 .16374 5575.372779431166
- 2006 .362536 .358493 .17297 6047.562203475157
- 2007 .360388 .362297 .184198 6303.024163716865
- 2008 .357575 .36222 .186621 6724.779700268572
- 2009 .34524 .361224 .190737 7308.203137023515
- 2010 .347966 .365292 .191707 8031.944674384381
- 2011 .346704 . .186824 .
- end
复制代码代码如下:
- reg va pgdp c.pgdp#c.pgdp, robust
- marginscontplot pgdp, ci saving(Graph1, replace)
- *graph save Graph "E:\Graph1.gph", replace
- reg va2005 pgdp c.pgdp#c.pgdp , robust
- marginscontplot pgdp, ci saving(Graph2, replace)
- *graph save Graph "E:\Graph2.gph", replace
- reg emp pgdp c.pgdp#c.pgdp , robust
- marginscontplot pgdp, ci saving(Graph3, replace)
- *graph save Graph "E:\Graph3.gph", replace
- use "Graph1.dta", clear
- ren _margin _margin1
- merge 1:1 pgdp using "Graph2.dta"
- ren _margin _margin2
- drop _merge
- merge 1:1 pgdp using "Graph3.dta"
- ren _margin _margin3
- twoway (line _margin1 pgdp) (line _margin2 pgdp) (line _margin3 pgdp), legend(off)
复制代码烦请黄老师帮我看看问题出现在哪,多谢