Announcement

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

  • Different Results every time I run the regression

    Dear all,

    I am having this problem in Stata where whenever I run the regressions, I get different results. I checked online for help and particularly Statalist entries and at most places it is said that it might be a sorting by group problem. However, nowhere in my code, I sort the data.

    I am thinking perhaps my data row entries are not unique and that is causing the problem. Is this possible?

    In any case, this is my sample data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str5 bench int yeardecision byte StateWins float caselag double(NewJudges_TotalJudges ProbRetirement) float DoB int serial_no float AgeatAppointment byte Former_Lawyer int yearfiled byte judge_number str1 AFR byte(criminal pagesjudgenum)
    "abohc" 2009 1 6                 0                  0  -1098 5987 51.85763 1 2003 3 ""  0  8
    "abohc" 2014 0 8 .6666666666666666  .7777777777777778      . 2176        . 1 2006 3 "0" 0  1
    "abohc" 2014 0 1 .6666666666666666  .7777777777777778  -2448 4132 60.42984 1 2013 1 ""  0  5
    "abohc" 2015 1 1 .6666666666666666  .7777777777777778   3397 2858 45.82888 1 2014 1 ""  0  6
    "abohc" 2011 0 3 .5555555555555556  .6666666666666666   -179 3736  50.6256 1 2008 1 ""  0  3
    "abohc" 1991 . .                 0                  0      .    .        . .    . . ""  .  .
    "abohc" 2014 0 3 .6666666666666666  .7777777777777778  -2172 1904 57.43464 1 2011 3 "1" 0 14
    "abohc" 1990 1 5                 0                  0 -11662 5944 53.88912 1 1985 1 "0" 0 28
    "abohc" 2013 0 3 .6666666666666666  .7777777777777778  -1461 3221 54.13552 0 2010 1 "1" 0  1
    "banhc" 1994 0 5                 0                  0  -9446 2935 60.45174 1 1989 3 "0" 0 20
    "banhc" 2014 1 1 .3076923076923077 .38461538461538464   2768 5997 46.64202 1 2013 1 "0" 0  2
    "banhc" 2015 0 5 .5384615384615384  .6153846153846154  -2393  133 58.86379 1 2010 1 ""  0  8
    "banhc" 2009 1 6                 0                  0  -2946 4171 39.28268 1 2003 1 "0" 0 18
    "banhc" 2001 1 3                 0                  0  -4065 1015 46.90212 1 1998 1 "1" 0 11
    "banhc" 2015 0 1 .5384615384615384  .6153846153846154    472 6336 51.25804 1 2014 1 ""  0  9
    "banhc" 1991 0 2                 0                  0 -11017 4636 55.46612 1 1989 1 "0" 0 23
    "banhc" 1986 1 0                 0                  0      .  317        . 1 1986 2 "1" 1 12
    "banhc" 2007 1 8                 0                  0  -3699 5372 52.78029 1 1999 1 "1" 0  5
    "banhc" 1990 1 0                 0                  0  -9771  801 56.93634 1 1990 3 "0" 0 12
    end
    format %td DoB

    And I am running the regression of the following form which gives different results everytime:

    Code:
    global controls_case AgeatAppointment Former_Lawyer yearfiled judge_number  AFR criminal  pagesjudgenum 
    ivregress 2sls StateWins (NewJudges_TotalJudges= ProbRetirement) i.yeardecision i.district_bench##c.yeardecision $controls_case, vce(cluster district_bench)


    Any help in this regard will really be appreciated. Thank you.

    Cheers,
    Roger
    Last edited by Roger More; 06 Dec 2018, 04:23.

  • #2
    It would be helpful if you showed the actual Stata output over two or more regressions. Also, the variable "district_bench" is lacking in your dataex example.

    Comment


    • #3
      My apologies for the missing district_bench variable, its constructed as follows:

      encode bench, generate(district_bench)
      *So to run the file, we activate the globals and run the regression global controls_case AgeatAppointment Former_Lawyer yearfiled judge_number AFR criminal pagesjudgenum ivregress 2sls StateWins (NewJudges_TotalJudges= ProbRetirement) i.yeardecision i.district_bench##c.yeardecision $controls_case, vce(cluster district_bench)
      Running this on my full data gives the following output the first time,

      Click image for larger version

