Announcement

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

  • Univariate Analysis using pooled regression model

    Hello Forum,
    I am trying to do univariate analysis using pooled regression model something similar to the picture I attached below. My dependent variable is CAR_3day and my independent variable is MaleDirectors>mean for PanelA and Related which is a dummy variable for PanelB. I have tried using
    Code:
     bysort related: regress CAR_3day
    . If i used the above code the regression it gives constant is that my univariate analysis ? If its wrong can you correct me with regards to it and i am attaching my dataset. I would also like to create table something similar to the picture giving PanelA , PanelB and find mean difference pvalues too and want to extract it to docx.

    Thank You.

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float CAR_3day double MaleDirectors float(related CashDummy StockDummy)
       -.0315837             88.89 0 1 0
       -.0395705             71.43 0 1 0
        .0299039                75 0 1 0
     .0044030994             88.89 0 1 0
    -.0044768997             76.92 0 1 0
        .0568158             69.23 0 1 0
         .032804             81.82 0 1 0
        .0074759             84.62 0 1 0
       -.0370614                75 0 1 0
       -.0094126             66.67 0 1 0
       -.0291507              87.5 0 1 0
       -.0429876 85.71000000000001 0 1 0
       -.0283563             72.73 0 0 0
        .0051895             92.31 0 0 0
      .006335799             77.78 0 1 0
        .0816481                80 0 1 0
        -.021326                80 0 1 0
        -.167867               100 0 1 0
       -.0053034             83.33 0 1 0
       -.0164385             66.67 0 1 0
        -.008573             77.78 0 1 0
       -.0364541               100 0 1 0
      .003505301             66.67 0 1 0
     -.005914497             81.82 0 0 1
       -.0091995                90 0 1 0
       -.0324181 85.71000000000001 0 1 0
       -.0152041             76.92 0 0 1
        .0276691             90.91 0 1 0
       -.0069552                70 0 1 0
     .0034593004             72.73 0 1 0
        .0559394             77.78 0 1 0
        -.043221             72.73 0 1 0
        .0324173               100 0 1 0
       -.0194387               100 0 1 0
        .0178035                80 0 1 0
       -.0303852             81.82 0 1 0
       -.0244759               100 0 1 0
      .007150301             90.91 0 1 0
        .0073977             77.78 0 1 0
         -.00679                80 0 1 0
         .091206 85.71000000000001 0 1 0
       -.0089546             84.62 0 1 0
       -.0098249             88.89 0 1 0
       -.0989406             83.33 0 1 0
       -.1629119               100 0 0 1
        .0150797             66.67 0 1 0
     -.011819702                80 0 0 1
        .0143336             77.78 0 1 0
        .0384517             84.62 0 1 0
        .0394686                80 0 1 0
        .0141193               100 0 1 0
        .0341748               100 0 1 0
    -.0001912997             88.89 0 1 0
     -.018030599                80 0 1 0
         .013324             86.67 0 1 0
     -.008438899             72.73 0 1 1
     .0013928006             72.73 0 1 0
       -.0049285                90 0 1 0
       -.0327929                80 0 1 0
        -.023208               100 0 1 0
        .0475001                90 0 1 0
         .012225             66.67 0 1 0
       -.0891569             77.78 0 1 0
       -.0320848             77.78 0 1 0
       -.2909848               100 0 1 0
        .0112843             81.82 0 1 0
       -.0285692             77.78 0 1 0
       -.0032485             92.31 0 1 0
        .0196747               100 0 1 0
     -.002373899             84.62 0 1 0
      .011080801             72.73 0 1 0
       -.0164854                75 0 1 0
        .0567969                75 0 1 0
      .004811801                80 0 1 0
      .018044401                90 0 1 0
       -.0612219                90 0 1 0
       -.0363363             88.89 0 1 0
        .0013105             88.89 0 1 0
       -.0568346             91.67 0 0 1
       -.5150018              87.5 0 1 0
        .0093399             77.78 0 1 0
        .0245295             88.89 0 1 0
       -.0370614             66.67 0 1 0
        .0495915               100 0 1 0
      .005221901             90.91 0 1 0
     .0014973993                80 0 1 0
       -.0147392 85.71000000000001 0 1 0
     -.003854999             76.92 0 1 0
        .0381652             88.89 0 1 0
       -.0272093             77.78 0 1 0
        .0241893             83.33 0 1 0
      .008206599                90 0 1 0
       -.0527029             45.45 0 1 0
       -.0651084                80 0 1 0
     -.002526799             66.67 0 1 0
     -.007646501                80 0 1 0
        -.142865               100 0 1 0
        .0294387                70 0 1 0
        -.024015                80 0 1 0
         .011871             83.33 0 1 0
    end

    Click image for larger version

