Announcement

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

  • test how to post

    #
    HTML Code:
    reg

  • #2
    HTML Code:
    reg

    Comment


    • #3
      HTML Code:
      xtabond2 changeofEDTA_win l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS if gdpCountryName!="United States", gmm(changeofEDTA_win,lag(2 6)) iv(l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win   l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS ,eq(both)) small twostep robust
      est store gmmEDTA_NUS
      
      reg changeofEDTA_win l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS if gdpCountryName!="United States", robust
      est store olsEDTA_NUS
      
      xtabond2 changeofEDTA_win l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization                     i.newBvdAS if gdpCountryName=="United States", gmm(changeofEDTA_win,lag(9 9)) iv(l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win   l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization                     i.newBvdAS ,eq(both)) small twostep robust
      est store gmmEDTA_US
      
      reg changeofEDTA_win l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization                     i.newBvdAS if gdpCountryName=="United States", robust
      est store olsEDTA_US
      
      xtabond2 changeofEDTA_win l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS                                   , gmm(changeofEDTA_win,lag(2 6)) iv(l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win   l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS ,eq(both)) small twostep robust
      est store gmmEDTA
      
      reg changeofEDTA_win l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS                                   , robust
      est store olsEDTA
      
      
      xtabond2 changeofT1R_win l.T1R_tier_1_ratio_win         weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS if gdpCountryName!="United States", gmm(changeofT1R_win,lag(2 6))  iv(l.T1R_tier_1_ratio_win        weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win   l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS ,eq(both)) small twostep robust
      est store gmmT1R_NUS
      
      reg changeofT1R_win l.T1R_tier_1_ratio_win         weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS if gdpCountryName!="United States", robust
      est store olsT1R_NUS
      
      xtabond2 changeofT1R_win l.T1R_tier_1_ratio_win         weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization                     i.newBvdAS if gdpCountryName=="United States", gmm(changeofT1R_win,lag(9 10))  iv(l.T1R_tier_1_ratio_win        weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win   l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization                     i.newBvdAS ,eq(both)) small twostep robust
      est store gmmT1R_US
      
      reg changeofT1R_win l.T1R_tier_1_ratio_win         weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization                     i.newBvdAS if gdpCountryName=="United States", robust
      est store olsT1R_US
      
      xtabond2 changeofT1R_win l.T1R_tier_1_ratio_win         weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS                                   , gmm(changeofT1R_win,lag(2 6))  iv(l.T1R_tier_1_ratio_win        weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win   l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS ,eq(both)) small twostep robust
      est store gmmT1R
      
      reg changeofT1R_win l.T1R_tier_1_ratio_win         weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS                                   , robust
      est store olsT1R
      
      
      local mm olsEDTA gmmEDTA olsEDTA_US gmmEDTA_US olsEDTA_NUS gmmEDTA_NUS olsT1R_NUS gmmT1R_NUS olsT1R_US gmmT1R_US olsT1R gmmT1R
      esttab `mm' using goodsys.csv,mtitle(`mm') scalars(hansenp ar1p ar2p) p compress nogap b(%8.3f) ar2 star( * 0.1 ** 0.05 *** 0.01) replace

      Comment


      • #4
        Code:
        changeofEDTA_win l.EDTA_equity_asset_ratio_win weightdamageratio30d lnTA_win NLDTA_loan_asset_ratio_win  l.netincomeEratio_win customerdepositTAratio_win  realgdpgrowth lnrealGDPpercapita  i.newspecialization i.newcountry i.year i.newBvdAS

        Comment


        • #5
          . xtreg gini_disp kofgi educ urbanpop ln_gdppc ln_gdppc2, fe rob
          Fixed-effects (within) regression Number of obs = 3,299
          Group variable: countrycode Number of groups = 144
          R-sq: Obs per group:
          within = 0.0435 min = 1
          between = 0.0942 avg = 22.9
          overall = 0.0708 max = 46
          F(5,143) = 1.49
          corr(u_i, Xb) = 0.1196 Prob > F = 0.1970
          (Std. Err. adjusted for 144 clusters in countrycode)
          Robust
          gini_disp Coef. Std. Err. t P>t [95% Conf. Interval]
          kofgi .0707516 .0366188 1.93 0.055 -.0016324 .1431357
          educ -.4209632 .4295601 -0.98 0.329 -1.270071 .428145
          urbanpop -.0315681 .0603291 -0.52 0.602 -.1508202 .087684
          ln_gdppc 2.531182 1.701013 1.49 0.139 -.8311967 5.89356
          ln_gdppc2 -.1672039 .1138757 -1.47 0.144 -.3923011 .0578933
          _cons 32.86099 6.423867 5.12 0.000 20.16299 45.559
          sigma_u 7.3176726
          sigma_e 1.6159013
          rho .95350496 (fraction of variance due to u_i)
          . xtreg gini_disp kofgi educ urbanpop ln_gdppc ln_gdppc2, re rob
          Random-effects GLS regression Number of obs = 3,299
          Group variable: countrycode Number of groups = 144
          R-sq: Obs per group:
          within = 0.0434 min = 1
          between = 0.0969 avg = 22.9
          overall = 0.0746 max = 46
          Wald chi2(5) = 8.06
          corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.1531
          (Std. Err. adjusted for 144 clusters in countrycode)
          Robust
          gini_disp Coef. Std. Err. z P>z [95% Conf. Interval]
          kofgi .0727676 .0350403 2.08 0.038 .0040899 .1414453
          educ -.4612618 .3936158 -1.17 0.241 -1.232735 .310211
          urbanpop -.0306938 .0558209 -0.55 0.582 -.1401006 .0787131
          ln_gdppc 2.541403 1.69703 1.50 0.134 -.7847153 5.867521
          ln_gdppc2 -.1656411 .1133269 -1.46 0.144 -.3877578 .0564757
          _cons 32.06784 6.391649 5.02 0.000 19.54044 44.59524
          sigma_u 7.0196948
          sigma_e 1.6159013
          rho .94967672 (fraction of variance due to u_i)

          Comment


          • #6
            Dear All,

            I am stuck trying to looping through every observation from one dataset and map the results across another dataset. I'm really hoping someone can guide me through this:

            I have 2 datasets. One contains the search terms for the various medications and their classification categories (dataset A) and the other contains the inpatient medications ordered by the doctors for each patient (dataset B). What I need to do is to map the medicine classification to the medications ordered for the patients and generate a new variable "Classification" to capture the classification categories (example C)

            Dataset A

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input str46 searchterm1 str13 searchterm2 str7 searchterm3 str25 recodeas str27 intermediateclassification
            "Metformin"                   "Glucophage"    "" "Metformin non-XR" "Metformin"    
            "Metformin XR"                "Glucophage XR" "" "Metformin XR"     "Metformin"    
            "Pioglitazone"                "Actos"         "" "Pioglitazone"     "TZD"          
            "Rosiglitazone"               "Avandia"       "" "Rosiglitazone"    "TZD"          
            "Rosiglitazone AND metformin" "Avandamet"     "" "Avandamet"        "TZD-metformin"
            "MICU Intensive IV insulin"   ""              "" "MICU IVSI scale"  "Sliding scale"
            "MICU subcutaneous insulin"   ""              "" "MICU SCSI scale"  "Sliding scale"
            end

            Dataset B

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input long ïCaseNo str229 OrderMeditation
            1514762004 "Iron Polymaltose (Elemental Iron 50mg/mL)  Drops"                                   
            1514762004 "Lynae Vitamin D [Colecalciferol 1,000 unit, Calcium 149mg]  Tablet"                 
            1514762004 "MICU Subcutaneous Insulin - Titrate per protocol Insulin Soluble 1,000unit/10mL Inj"
            1514762004 "Metformin HCl  Tablet"                                                              
            1514762004 "Metformin HCl XR 500mg Tablet"                                                      
            1514762004 "Myotein [Protein Supplement]  Powder"                                               
            end

            Final dataset

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input long ïCaseNo str229 OrderMeditation float(ohga slidingscale)
            1514762004 "Iron Polymaltose (Elemental Iron 50mg/mL)  Drops"                                    0 0
            1514762004 "Lynae Vitamin D [Colecalciferol 1,000 unit, Calcium 149mg]  Tablet"                  0 0
            1514762004 "MICU Subcutaneous Insulin - Titrate per protocol Insulin Soluble 1,000unit/10mL Inj" 0 1
            1514762004 "Metformin HCl  Tablet"                                                               1 0
            1514762004 "Metformin HCl XR 500mg Tablet"                                                       1 0
            1514762004 "Myotein [Protein Supplement]  Powder"                                                0 0
            end

            I know how to manually go through the list of the medications and their search term(s) using the following codes:

            Code:
            gen ohga = strpos(lower(OrderMeditation), "metformin") > 0
            gen slidingscale = strpos(lower(OrderMeditation), "micu subcutaneous insulin") > 0
            
            end
            However, that will take really long since I have a total 104 observations in Dataset A to go through. Can someone help me please? Thanks.


            Warmest regards,
            Maudrene

            Comment

            Working...
            X