Announcement

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

  • #16
    Can you explain more ?
    ​​​​excuse me;
    i dont understand what you mean and how should i do that ?
    Last edited by Marzieh Goodarzi; 11 Jan 2019, 08:48.

    Comment


    • #17
      Marzieh:
      I encourage you to use -dataex- to share an excerpt of your data. Please, see the toy-example reported below:
      Code:
      . sysuse auto.dta
      (1978 Automobile Data)
      
      . dataex make price mpg rep78 in 1/5
      
      ----------------------- copy starting from the next line -----------------------
      
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str18 make int(price mpg rep78)
      "AMC Concord"   4099 22 3
      "AMC Pacer"     4749 17 3
      "AMC Spirit"    3799 22 .
      "Buick Century" 4816 20 3
      "Buick Electra" 7827 15 4
      end
      
      ------------------ copy up to and including the previous line ------------------
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #18
        Is that what you mean?

        Click image for larger version

Name:	Dataex.png
Views:	5
Size:	177.3 KB
ID:	1478345



        Attached Files

        Comment


        • #19
          Sorry, I really feel like a technical idiot right now, I accidently posted it various times and I don't finde a option to delete it and post it again

          Comment


          • #20
            Hanna:
            not quite (and not as a tail of this thread, that I mentioned only to point you to an example).
            You simply attached a snapshot of what you (correctly) did with -dataex-.
            Please go back to your original thread and make your example exportable:
            Code:
            . sysuse auto.dta
            (1978 Automobile Data)
            
            . dataex make price mpg rep78 in 1/5
            
            ----------------------- copy starting from the next line -----------------------
            
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input str18 make int(price mpg rep78)
            "AMC Concord"   4099 22 3
            "AMC Pacer"     4749 17 3
            "AMC Spirit"    3799 22 .
            "Buick Century" 4816 20 3
            "Buick Electra" 7827 15 4
            end
            
            ------------------ copy up to and including the previous line ------------------
            PS: no need to feel discouraged for such a trivial thing. One of the most motivating Nick's statement sounds like: "We are all beginners. Some of us are only more experienced". I would only add that he wrote it in an English much better than mine!
            Last edited by Carlo Lazzaro; 11 Jan 2019, 10:35.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #21
              Mr. lazzaro:
              I'm sorry to answer late. i am very busy.

              with usecode of dataex:

              Code:
              . gen Lunderline=L.underline
              (3,968 missing values generated)
              
              .
              end of do-file
              
              . do "C:\Users\AM\AppData\Local\Temp\STD04000000.tmp"
              
              . gen Lq=L.q
              (3,968 missing values generated)
              
              .
              end of do-file
              
              . dataex underline Lunderline Lq in 1/5
              
              ----------------------- copy starting from the next line -----------------------
              
              
              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input float(underline Lunderline Lq)
              0 . .
              1 0 0
              0 1 0
              0 . .
              0 0 0
              end
              ------------------ copy up to and including the previous line ------------------ Listed 5 out of 11904 observations
              but I do not understand how to use these results?
              Last edited by Marzieh Goodarzi; 12 Jan 2019, 23:48.

              Comment


              • #22
                Dear Marzieh Goodarzi,

                I am a bit more optimistic than Carlo Lazzaro; those observations are dropped because they are not informative about the parameters of interest, so I do not think you need to worry about sample selection issues. Not dropping the observations does not change the results, it just reduces the computational cost. Maybe Stata could phrase that note better, or even eliminate it.

                Best wishes,

                Joao

                Comment


                • #23
                  Thank you for your suggestion Mr.silva.
                  Of course, because stata deleted a small amount of data at regresion, you are right.
                  also thanks Mr. Lazzaro for your advice.

                  Comment


                  • #24
                    Hi, may I ask a follow-up question? If I do not expect any groups with all positive/negative outcomes, how could I get the information about the observations that are "dropped" by STATA in the step of "xtlogit, fe"? Thank you.

                    Comment


                    • #25
                      Chan:
                      welcome to this forum.
                      You may have time-invariant predictors that, as expected, the -fe- estimator wipes out, as in the following toy-example:
                      Code:
                      use "https://www.stata-press.com/data/r18/nlswork.dta"
                      . xtlogit c_city i.race, fe
                      note: multiple positive outcomes within groups encountered.
                      note: 3,446 groups (18,803 obs) omitted because of all positive or
                      all negative outcomes.
                      note: 2.race omitted because of no within-group variance.
                      note: 3.race omitted because of no within-group variance.
                      
                      
                      Conditional fixed-effects logistic regression Number of obs = 9,723
                      Group variable: idcode Number of groups = 1,265
                      
                      Obs per group:
                      min = 2
                      avg = 7.7
                      max = 15
                      
                      LR chi2(0) = -0.00
                      Log likelihood = -3908.5573 Prob > chi2 = .
                      
                      ------------------------------------------------------------------------------
                      c_city | Coefficient Std. err. z P>|z| [95% conf. interval]
                      -------------+----------------------------------------------------------------
                      race |
                      Black | 0 (omitted)
                      Other | 0 (omitted)
                      ------------------------------------------------------------------------------
                      
                      .
                      Kind regards,
                      Carlo
                      (Stata 18.0 SE)

                      Comment


                      • #26
                        Thank you, Carlo, for your welcoming message and reply. My interpretation is that 2.race and 3.race are predictors that are omitted because of no within-group variance. My interpretation of "3,446 groups (18,803 obs) omitted because of all positive or all negative outcomes." is that STATA finds that in 3,446 groups of observations, c_city is either 0 or 1 for all observations within each group. Are my interpretations correct? If yes, my issue is that I'm certain that for each group, there is one and only one observation where c_city=1. Thus, I didn't expect that there are groups (obs) omitted because of all positive/negative outcomes. What could be the reasons? Thank you again for help.

                        Comment


                        • #27
                          Originally posted by Chan Ge View Post
                          Thank you, Carlo, for your welcoming message and reply. My interpretation is that 2.race and 3.race are predictors that are omitted because of no within-group variance. My interpretation of "3,446 groups (18,803 obs) omitted because of all positive or all negative outcomes." is that STATA finds that in 3,446 groups of observations, c_city is either 0 or 1 for all observations within each group. Are my interpretations correct? If yes, my issue is that I'm certain that for each group, there is one and only one observation where c_city=1. Thus, I didn't expect that there are groups (obs) omitted because of all positive/negative outcomes. What could be the reasons? Thank you again for help.
                          a follow-up is that how I may subset the omitted groups (obs) such that I can have a further look into the data.

                          Comment


                          • #28
                            Chan:
                            your interpretations are both correct.
                            However, Stata is right 99% of the times...
                            Kind regards,
                            Carlo
                            (Stata 18.0 SE)

                            Comment


                            • #29
                              Chan: You might try this, where "id" is the cross-sectional identifier and I'm assuming 2001 is the first year in the data (where everyone is present, if it's not balanced):

                              Code:
                               egen yibar = mean(y), by(id)
                              tab yibar if year == 2001
                              You'll see how many units have all zeros or all ones.

                              Comment


                              • #30
                                Thank you Carlo and Jeff. I didn't notice that one of my explanatory variables has missing values in my perceived clean dataset for analyses. That explained the puzzle. I'm sorry for the confusion. Thank you very much for trying to help me figure out the issue.

                                Comment

                                Working...
                                X