Announcement

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

  • Problem with margins and vce(unconditional)

    Dear All,

    I am running a svy:probit and typing margins, vce(unconditional) later.

    However, I am getting the following error:


    . margins, vce(unconditional)
    unconditional standard errors derived assuming full estimation sample;
    indepvars dropped observations from the estimation sample
    r(459);


    I understand this is because my covariates have some missing data, and svy:probit automatically drops those observations while running the regressions.

    Is there anyway to get around this problem? I'm not using the subpop() option, but there is a if qualifier at the end of the regression:

    svy: probit lfcat c.age##c.age i.female i.educ i.training i.married WApop==1, allbase
    margins, vce(unconditional)

    Any help would be highly appreciated.

  • #2
    If this is what you actually typed, you left off the if qualifier. Also you should use the subpop option instead of if. Try rerunning using subpop and see if the problems persist.
    Last edited by Richard Williams; 17 Jul 2019, 09:14.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Originally posted by Richard Williams View Post
      If this is what you actually typed, you left off the if qualifier. Also you should use the subpop option instead of if. Try rerunning using subpop and see if the problems persist.
      Hi, thank you so much for replying.

      I was able to run margins with subpop in svy:probit.

      However, the subpop is not working when I am running svy:heckprob. I am getting the following error:

      an error occurred when svy executed heckprob
      r(2000);

      Maybe because the selection equation runs over a broader sample?

      Would this be a correct approach to solve the above problem (I only need margins of my main equation):

      margins, vce(unconditional) if emp13==1

      Thanks in advance.

      EDIT: Just noticed if doesn't work with margins. What would you suggest here then please?
      Last edited by Alina Faruk; 17 Jul 2019, 10:47.

      Comment


      • #4
        No idea with that one, and the error isn't the most helpful. If you can post a replicable example, that might help.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Originally posted by Richard Williams View Post
          No idea with that one, and the error isn't the most helpful. If you can post a replicable example, that might help.
          My actual dataset is huge, but here's a similar example with similar problem:

          Code:
          use http://fmwww.bc.edu/RePEc/bocode/o/oaxaca.dta, clear
          
          svyset [pw=wt]
          
          gen WApop=0
          replace WApop=1 if age>14
          
          gen lnwage2 = lnwage > 3 if lnwage < .
          
          svy, subpop(WApop): heckprob lnwage2 age agesq female educ exper tenure, select(lfp=age agesq female educ married divorced kids6 kids714)
          margins, vce(unconditional) subpop(WApop)
          Problem remains even if I don't specify any subpop.

          Comment


          • #6
            Originally posted by Richard Williams View Post
            No idea with that one, and the error isn't the most helpful. If you can post a replicable example, that might help.
            Dear Mr Williams,

            I found this old thread:
            http://statalist.1588530.n2.nabble.c...td3407157.html

            But I think I can't use -noestimcheck- option since my original regression includes an interaction term, "c.age###c.age".

            Given I am not being able to find any way around this, would it be a problem if I don't specify vce(unconditional) with -margins- and -margins, dydx(*)-?

            Comment


            • #7
              You might want to write to Stata Tech support and make sure that the bug they said was going to get fixed in 2009 really did get fixed. Or that there isn't some new bug you have found.

              I am not sure what horrible things, if any, happen if you don't specify vce(unconditional). If the options are to either omit it or to get nothing at all, my guess is that it would be better to omit it.
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              Stata Version: 17.0 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Originally posted by Richard Williams View Post
                You might want to write to Stata Tech support and make sure that the bug they said was going to get fixed in 2009 really did get fixed. Or that there isn't some new bug you have found.

                I am not sure what horrible things, if any, happen if you don't specify vce(unconditional). If the options are to either omit it or to get nothing at all, my guess is that it would be better to omit it.
                Thank you for your suggestions!

                Comment


                • #9
                  I tried a few examples from the manual, and the differences between using vce(unconditional) and not using it were pretty trivial. I don't know if that is always the case but I hope it usually is. I suspect many people don't even know about vce(unconditional) and the discussion in the manual is a little technical.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  Stata Version: 17.0 MP (2 processor)

                  EMAIL: [email protected]
                  WWW: https://www3.nd.edu/~rwilliam

                  Comment


                  • #10
                    Originally posted by Richard Williams View Post
                    I tried a few examples from the manual, and the differences between using vce(unconditional) and not using it were pretty trivial. I don't know if that is always the case but I hope it usually is. I suspect many people don't even know about vce(unconditional) and the discussion in the manual is a little technical.
                    So I tried margins with svy:heckprob by dropping the interaction and specifying -noestimcheck-, still the same error!

                    Went through the manual too, and they are saying minimal differences in SEs with and without vce(unconditional), since they have 3000 obs.

                    I have around 500,000 so I am hoping it won't be an issue!

                    Thanks once again for your time regarding the matter.

                    Comment

                    Working...
                    X