Name:	univariate analysis.png
Views:	1
Size:	67.4 KB
ID:	1723906

  • #2
    My above code is wrong i just found out while further reading it properly. I have been now using
    Code:
     ttest CAR_3day , by (related)
    . I just want to double check if it is correct or not as a univariate analysis and i am still didn't find a way to export it to word similar to the image above. Can you please help me with that.

    Thank you

    Comment


    • #3
      Hi Venkat,
      The command you have given is a descriptive test which is testing the association between CAR_3day and related, it would be nice to see the output but i guess it will just give you the means, SD and p-values showing statistical significance or not. I would not call that univariate analysis. For univariate use the command regress CAR_3day i.related. To get a word document of your results, put the command "asdoc" before the actual command.

      Comment


      • #4
        first, the data example has only one group so is not useful

        second, if the variable called "related" actually had two groups, the codes in #2 and #3 would give exactly the same result; here is an example using the built in "auto.dta" data:

        Code:
        . sysuse auto
        (1978 automobile data)
        r; t=0.00 13:43:17
        
        . ttest headroom, by(foreign)
        
        Two-sample t test with equal variances
        ------------------------------------------------------------------------------
           Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
        ---------+--------------------------------------------------------------------
        Domestic |      52    3.153846    .1269928    .9157578    2.898898    3.408795
         Foreign |      22    2.613636     .103676    .4862837     2.39803    2.829242
        ---------+--------------------------------------------------------------------
        Combined |      74    2.993243    .0983449    .8459948    2.797242    3.189244
        ---------+--------------------------------------------------------------------
            diff |            .5402098    .2070884                .1273867    .9530329
        ------------------------------------------------------------------------------
            diff = mean(Domestic) - mean(Foreign)                         t =   2.6086
        H0: diff = 0                                     Degrees of freedom =       72
        
            Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
         Pr(T < t) = 0.9945         Pr(|T| > |t|) = 0.0110          Pr(T > t) = 0.0055
        r; t=0.06 13:43:28
        
        . regress headroom i.foreign
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(1, 72)        =      6.80
               Model |  4.51148176         1  4.51148176   Prob > F        =    0.0110
            Residual |  47.7351399        72  .662988054   R-squared       =    0.0863
        -------------+----------------------------------   Adj R-squared   =    0.0737
               Total |  52.2466216        73  .715707146   Root MSE        =    .81424
        
        ------------------------------------------------------------------------------
            headroom | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
             foreign |
           Domestic  |          0  (base)
            Foreign  |  -.5402098   .2070884    -2.61   0.011    -.9530329   -.1273867
                     |
               _cons |   3.153846   .1129149    27.93   0.000     2.928754    3.378938
        ------------------------------------------------------------------------------
        finally, I know nothing about -asdoc- but there are many ways, including some built in to Stata, to get your output into a document

        Comment


        • #5
          Hello Rich i didn't understand what you meant by my data has only one group

          Comment


          • #6
            in your data example, the variable called "related" is always equal to 0

            Comment


            • #7
              I will add that -- although I've seen it before and it may now be conventional in various fields -- the terminology univariate analysis seems ill-chosen if it means single-predictor analysis. Univariate analysis means, historically, looking only at one variable at a time, not two as is implied here.

              Comment


              • #8
                Agree, as usual, with Nick. Analysis of a single predictor and a single outcome is, and traditionally has been, called bivariate analysis.

                Comment

                Working...
                X