Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Survey design and cluster standard errors.

    Dear Statalist,

    I have just started to work with svy command in Stata, and I have the next question. I am using World Bank Enterprise Survey database. This database consist of multiple and different companies surveyed in different countries and in different years. For example, in 2017, the survey was run in Argentina to X number of companies. In 2020 in Brazil, and so on. I post an example of my data.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str26 country_01 double(Year idstd wt)
    "Afghanistan2014" 2014 533442 1.1428571428571428
    "Albania2013"     2013 542220 3.2879722118377686
    "Armenia2013"     2013 533095  6.931797027587891
    "Bangladesh2013"  2013 531902 2.5797190682798528
    "Belarus2018"     2018 650400  5.800000190734863
    "Brazil2009"      2009 453748  9.257549538448156
    "China2012"       2012 522786  68.86000061035156
    "Costarica2010"   2010 501810  2.145448878184738
    "DRC2010"         2010 485207 1.6700663566589355
    "Egypt2013"       2013 574103 47.818180084228516
    "Egypt2016"       2016 613389 3.5714287757873535
    "Egypt2016"       2016 612045  4.200000286102295
    "Egypt2016"       2016 612131  6.405719757080078
    "Egypt2020"       2020 703794  49.44776153564453
    "Egypt2020"       2020 706104  7.722222328186035
    "ElSalvador2016"  2016 606364  43.10134506225586
    "Ethiopia2015"    2015 590813 1.1903963088989258
    "Finland2020"     2020 722295 21.133333206176758
    "Honduras2010"    2010 499953                  1
    "Honduras2016"    2016 621275  4.386329174041748
    "Hungary2019"     2019 680049  17.53152084350586
    "India2014"       2014 569109 3.6510496139526367
    "India2014"       2014 567705  33.07654571533203
    "Jordan2019"      2019 662127 3.0422518253326416
    "Kazakhstan2019"  2019 663125  3.546715259552002
    "Kenya2013"       2013 538227  6.967075347900391
    "Kenya2013"       2013 538825  9.706070899963379
    "Madagascar2013"  2013 558144  2.696864941805831
    "Mexico2010"      2010 503536   9.70879077911377
    "Mexico2010"      2010 503177                1.5
    "Mongolia2013"    2013 536346 3.9907243251800537
    "Peru2010"        2010 492839 2.2355170249938965
    "Poland2019"      2019 675664 1558.7000732421875
    "Poland2019"      2019 675981   2194.47607421875
    "Russia2009"      2009 446765 3.2864270210266113
    "Russia2012"      2012 517812  9.082151412963867
    "Russia2019"      2019 656806 132.43113708496094
    "Russia2019"      2019 656168   1688.86669921875
    "Serbia2009"      2009 440430   13.1532621383667
    "SouthAfrica2020" 2020 714178 184.13333129882813
    "Sudan2014"       2014 580538  2.928678035736084
    "Sweden2014"      2014 556746  4.799958202921424
    "Tajikistan2013"  2013 552136  2.156479597091675
    "Thailand2016"    2016 604997  592.1085815429688
    "Türkiye2019"    2019 655026    69.697509765625
    "Ukraine2019"     2019 677472 3.4000000953674316
    "Vietnam2009"     2009 466744 29.227214813232422
    "Zambia2013"      2013 540696  9.857194900512695
    "Zimbabwe2011"    2011 513687               1.13
    "Zimbabwe2016"    2016 609583 1.3812071084976196
    end
    With all this on hand, first I set my survey structure like this:

    Code:
    svyset idstd [pweight=wt], strata(strata) singleunit(scaled)
    After that, I want to run a logit regression but using cluster standard errors at country level, because might be correlation within a country. Then I type this code:

    Code:
    svy: logit collateral n_outcome age lnemployees i.ownership, vce(cluster country)
    However, Stata tells me: option vce() of logit is not allowed with the svy prefix. So, looking at the design of the survey and therefore, at the command svyset, am I already considering standard errors clustered at country level and hence, adding vce(cluster ...) has no sense, or may I have to specify it but with another command?

    Thank you in advanced!
    Last edited by Ibai Ostolozaga Falcon; 04 May 2023, 09:04.
Working...
X