Name:	Regression Iteration 1.JPG
Views:	1
Size:	48.4 KB
ID:	1473717

      Now, when I rerun the whole data preparation file again which is two 1:m merges and renaming of variables, and THEN run the very same regression again I get different coefficient e.g. second time I got this:

      Click image for larger version

Name:	Regression Iteration 2.JPG
Views:	1
Size:	49.4 KB
ID:	1473718


      Comment


      • #4
        Now, when I rerun the whole data preparation file again which is two 1:m merges and renaming of variables, and THEN run the very same regression again I get different coefficient e.g. second time I got this:
        My guess is that something changes in the data preparation phase. You still do not share the full sequence of commands that you entered and the resulting Stata output (it's just a simple matter of copy and paste). We need to see the full output and not just one coefficient, i.e., all commands entered including when preparing the data, and resulting output. Enclose these within CODE delimiters.

        Comment


        • #5
          I would compare the two data sets generated and see if they really are identical.

          Are there any sort commands in the file generation process? Any creation of variables with a random component, e.g. using the uniform function? Things like that can cause replicability problems.

          You might try adding

          set seed 123456

          at the beginning of your commands and then see if you get the same results.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          Stata Version: 17.0 MP (2 processor)

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

          Comment


          • #6
            Dear Andrew,

            Thanks so much for the reply. That is correct, something might be wrong in data preparation. Short summary of code I provide below (actual full code is in the end):
            Code:
            use ".\Input\CaseYearData.dta", clear
            
            *Merge  datasets
            merge m:1 judgename using ".\Input\Judge_Characteristics.dta" //characteristics have even more judges than our case data judges
            
            
            *Harmonzie variable names across datasets
            rename After_Reform19April2010 AfterReformJudge
            label variable AfterReformJudge "Judge appointed after the reform"
            label variable Retirement_Age "Judge who retired at mandatory retirement age"
            rename AppointingPresidentorComission AppointingBody
            label variable AppointingBody "Appointing President or Judicial Comission Identifier
            save ".\Input\CaseYearDataWithJudgeWithShrines.dta", replace
            
            use ".\Input\CaseYearDataWithJudgeWithShrines.dta", replace
            encode bench, generate(district_bench) 
            global controls_case AgeatAppointment Former_Lawyer yearfiled judge_number AFR criminal pagesjudgenum
            
            ivregress 2sls StateWins (NewJudges_TotalJudges= ProbRetirement) i.yeardecision i.district_bench##c.yeardecision $controls_case, vce(cluster district_bench) 
            
            
            "
            the full Stata output is difficult to present as it is time and district fixed effects and few controls but nevertheless, I present them here.

            First iteration:
            Click image for larger version

Name:	Regression Iteration 1.JPG
Views:	1
Size:	61.6 KB
ID:	1473765


            Rerunning the data preperation and regressing again, the following output is obtained:

            Click image for larger version

Name:	Regression Iteration 2.JPG
Views:	1
Size:	81.8 KB
ID:	1473766




            Kind Regards,
            Roger
            P.S: The code provided is not complete since it is a lot and I thought perhaps it would be too time consuming for you to go through it. In any case, here I also copy paste the ENTIRE code for data preparation:

            Code:
            *Set directory and import data
            cd "F:\Judicial Independence in the Long Run\"
            *import excel ".\Input\Combined_1986-2016.xlsx", sheet("Data") firstrow clear
            *import excel ".\Input\Combined_1990-2016_3300_cases.xlsx", sheet("Data") firstrow clear
            import excel ".\Input\Combined_1986-2016_test1.xlsx", sheet("Data") firstrow clear
            
            
            *Construct case lag variable
            rename Judgename judgename
            drop caselag
            generate caselag = yeardecision - yearfiled
            *destring pagesjudgenum, replace  force 
            
            *Replacing redundant city strings, harmonzing to common district high court 
            
            replace bench= "islhc" if inlist(bench,"isbhc","isdhc") /*Equivalient code: replace bench = "islhc" if bench == "isdhc" | bench == "isbhc"*/
            replace bench = "karhc" if inlist(bench, "sinhc", "khrhc")
            replace bench = "banhc" if bench == "banbhc" 
            replace bench = "sukhc" if bench == "Sukhc"
            replace bench = "dikhc" if bench == "dIKhc"
            replace bench = "sawhc" if bench == "Sawhc"
            tab bench
            
            
            *Removing leading and trailing blanks in judgename string
            set more off 
            tab judgename
            replace judgename = strtrim(judgename) 
            
            
            *Remove extra internal blanks
            replace judgename = stritrim(judgename)
            
            *Converts names in proper format e.g. strproper("mR. joHn a. sMitH") = "Mr. John A. Smith"
            replace judgename = proper(judgename)
            tab judgename
            
            *Check Maximum, Minimum, Mean for Sanity Check
            sum caselag StateWins 
            
            *Some data entry mistakes 
            capture ssc install extremes //installing extremes program
            extremes caselag, n(5)
            
            *Remove extra internal blanks and within blanks for judgenames
            replace judgename = strtrim(judgename) 
            replace judgename = stritrim(judgename)
            
            
            *Summary Statistics of variable //see lawyers and judge number why are they zero?
            sum _all
            
            *Save data in Stata format
            capture save ".\Input\CaseYearData.dta", replace
            
            **********************************************************************************
            ****************Combine with Judge characteristics Data***************************
            **********************************************************************************
            
            *Import Data
            import excel ".\Input\Judge_Characteristics.xlsx", sheet("Sheet1") firstrow clear
            
            *Rename Data to match both datasets (case data baseline)
            rename JudgeName judgename 
            
            
            *Removing leading and trailing blanks in judgename string
            set more off 
            tab judgename
            replace judgename = strtrim(judgename) 
            *Remove extra internal blanks
            replace judgename = stritrim(judgename)
            *Converts names in proper format e.g. strproper("mR. joHn a. sMitH") = "Mr. John A. Smith"
            replace judgename = proper(judgename)
            tab judgename
            
            
            *duplicates drop 
            duplicates report 
            capture save ".\Input\Judge_Characteristics.dta", replace
            
            
            ***Come back to case data to combine with judge data
            use ".\Input\CaseYearData.dta", clear
            
            *Merge both datasets
            merge m:1 judgename using ".\Input\Judge_Characteristics.dta" 
            
            
            *Harmonzie variable names across datasets
            rename After_Reform19April2010 AfterReformJudge
            label variable AfterReformJudge "Judge appointed after the reform"
            label variable Retirement_Age "Judge who retired at mandatory retirement age"
            rename AppointingPresidentorComission AppointingBody
            label variable AppointingBody "Appointing President or Judicial Comission Identifier"
            order yeardecision judgename StateWins caselag AfterReformJudge Retirement_Age AppointingBody Gender DOB DOA DOR AppointmentYear
            
             
            *generate dates based  days to 1Jan1960
            gen DoB = date(DOB, "MDY")
            gen DoA = date( DOA , "MDY")
            gen DoR = date( DOR , "MDY")
            
            *loop to take out spaces from date
            foreach var of varlist DOB DOA DOR {
            replace `var' = strtrim(`var')
            }
            
            *Formatting to see non-day visualization to see the variable
            format DoB %td
            format DoA %td
            label variable DoB "stata readable DoB"
            label variable DoA "stata readable DoA"
            label variable DoR "stata readable DoR"
            
            *Age at Appointment variable in years
            generate AgeatAppointment = (DoA- DoB)/365.25
            label variable AgeatAppointment "Age in Years"
            
            *Age at Decision
            gen YearofBirth = year(DoB)
            generate AgeatDecision = (yeardecision - YearofBirth)
            
            *Tenure or Experience at Decision 
            generate TenureatDecision = yeardecision - AppointmentYear
            
            sum AgeatAppointment AgeatDecision TenureatDecision 
            
            *Save dataset with judge_characteristics Data
            capture save ".\Input\CaseYearDataWithJudge.dta", replace
            
            
            
            capture drop _merge
            save ".\Input\CaseYearDataWithJudge.dta", replace
            
            
            ********************************************************************************
            ********************SHRINES and JUDICIARY***************************************
            ********************************************************************************
            
            ***Making Shrine data with benches in the district
            use "F:\Judicial Independence in the Long Run\Input\shrines_punjab_sind", clear
            capture gen tehsil_lowercase =lower(tehsil)
            capture gen district_lowercase =lower(district)
            *sindh data for shriens was in pdg_pt_31 no_pdg
            rename no_pdg No_Shrines_all //sindh and punjab number of shrines
            rename pdg_pt_31 shrinepc_all //sindh and punjab shrines per 1000 people
            label variable No_Shrines_all  "Number of Shirines of tehsil for sindh & punjab"
            label variable shrinepc_all "Number of Shirines per 1000 ppl for sindh & punjab"
            order year district tehsil No_Shrines_all shrinepc_all
            
            egen No_Shrines_all_distr = sum(No_Shrines_all), by(district_lowercase)
            egen total_pop_distr = sum(total_pop), by(district_lowercase)
            gen shrinesper1000 = (No_Shrines_all_distr *1000)/ (total_pop_distr) //as without 1000 would be shrine per person
            *sort district_lowercase
            label variable shrinesper1000 "Shrines per 1000 people in district"
            
            /* district
            
            global numerical_variable_dist  year district tehsil No_Shrines_all shrinepc_all total_pop males_pop females_pop total_lit males_lit females_lit _area No_Shrines_all shrinepc_all total_pop males_pop females_pop total_lit males_lit females_lit _area No_Shrines Total_HH_hf BPsch2kless BPsch2to5k BPsch5kmore GPsch2kless GPsch2to5k GPsch5kmore HistLitRate Hindu AdDharmi Jain Sikh Muslim Other NahriC SailabC AbiC TCul agr_mus pol_shrine no_vill_zam no_vill_patt no_vill_bhay no_vill_comzam no_vill_imp_bhaypatt no_vill_inc_bhay no_vill_gov total_vill tot_lit male_lit female_lit
            foreach var of varlist $numerical_variable_dist  {
            egen `var'_district = sum(`var'), by(district_lowercase)
            }
             */ 
            **Generate bench string
            
            generate bench = ""
            replace bench = "lhrhc" if district_lowercase == "lahore" 
            replace bench = "mulhc" if district_lowercase == "multan" 
            replace bench = "banhc" if district_lowercase == "bahawalpur"
            replace bench = "rwphc" if district_lowercase == "rawalpindi"
            *replace bench = "dikhc" if district_lowercase == "d.g.khan"
            replace bench = "karhc" if district_lowercase == "karachi"
            replace bench = "larhc" if district_lowercase =="larkana"
            replace bench = "hydhc" if district_lowercase == "hyderabad"
            replace bench = "sukhc" if district_lowercase == "sukkur"
            order  district_lowercase bench year  No_Shrines_all shrinesper1000
            
            keep bench shrinesper1000 No_Shrines_all_distr total_pop_distr
            duplicates drop
            drop if bench == "" //since missing benches had different shrine number values
            by bench, sort: assert _N == 1 //verifies that the number of shrines is always the same for any given bench. 
            
            save ".\Input\shrines_only.dta", replace
            *br district_lowercase bench  tehsil No_Shrines_all No_Shrines_all_distr  total_pop  total_pop_distr shrinesper1000
            
            
            ***Open judges data and MERGE with shrines
            use ".\Input\CaseYearDataWithJudge.dta", replace
            capture generate year =.
            replace year = yeardecision
            capture drop _merge
            merge m:1 bench using ".\Input\shrines_only.dta"
            save ".\Input\CaseYearDataWithJudgeWithShrines.dta", replace
            
            
            ***Merge Judge/Total Variables With shrines***
            
            
            **Importing Reform Exposure Dummy Variable along WITH REFORM INTENSITY
            import excel ".\Input\totaljudges_benchyear_annualreports.xlsx", sheet("Sheet1") firstrow clear
            save ".\Input\ExposureDummy.dta", replace
            
            ***Merge Exposure Dummy AND INTENSITY, Prob retirement with District Year Panel
            use ".\Input\CaseYearDataWithJudgeWithShrines.dta", clear 
            drop _merge*
            merge m:1 yeardecision bench using ".\Input\ExposureDummy.dta"
            set more off 
            order bench yeardecision  StateWins caselag Appointed2010Total RetiredTotal_2010 AppointedTotal_1986 RetiredTotal_1986 TotalJudges Judges_Appointed Judges_Retired NumberNewJudges_2010 NumberNewJudges_1986 Judges_Retired_2010 Judges_Retired_1986 AgeatAppointment
            
            
            save ".\Input\CaseYearDataWithJudgeWithShrines.dta", replace
             
            ***Export goverment shrines from excel
            import excel ".\Input\Gov_Shrines.xlsx", sheet("Sheet1") firstrow clear
            replace bench = strtrim(bench) 
            save ".\Input\Gov_Shrines.dta", replace 
            
            **Merge government shrines with main data
            use ".\Input\CaseYearDataWithJudgeWithShrines.dta", replace
            drop _merge*
            merge m:1 bench using "F:\Judicial Independence in the Long Run\Input\Gov_Shrines.dta", update //update actualyl updates missing values of same-named variables in master with values from using
            replace gov_archives = 0 if gov_archives ==. & !missing(bench) 
            
            
            **Coup variables and interaction term
             generate coup1999 = 0
             replace coup1999 = 1 if year>=1999
             replace  shrinesper1000 = (No_Shrines_all_distr *1000)/ (total_pop_distr) //to incporate the new districts
             generate shrinesper1000Xcoup1999 = shrinesper1000*coup1999
             
             generate LG2001 = 0
             replace LG2001 = 1 if yeardecision>=2001
             generate shrinesper1000XLG2001  = shrinesper1000*LG2001
             generate shrinesper1000XLG2001XNewJud_Tot = shrinesper1000XLG2001*Appointed2010Total
             encode  bench, generate(district_bench)
             
             save ".\Input\CaseYearDataWithJudgeWithShrines.dta", replace

            Comment


            • #7
              Going through your code, I see no obvious reason that explains the different results. You have the same set of variables dropped in both regressions, but I wonder whether encode assigns the same values across repetitions so that

              16.district_bench#c.yeardecision omitted because of collinearity
              is the same variable in both cases. I would follow Richard's advice and get a summary of the variables just before running the regression, i.e., include

              Code:
              encode  bench, generate(district_bench)
              summarize

              Then compare the summary statistics over the two runs. Any differences will help you narrow down the source of the discrepancy.

              Comment


              • #8
                Dear Andrew,

                Thanks a lot for this, I have tried Dr. Richard's advice of seeding (it still gives different results for IV estimation) and also your advice of checking if I get 16 unique encoded numbers for the 16 district strings.

                I see indeed I have 16 district numerics in front of the unique string e.g. district abohc is always encoded 1 for all years and banhc encoded 2 for all years. So that seems fine where district and district_bench assign same values across repetitions . Also summarizing gives the following:
                Click image for larger version

Name:	Summarize.JPG
Views:	1
Size:	13.3 KB
ID:	1473784




                However, the discrepancy is coming from IV estimation, perhaps this way of doing an IV with fixed effects etc is causing some problems:

                For instance, when I estimate:

                Code:
                regress StateWins NewJudges_TotalJudges i.yeardecision i.district_bench##c.yeardecision $controls_case $controls_judge $controls_district, vce(cluster district_bench)
                
                *or
                
                regress StateWins ProbRetirement i.yeardecision i.district_bench##c.yeardecision $controls_case $controls_judge $controls_district, vce(cluster district_bench)
                I GET the same results every time I re-prepare the data. So, OLS I get same results.

                However, when I run IV estimation I get different results every time I re-run the data preparation file, so different results when I do this:
                Code:
                ivregress 2sls StateWins (NewJudges_TotalJudges= ProbRetirement) i.yeardecision i.district_bench##c.yeardecision $controls_case $controls_judge $controls_district, vce(cluster district_bench)
                I ALWAYS get different results. So how can this IV estimation be doing this? Do you have any hunches on that?

                Again, thanks a lot for reading this and replying on the detailed code.

                Cheers,
                Roger
                Last edited by Roger More; 06 Dec 2018, 14:04.

                Comment


                • #9
                  Also summarizing gives the following:
                  I mean summarizing all variables used in the regression and comparing if they are the same.

                  I ALWAYS get different results. So how can this IV estimation be doing this? Do you have any hunches on that?
                  What happens if you run the command twice without reconstituting the sample?

                  Code:
                   ivregress 2sls StateWins (NewJudges_TotalJudges= ProbRetirement) i.yeardecision i.district_bench##c.yeardecision $controls_case $controls_judge $controls_district, vce(cluster district_bench)  
                   ivregress 2sls StateWins (NewJudges_TotalJudges= ProbRetirement) i.yeardecision i.district_bench##c.yeardecision $controls_case $controls_judge $controls_district, vce(cluster district_bench)
                  If you get the same results, then the issue is not the IV estimator but the inputs.

                  Comment


                  • #10
                    Dear Andrew,

                    Thanks again.

                    The summarize on all variables give same averages, sd etc...

                    Running the command twice without reconstituting the sample gives the same results.

                    Furthermore, what is most bizarre is that the first stage IV has same results always; only the second stage gives different results.
                    so if I do the following command two times

                    Code:
                     
                     ivregress 2sls StateWins (NewJudges_TotalJudges= ProbRetirement) , first
                    I see first stage all coefficients are same but only in the second stage there is difference in the reconstituted sample.

                    Does that give any idea what might be wrong?

                    Kind Regards,

                    Comment


                    • #11
                      If you can share your data set and do files privately, I can try to figure out what is going on. You will find my email on my web page, linked to my Statalist profile.

                      Comment


                      • #12
                        My generic advice is to make sure your version of Stata is up to date. If you are lucky whatever is causing your problem is a bug that has been fixed. Type
                        Code:
                        update all
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        Stata Version: 17.0 MP (2 processor)

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

                        Comment


                        • #13
                          To close out this thread, the OP did share his data sets and do file with me. I ran the do file for each of the three IV models ten times using the following commands, combining these with esttab (Stata Journal; Ben Jann), and did not find any differences in coefficients between runs.


                          Code:
                          version 15.1
                          forval i= 1/10{
                          do "C:\Users\709554\Desktop\dofile.do"
                          est sto est`i'
                          }
                          esttab est*
                          I tested this across different versions, up to Stata 11, but the results do not change. Therefore, the problem is user-specific, and as suggested by Richard Williams , the OP should update his Stata installation or contact technical services if the updates do not sort out the issue. Part of the esttab results are shown below since the full output is too large to present.


                          Code:
                          *IV MODEL 1
                          esttab est*
                          
                          ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                (1)             (2)             (3)             (4)             (5)             (6)             (7)             (8)             (9)            (10)   
                                          StateWins       StateWins       StateWins       StateWins       StateWins       StateWins       StateWins       StateWins       StateWins       StateWins   
                          ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                          NewJudges_~s       -0.458**        -0.458**        -0.458**        -0.458**        -0.458**        -0.458**        -0.458**        -0.458**        -0.458**        -0.458** 
                                            (-2.68)         (-2.68)         (-2.68)         (-2.68)         (-2.68)         (-2.68)         (-2.68)         (-2.68)         (-2.68)         (-2.68)   
                          
                          1986.yeard~n            0               0               0               0               0               0               0               0               0               0   
                                                (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)   
                          
                          1987.yeard~n      -0.0311         -0.0311         -0.0311         -0.0311         -0.0311         -0.0311         -0.0311         -0.0311         -0.0311         -0.0311   
                                            (-0.41)         (-0.41)         (-0.41)         (-0.41)         (-0.41)         (-0.41)         (-0.41)         (-0.41)         (-0.41)         (-0.41)   
                          
                          1988.yeard~n      0.00230         0.00230         0.00230         0.00230         0.00230         0.00230         0.00230         0.00230         0.00230         0.00230   
                                             (0.05)          (0.05)          (0.05)          (0.05)          (0.05)          (0.05)          (0.05)          (0.05)          (0.05)          (0.05)   
                          
                          1989.yeard~n       0.0353          0.0353          0.0353          0.0353          0.0353          0.0353          0.0353          0.0353          0.0353          0.0353   
                                             (0.65)          (0.65)          (0.65)          (0.65)          (0.65)          (0.65)          (0.65)          (0.65)          (0.65)          (0.65)   
                          
                          1990.yeard~n       0.0930          0.0930          0.0930          0.0930          0.0930          0.0930          0.0930          0.0930          0.0930          0.0930   
                                             (1.89)          (1.89)          (1.89)          (1.89)          (1.89)          (1.89)          (1.89)          (1.89)          (1.89)          (1.89)   
                          
                          1991.yeard~n       0.0125          0.0125          0.0125          0.0125          0.0125          0.0125          0.0125          0.0125          0.0125          0.0125   
                                             (0.31)          (0.31)          (0.31)          (0.31)          (0.31)          (0.31)          (0.31)          (0.31)          (0.31)          (0.31)

                          Code:
                          *IV MODEL 2
                          esttab est*
                          
                          ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                (1)             (2)             (3)             (4)             (5)             (6)             (7)             (8)             (9)            (10)   
                                            caselag         caselag         caselag         caselag         caselag         caselag         caselag         caselag         caselag         caselag   
                          ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                          NewJudges_~s       -1.359          -1.359          -1.359          -1.359          -1.359          -1.359          -1.359          -1.359          -1.359          -1.359   
                                            (-1.54)         (-1.54)         (-1.54)         (-1.54)         (-1.54)         (-1.54)         (-1.54)         (-1.54)         (-1.54)         (-1.54)   
                          
                          1986.yeard~n            0               0               0               0               0               0               0               0               0               0   
                                                (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)   
                          
                          1987.yeard~n       0.0422          0.0422          0.0422          0.0422          0.0422          0.0422          0.0422          0.0422          0.0422          0.0422   
                                             (0.23)          (0.23)          (0.23)          (0.23)          (0.23)          (0.23)          (0.23)          (0.23)          (0.23)          (0.23)   
                          
                          1988.yeard~n      -0.0626         -0.0626         -0.0626         -0.0626         -0.0626         -0.0626         -0.0626         -0.0626         -0.0626         -0.0626   
                                            (-0.27)         (-0.27)         (-0.27)         (-0.27)         (-0.27)         (-0.27)         (-0.27)         (-0.27)         (-0.27)         (-0.27)   
                          
                          1989.yeard~n       -0.307          -0.307          -0.306          -0.307          -0.307          -0.307          -0.307          -0.307          -0.307          -0.307   
                                            (-0.91)         (-0.91)         (-0.91)         (-0.91)         (-0.91)         (-0.91)         (-0.91)         (-0.91)         (-0.91)         (-0.91)   
                          
                          1990.yeard~n       -0.251          -0.251          -0.251          -0.251          -0.251          -0.251          -0.251          -0.251          -0.251          -0.251   
                                            (-0.77)         (-0.77)         (-0.77)         (-0.77)         (-0.77)         (-0.77)         (-0.77)         (-0.77)         (-0.77)         (-0.77)   
                          
                          1991.yeard~n       -0.598***       -0.598***       -0.598***       -0.598***       -0.598***       -0.598***       -0.598***       -0.598***       -0.598***       -0.598***
                                            (-5.73)         (-5.73)         (-5.73)         (-5.73)         (-5.73)         (-5.73)         (-5.73)

                          Code:
                          *IV MODEL 3
                          esttab est*
                          
                          ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                (1)             (2)             (3)             (4)             (5)             (6)             (7)             (8)             (9)            (10)   
                                              Merit           Merit           Merit           Merit           Merit           Merit           Merit           Merit           Merit           Merit   
                          ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                          NewJudges_~s        0.192           0.192           0.192           0.192           0.192           0.192           0.192           0.192           0.192           0.192   
                                             (0.91)          (0.91)          (0.91)          (0.91)          (0.91)          (0.91)          (0.91)          (0.91)          (0.91)          (0.91)   
                          
                          1986.yeard~n            0               0               0               0               0               0               0               0               0               0   
                                                (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)             (.)   
                          
                          1987.yeard~n      -0.0218         -0.0218         -0.0218         -0.0218         -0.0218         -0.0218         -0.0218         -0.0218         -0.0218         -0.0218   
                                            (-0.44)         (-0.44)         (-0.44)         (-0.44)         (-0.44)         (-0.44)         (-0.44)         (-0.44)         (-0.44)         (-0.44)   
                          
                          1988.yeard~n      -0.0891         -0.0891         -0.0891         -0.0891         -0.0891         -0.0891         -0.0891         -0.0891         -0.0891         -0.0891   
                                            (-1.56)         (-1.56)         (-1.56)         (-1.56)         (-1.56)         (-1.56)         (-1.56)         (-1.56)         (-1.56)         (-1.56)   
                          
                          1989.yeard~n      0.00290         0.00290         0.00290         0.00290         0.00289         0.00290         0.00290         0.00289         0.00289         0.00289   
                                             (0.06)          (0.06)          (0.06)          (0.06)          (0.06)          (0.06)          (0.06)          (0.06)          (0.06)          (0.06)   
                          
                          1990.yeard~n      -0.0175         -0.0175         -0.0175         -0.0175         -0.0175         -0.0175         -0.0175         -0.0175         -0.0175         -0.0175   
                                            (-0.50)         (-0.50)         (-0.50)         (-0.50)         (-0.50)         (-0.50)         (-0.50)         (-0.50)         (-0.50)         (-0.50)   
                          
                          1991.yeard~n      -0.0468         -0.0468         -0.0468         -0.0468         -0.0468         -0.0468         -0.0468         -0.0468         -0.0468         -0.0468   
                                            (-1.07)         (-1.07)         (-1.07)         (-1.07)         (-1.07)         (-1.07)         (-1.07)         (-1.07)         (-1.07)         (-1.07)

                          Comment


                          • #14
                            Hello, Good evening to all.

                            Could you please anyone explain how can I interpret the coefficient in my regression.
                            where dependent variable is log-transformed and independent variable is binary. Like

                            ln(y)=.9923+1.2397X where X is binary. In IV set up, I am following three steps: 1) run probit, 2) predict uhat and 3) ivreg2


                            Does the impact of X on Y is 1.2397%?

                            with best regrads
                            Rayhan

                            Comment


                            • #15
                              Hi Mohammad. Welcome to Statalist.

                              You should start a new thread rather than add to an unrelated one. People who can answer your question may never see it buried here. Showing your code and output is also recommended. See pt 12 in the Forum FAQ about asking questions effectively.
                              -------------------------------------------
                              Richard Williams, Notre Dame Dept of Sociology
                              Stata Version: 17.0 MP (2 processor)

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

                              Comment

                              Working...
                              X