I am running xtpmg on stata 16.0.
Running it on my level variables doesn't pose any problems, however, when I log my variables and attempt to run xtpmg again, I am met with the following error message:
note: l_y dropped because of collinearity
initial vector: duplicate entries for l_y_sq found
r(507);
my code is attached below.
Any advice is kindly appreciated, thank you very much
Code:
xtset c_id year global variables ew y y_sq foreach i in $variables{ gen l_`i'=ln(`i') } xtpmg d.ew d.y d.y_sq , lr(l.ew y y_sq) replace pmg *this regression works and gives outputs xtpmg d.l_ew d.l_y d.l_y_sq , lr(l.l_ew l_y l_y_sq) replace pmg /* this regression doesn't work and gives error: note: l_y dropped because of collinearity initial vector: duplicate entries for l_y_sq found r(507); */
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte c_id str3 code str14 country int year str7 conccode float(ew y y_sq l_ew l_y l_y_sq) 1 "AUT" "Austria" 1980 "AUT1980" .17414816 27595.836 761530112 -1.747849 10.22542 20.45084 1 "AUT" "Austria" 1981 "AUT1981" .4507529 27485.83 755470976 -.796836 10.221426 20.44285 1 "AUT" "Austria" 1982 "AUT1982" .812341 28018.54 785038656 -.2078351 10.240622 20.481243 1 "AUT" "Austria" 1983 "AUT1983" 1.2558123 28898.22 835107072 .2277826 10.271535 20.54307 1 "AUT" "Austria" 1984 "AUT1984" 1.77272 28914.86 836068928 .572515 10.27211 20.54422 1 "AUT" "Austria" 1985 "AUT1985" 2.3590333 29623.434 877547840 .8582519 10.29632 20.59264 1 "AUT" "Austria" 1986 "AUT1986" 3.006986 30285.934 917237760 1.1009382 10.318439 20.636877 1 "AUT" "Austria" 1987 "AUT1987" 3.707667 30677.545 941111744 1.310403 10.331286 20.66257 1 "AUT" "Austria" 1988 "AUT1988" 4.4527087 31643.81 1001330688 1.4935126 10.362298 20.724596 1 "AUT" "Austria" 1989 "AUT1989" 5.225883 32726.06 1070995008 1.6536237 10.395927 20.791855 1 "AUT" "Austria" 1990 "AUT1990" 5.998815 33888.996 1148464000 1.791562 10.430845 20.86169 1 "AUT" "Austria" 1991 "AUT1991" 6.770896 34707.07 1204580864 1.9126334 10.454699 20.909397 1 "AUT" "Austria" 1992 "AUT1992" 7.525643 35045.844 1228211200 2.0183163 10.464413 20.928825 1 "AUT" "Austria" 1993 "AUT1993" 8.279713 34941.145 1220883584 2.1138082 10.46142 20.92284 1 "AUT" "Austria" 1994 "AUT1994" 9.067493 35643.027 1270425472 2.204696 10.48131 20.96262 1 "AUT" "Austria" 1995 "AUT1995" 9.84395 36537.992 1335025024 2.2868571 10.506108 21.012217 1 "AUT" "Austria" 1996 "AUT1996" 10.640005 37346.008 1394724224 2.364621 10.527982 21.05596 1 "AUT" "Austria" 1997 "AUT1997" 11.419943 38084.703 1450444544 2.435361 10.547568 21.095137 1 "AUT" "Austria" 1998 "AUT1998" 12.206928 39405.41 1552786688 2.502004 10.581658 21.163317 1 "AUT" "Austria" 1999 "AUT1999" 12.99485 40727.48 1658727936 2.564553 10.614658 21.229317 1 "AUT" "Austria" 2000 "AUT2000" 13.796465 42001.21 1764101760 2.624412 10.645453 21.290907 1 "AUT" "Austria" 2001 "AUT2001" 14.569064 42370.93 1795295744 2.6789005 10.654218 21.308435 1 "AUT" "Austria" 2002 "AUT2002" 15.305841 42859.33 1836922112 2.7282345 10.66568 21.33136 1 "AUT" "Austria" 2003 "AUT2003" 15.987642 43052.6 1853526528 2.771816 10.670178 21.340357 1 "AUT" "Austria" 2004 "AUT2004" 16.677198 43956.58 1932181120 2.814042 10.690958 21.381916 1 "AUT" "Austria" 2005 "AUT2005" 17.415686 44637.86 1992538240 2.857371 10.706338 21.412676 1 "AUT" "Austria" 2006 "AUT2006" 18.14388 45951.73 2111561856 2.898333 10.735347 21.470694 1 "AUT" "Austria" 2007 "AUT2007" 18.835514 47510.29 2257228032 2.935744 10.768702 21.537403 1 "AUT" "Austria" 2008 "AUT2008" 19.42298 48053.48 2309137152 2.966457 10.78007 21.56014 1 "AUT" "Austria" 2009 "AUT2009" 19.902044 46123.49 2127376384 2.9908226 10.739078 21.478155 1 "AUT" "Austria" 2010 "AUT2010" 20.311794 46858.04 2195676160 3.0112016 10.754878 21.509756 1 "AUT" "Austria" 2011 "AUT2011" 20.6568 48065.32 2310274560 3.0280445 10.780316 21.56063 1 "AUT" "Austria" 2012 "AUT2012" 20.89689 48172.24 2320564480 3.0396004 10.782538 21.565077 1 "AUT" "Austria" 2013 "AUT2013" 21.03004 47901.37 2294540800 3.045952 10.7769 21.5538 1 "AUT" "Austria" 2014 "AUT2014" 21.07657 47842.75 2288928512 3.048162 10.775675 21.55135 1 "AUT" "Austria" 2015 "AUT2015" 21.00939 47789.39 2283825408 3.0449696 10.77456 21.54912 1 "AUT" "Austria" 2016 "AUT2016" 20.932676 48215.89 2324772096 3.0413115 10.783443 21.566887 1 "AUT" "Austria" 2017 "AUT2017" 20.848225 49031.11 2404049408 3.037269 10.80021 21.60042 1 "AUT" "Austria" 2018 "AUT2018" 20.778 50051.79 2505181184 3.033895 10.820813 21.641626 1 "AUT" "Austria" 2019 "AUT2019" 20.73558 50552.91 2555596288 3.031851 10.830775 21.66155 2 "BEL" "Belgium" 1980 "BEL1980" .18315575 27069.436 732754368 -1.6974185 10.20616 20.41232 2 "BEL" "Belgium" 1981 "BEL1981" .4748392 26994.547 728705600 -.7447791 10.20339 20.40678 2 "BEL" "Belgium" 1982 "BEL1982" .8547354 27162.543 737803712 -.15696336 10.209594 20.41919 2 "BEL" "Belgium" 1983 "BEL1983" 1.3123662 27249.41 742530432 .2718318 10.212788 20.425575 2 "BEL" "Belgium" 1984 "BEL1984" 1.843347 27921.906 779632832 .6115829 10.237166 20.47433 2 "BEL" "Belgium" 1985 "BEL1985" 2.439025 28374.664 805121600 .8915985 10.253252 20.506504 2 "BEL" "Belgium" 1986 "BEL1986" 3.0939944 28881.57 834145024 1.129463 10.27096 20.54192 2 "BEL" "Belgium" 1987 "BEL1987" 3.7969284 29522.59 871583296 1.3341924 10.29291 20.58582 2 "BEL" "Belgium" 1988 "BEL1988" 4.5377483 30818.865 949802496 1.512431 10.335882 20.671764 2 "BEL" "Belgium" 1989 "BEL1989" 5.288216 31772.4 1009485504 1.665481 10.366353 20.732706 2 "BEL" "Belgium" 1990 "BEL1990" 6.075982 32671.645 1067436416 1.8043436 10.394263 20.788527 2 "BEL" "Belgium" 1991 "BEL1991" 6.866851 33147.14 1098732800 1.9267057 10.408711 20.817423 2 "BEL" "Belgium" 1992 "BEL1992" 7.667818 33518.242 1123472640 2.0370321 10.419846 20.83969 2 "BEL" "Belgium" 1993 "BEL1993" 8.462458 33066.418 1093387904 2.1356397 10.406274 20.81255 2 "BEL" "Belgium" 1994 "BEL1994" 9.266027 34028.426 1157933696 2.2263548 10.434952 20.869904 2 "BEL" "Belgium" 1995 "BEL1995" 10.021485 34767.027 1208746240 2.3047314 10.456425 20.91285 2 "BEL" "Belgium" 1996 "BEL1996" 10.80028 35157.695 1236063488 2.379572 10.4676 20.9352 2 "BEL" "Belgium" 1997 "BEL1997" 11.567656 36403.258 1325197184 2.448213 10.502414 21.00483 2 "BEL" "Belgium" 1998 "BEL1998" 12.311763 37038.25 1371831936 2.510555 10.519707 21.039413 2 "BEL" "Belgium" 1999 "BEL1999" 13.056366 38262.625 1464028416 2.569276 10.55223 21.10446 2 "BEL" "Belgium" 2000 "BEL2000" 13.81495 39588.6 1567257088 2.625751 10.586296 21.17259 2 "BEL" "Belgium" 2001 "BEL2001" 14.57378 39886.5 1590932480 2.679224 10.593793 21.187586 2 "BEL" "Belgium" 2002 "BEL2002" 15.277295 40385.87 1631018368 2.726368 10.606236 21.21247 2 "BEL" "Belgium" 2003 "BEL2003" 15.983816 40634.6 1651170432 2.771577 10.612375 21.22475 2 "BEL" "Belgium" 2004 "BEL2004" 16.70676 41903.99 1755944576 2.8158135 10.643136 21.28627 2 "BEL" "Belgium" 2005 "BEL2005" 17.462578 42641.7 1818313984 2.86006 10.660588 21.321175 2 "BEL" "Belgium" 2006 "BEL2006" 18.203966 43442.58 1887257984 2.9016395 10.679195 21.35839 2 "BEL" "Belgium" 2007 "BEL2007" 18.914288 44710.38 1999018496 2.9399176 10.70796 21.41592 2 "BEL" "Belgium" 2008 "BEL2008" 19.502846 44556.82 1985310720 2.97056 10.70452 21.40904 2 "BEL" "Belgium" 2009 "BEL2009" 19.951714 43306.6 1875461248 2.993315 10.67606 21.35212 2 "BEL" "Belgium" 2010 "BEL2010" 20.29906 44141.88 1948505344 3.0105746 10.695165 21.39033 2 "BEL" "Belgium" 2011 "BEL2011" 20.430185 44309.63 1963343488 3.0170135 10.698957 21.397915 2 "BEL" "Belgium" 2012 "BEL2012" 20.648737 44361.21 1967916928 3.027654 10.70012 21.40024 2 "BEL" "Belgium" 2013 "BEL2013" 20.854946 44355.38 1967399552 3.037591 10.69999 21.39998 2 "BEL" "Belgium" 2014 "BEL2014" 21.061384 44855.97 2012058112 3.047441 10.711212 21.422424 2 "BEL" "Belgium" 2015 "BEL2015" 21.297264 45507.23 2070908032 3.058579 10.725627 21.451254 2 "BEL" "Belgium" 2016 "BEL2016" 21.228296 45850.93 2102308096 3.055335 10.73315 21.4663 2 "BEL" "Belgium" 2017 "BEL2017" 21.126186 46409.13 2153807360 3.050513 10.745252 21.490503 2 "BEL" "Belgium" 2018 "BEL2018" 21.012386 47035.61 2212348928 3.045112 10.75866 21.51732 2 "BEL" "Belgium" 2019 "BEL2019" 20.90155 47618.3 2267502336 3.039823 10.770972 21.541945 3 "BGR" "Bulgaria" 1980 "BGR1980" .033378758 3651.3594 13332425 -3.3998356 8.202855 16.40571 3 "BGR" "Bulgaria" 1981 "BGR1981" .09162347 3817.538 14573596 -2.390068 8.247361 16.494722 3 "BGR" "Bulgaria" 1982 "BGR1982" .17120944 3895.1216 15171972 -1.7648677 8.26748 16.53496 3 "BGR" "Bulgaria" 1983 "BGR1983" .27066395 4018.695 16149910 -1.3068773 8.298713 16.597425 3 "BGR" "Bulgaria" 1984 "BGR1984" .3889701 4145.477 17184980 -.9442528 8.329773 16.659546 3 "BGR" "Bulgaria" 1985 "BGR1985" .52533793 4256.7813 18120186 -.6437135 8.356269 16.712538 3 "BGR" "Bulgaria" 1986 "BGR1986" .6785938 4437.0664 19687556 -.3877325 8.397749 16.795498 3 "BGR" "Bulgaria" 1987 "BGR1987" .8474113 4698.7915 22078642 -.16556907 8.455061 16.910122 3 "BGR" "Bulgaria" 1988 "BGR1988" 1.0300121 5207.205 27114984 .02957058 8.557798 17.115597 3 "BGR" "Bulgaria" 1989 "BGR1989" 1.224444 5095.162 25960678 .2024868 8.536047 17.072094 3 "BGR" "Bulgaria" 1990 "BGR1990" 1.432899 4714.8994 22230278 .3596997 8.458483 16.916965 3 "BGR" "Bulgaria" 1991 "BGR1991" 1.6559867 4359.676 19006774 .504397 8.380153 16.760305 3 "BGR" "Bulgaria" 1992 "BGR1992" 1.892859 4086.269 16697595 .6380883 8.315388 16.630775 3 "BGR" "Bulgaria" 1993 "BGR1993" 2.1416276 4058.024 16467561 .7615661 8.308452 16.616903 3 "BGR" "Bulgaria" 1994 "BGR1994" 2.398559 4145.8545 17188108 .8748681 8.3298645 16.659729 3 "BGR" "Bulgaria" 1995 "BGR1995" 2.660885 4283.256 18346280 .9786589 8.362469 16.724937 3 "BGR" "Bulgaria" 1996 "BGR1996" 2.9257786 4526.654 20490596 1.0735606 8.417738 16.835476 3 "BGR" "Bulgaria" 1997 "BGR1997" 3.1908095 3907.913 15271786 1.1602746 8.270759 16.541517 3 "BGR" "Bulgaria" 1998 "BGR1998" 3.4553826 4102.6646 16831856 1.239933 8.319392 16.638784 3 "BGR" "Bulgaria" 1999 "BGR1999" 3.719454 3784.078 14319247 1.313577 8.238558 16.477116 end
0 Response to xtpmg error message when running on logged variables
Post a Comment