I am trying to run some regressions and getting an error that says there are no observations, even though I believe there should be 51. I am aware this is a small sample size, but I am just trying to get a feel for the relationship between my two main variables: lopcold100 and lpop2000d100. My code is bellow
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str53 state byte fips_state_code float(land2 alti malaria) double rainfall float(lpopcold100 lpop2000d100) "Alabama" 26 .400114 .075 .10021 1.4551025390625 -5.653392 -.14538972 "Alaska" 55 .00684 . 0 . . -5.449607 "Arizona" 18 .260931 .342 .22284 .27264358520507814 -5.5732 -.6962354 "Arkansas" 39 .511114 .091 .09995 1.3906500244140625 -6.996193 -.6633876 "California" 17 .461956 .004 .00063 .4063662109375 -3.895112 .7955512 "Colorado" 28 .361079 1.613 0 .29992318725585937 -7.222957 -.8244287 "Connecticut" 21 .377271 .013 .00853 1.0896600341796876 -4.5318146 1.8295695 "Delaware" 1 .390473 .005 .02202 1.0373360595703125 -4.6701636 1.2298617 "District of Columbia" 47 .329 . .03404 . . 3.488944 "Florida" 42 .352214 .053 .10632 1.3417841796875 -6.534948 1.0426546 "Georgia" 36 .322205 .304 .09592 1.22775146484375 -5.515173 .400922 "Hawaii" 34 . . 0 . . -.8230577 "Idaho" 56 .460358 .834 0 .3105574035644531 -7.04038 -1.799212 "Illinois" 16 .855963 .182 .04295 .928014404296875 -6.220318 .7772537 "Indiana" 35 .890171 .221 .0329 .996759521484375 -6.661077 .53155136 "Iowa" 8 .88738 .267 .02767 .83210400390625 -6.163188 -.6467861 "Kansas" 4 .859178 .273 .05381 .6757924194335938 -7.250305 -1.1037669 "Kentucky" 30 .61795 .151 .05147 1.1932919921875 -8.374496 .02117748 "Louisiana" 49 .66261 .014 .10357 1.4206219482421876 -5.497486 -.11224628 "Maine" 32 .203591 .02 .00021 1.02793798828125 -6.807815 -.9557078 "Maryland" 23 .416147 0 .03404 1.035303955078125 -7.225884 1.4927202 "Massachusetts" 33 .416991 .002 .00442 1.170177978515625 -3.829518 1.9384042 "Michigan" 25 .448933 .257 .00356 .8148601684570312 -6.608004 .033505138 "Minnesota" 44 .713185 .228 .00546 .7100316162109375 -6.014863 -.5433291 "Mississippi" 9 .566087 .08 .10718 1.4219765625 -4.827112 -.51756936 "Missouri" 50 .672554 .181 .063 .9983469848632812 -8.632043 -.19696847 "Montana" 2 .611333 1.262 .00006 .3506045837402344 -6.733862 -2.766566 "Nebraska" 53 .765595 .69 .02014 .6043930053710938 -6.126088 -1.4932418 "Nevada" 41 .280016 1.462 0 .20294599914550782 -7.445746 -1.587216 "New Hampshire" 15 .255507 .084 .00112 1.7186910400390625 -5.399504 .3191277 "New Jersey" 6 .350681 .015 .02371 1.07010205078125 -4.6701636 2.3432877 "New Mexico" 45 .240202 2.152 .34678 .3094565734863281 -5.5732 -1.866243 "New York" 11 .505778 .02 .00454 1.0150404052734374 -5.912641 1.268715 "North Carolina" 37 .34166 .09 .05668 1.2068809814453125 -6.64705 .4773803 "North Dakota" 10 .866063 .516 .00294 .4113954162597656 -6.632054 -2.4057255 "Ohio" 24 .780372 .234 .01894 .9507855224609375 -6.743628 .9333655 "Oklahoma" 12 .838393 .359 .09895 .9391649780273438 -6.016211 -.6876569 "Oregon" 51 .607906 .058 .00002 .8501062622070312 -5.121648 -1.0022193 "Pennsylvania" 13 .439329 .108 .01062 1.0198417358398437 -6.608177 .982283 "Rhode Island" 54 .387793 .002 .01157 1.1564620361328124 -3.829518 2.151406 "South Carolina" 38 .330103 .084 .08542 1.277810546875 -7.239993 .29349166 "South Dakota" 31 .927367 .442 .01264 .5024754943847656 -6.281605 -2.3015249 "Tennessee" 27 .511743 .138 .06338 1.2466744384765625 -8.416538 .3349522 "Texas" 20 .649587 .14 .5335 .7368400268554688 -6.467943 -.18560813 "Utah" 46 .397048 1.308 0 .32943798828125 -7.379053 -1.25411 "Vermont" 19 .339573 .182 .00023 .8755380249023438 -6.332584 -.4459432 "Virginia" 29 .410387 .048 .04094 1.065479248046875 -5.871078 .5560539 "Washington" 5 .467992 .027 .00006 1.0812779541015625 -4.822076 -.1385782 "West Virginia" 48 .486838 .174 .01722 1.078801513671875 -5.871078 -.29412043 "Wisconsin" 40 .667363 .267 .00529 .7822564697265625 -5.584909 -.178485 "Wyoming" 22 .372659 1.856 0 .3455035095214844 -6.804948 -2.965019 end
Code:
global contws2 "land2 alti malaria rainfall" qui eststo m1: reg lpop2000d100 lpopcold100 ,robust cluster(fips_state_code) qui eststo m4: xtreg lpop2000d100 lpopcold100 ${contws2} ,fe robust cluster(fips_state_code) esttab m1 m4,star(* 0.1 ** 0.05 *** 0.01) b(a1) se(2) /// stats(N r2_a, fmt(0 3) labels("N" "R^2")) order(lpopcold100 $contrws2) /// title("Table 5: Persistence in Population Density (pooled)") /// mtitle ("OLS" "Between" "Within FE" "Within FE" ) compress longtable nogaps nonumber /// replace nonotes coeflabels(lpopcold100 "PreColonialDens" land2 "Agriculture" /// alti "Altitude" rainfall "Rainfall" malaria "Malaria" _cons "Constant") varwidth(15) eststo clear
0 Response to Error: no observations when running regressions
Post a Comment