0% found this document useful (0 votes)
26 views9 pages

Stata Output

STATA

Uploaded by

Leeshle AG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views9 pages

Stata Output

STATA

Uploaded by

Leeshle AG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

 

 Sunday July 10 18:58:08 2022   Page 1

                                                                      ___  ____  ____  ____  ____(R)
                                                                     /__    /   ____/   /   ____/   
                                                                    ___/   /   /___/   /   /___/    
                                                                      Statistics/Data Analysis      

                                                                        User: ssssssssssssssssssss  

  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   16.1   Copyright 1985‐2019 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     Special Edition                  College Station, Texas 77845 USA
                                      800‐STATA‐PC        http://www.stata.com
                                      979‐696‐4600        [email protected]
                                      979‐696‐4601 (fax)

Single‐user Stata perpetual license:
       Serial number:  401606254750
         Licensed to:  Sunass
                       Sunass

Notes:
      1.  Unicode is supported; see help unicode_advice.
      2.  Maximum number of variables is set to 5000; see help set_maxvar.
      3.  New update available; type ‐update all‐

1 . use "C:\Users\HP\Desktop\Multiple.dta"

2 . do "C:\Users\HP\AppData\Local\Temp\STD100_000000.tmp"

3 . describe

Contains data from C:\Users\HP\Desktop\Multiple.dta
  obs:            75                          
 vars:             3                          1 Jul 2022 23:13
                                              (_dta has notes)

              storage   display    value
variable name   type    format     label      variable label

ventas          float   %9.0g                 Ingresos de ventas mensuales (S/ 1000)
precio          float   %9.0g                 Índice de precios de todos los productos vendidos en un mes determinad
gaspubli        float   %9.0g                 Gasto en publicidad (S/ 1000)

Sorted by: 

4 . reg ventas precio

      Source         SS           df       MS      Number of obs   =        75
   F(1, 73)        =     46.93
       Model    1219.09137         1  1219.09137   Prob > F        =    0.0000
    Residual    1896.39065        73  25.9779541   R‐squared       =    0.3913
   Adj R‐squared   =    0.3830
       Total    3115.48202        74  42.1011083   Root MSE        =    5.0969

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

      precio    ‐7.829075   1.142865    ‐6.85   0.000     ‐10.1068   ‐5.551349
       _cons     121.9002   6.526291    18.68   0.000     108.8933    134.9071

5 . reg ventas precio gaspubli

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861
  Sunday July 10 18:58:17 2022   Page 2

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.09268   ‐5.723034
    gaspubli     1.862584   .6831955     2.73   0.008     .5006587    3.224509
       _cons     118.9136   6.351638    18.72   0.000     106.2519    131.5754

6 . predict u,resid

7 . br

8 . predict ventas_est
(option xb assumed; fitted values)

9 . br

10 . regress ventas precio gaspubli, level(99)

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861

      ventas        Coef.   Std. Err.      t    P>|t|     [99% Conf. Interval]

      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.80769   ‐5.008021
    gaspubli     1.862584   .6831955     2.73   0.008       .05495    3.670218
       _cons     118.9136   6.351638    18.72   0.000     102.1081    135.7191

11 . regress ventas precio gaspubli

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.09268   ‐5.723034
    gaspubli     1.862584   .6831955     2.73   0.008     .5006587    3.224509
       _cons     118.9136   6.351638    18.72   0.000     106.2519    131.5754

12 . reg ventas gaspubli precio

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

    gaspubli     1.862584   .6831955     2.73   0.008     .5006587    3.224509
      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.09268   ‐5.723034
       _cons     118.9136   6.351638    18.72   0.000     106.2519    131.5754
  Sunday July 10 18:58:17 2022   Page 3

13 . 
end of do‐file

14 . egen mean_ventas=mean(ventas)

15 . br

16 . gen mss=(mean_ventas‐ventas_est)^2

17 . sum mss

    Variable          Obs        Mean    Std. Dev.       Min        Max

         mss           75    18.62052    19.83252   .0194314   78.35326

18 . display "mss= " r(sum)
mss= 1396.5392

19 . gen rss=(ventas‐ventas_est)^2

20 . sum rss

    Variable          Obs        Mean    Std. Dev.       Min        Max

         rss           75    22.91924    34.02351   .0004069   181.7765

21 . display "rss= " r(sum)
rss= 1718.943

22 . gen tss=(ventas‐mean_ventas)^2

23 . sum tss

    Variable          Obs        Mean    Std. Dev.       Min        Max

         tss           75    41.53976    46.85514   .5261096   224.2405

24 . display "tss= " r(sum)
tss= 3115.482

25 . reg ventas precio gaspubli

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.09268   ‐5.723034
    gaspubli     1.862584   .6831955     2.73   0.008     .5006587    3.224509
       _cons     118.9136   6.351638    18.72   0.000     106.2519    131.5754

26 . display "Model= " e(mss)/e(df_m)
Model= 698.2696
  Sunday July 10 18:58:17 2022   Page 4

27 . display "Residual= " e(rss)/e(df_r)
Residual= 23.874206

28 . display "Total= " [e(rss)+e(mss)]/[e(df_r)+e(df_m)]
Total= 42.101108

29 . display "Number of obs= " e(N)
Number of obs= 75

30 . test precio gaspubli

 ( 1)  precio = 0
 ( 2)  gaspubli = 0

       F(  2,    72) =   29.25
            Prob > F =    0.0000

31 . display "F(2, 72)= " [e(mss)/e(df_m)]/[e(rss)/e(df_r)]
F(2, 72)= 29.247867

32 . display "F(2, 72)= " e(F)
F(2, 72)= 29.247867

33 . di " R‐squared= " e(mss)/(e(mss)+e(rss))
 R‐squared= .44825783

34 . di " R‐squared= " e(r2)
 R‐squared= .44825783

35 . di "Adj R‐squared= " 1‐[e(rss)/e(df_r)]/[(e(mss)+e(rss))/(e(df_m)+e(df_r))]
Adj R‐squared= .43293166

36 . di "Root MSE= " (e(rss)/e(df_r))^0.5
Root MSE= 4.8861238

37 . reg ventas precio gaspubli

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.09268   ‐5.723034
    gaspubli     1.862584   .6831955     2.73   0.008     .5006587    3.224509
       _cons     118.9136   6.351638    18.72   0.000     106.2519    131.5754

38 . scalar bl=_b[precio]‐invttail(e(df_r),0.025)*_se[precio]

39 . scalar bu=_b[precio]+invttail(e(df_r),0.025)*_se[precio]

40 . scalar list bl bu
        bl = ‐10.092679
        bu =  ‐5.723034
  Sunday July 10 18:58:17 2022   Page 5

41 . scalar bl=_b[gaspubli]‐invttail(e(df_r),0.025)*_se[gaspubli]

42 . scalar bu=_b[gaspubli]+invttail(e(df_r),0.025)*_se[gaspubli]

43 . scalar list bl bu
        bl =  .50065872
        bu =  3.2245092

44 . scalar bl=_b[_cons]‐invttail(e(df_r),0.025)*_se[_cons]

45 . scalar bu=_b[_cons]+invttail(e(df_r),0.025)*_se[_cons]

46 . scalar list bl bu
        bl =  106.25186
        bu =  131.57538

47 . scalar tc1=(_b[precio]‐0)/(_se[precio])

48 . scalar pvalue1=2*ttail(e(df_r),abs(tc1))

49 . scalar list tc1 pvalue1
       tc1 = ‐7.2152428
   pvalue1 =  4.424e‐10

50 . scalar tc2=(_b[gaspubli]‐0)/(_se[gaspubli])

51 . scalar pvalue2=2*ttail(e(df_r),abs(tc2))

52 . scalar critico=invttail(e(df_r),0.05)

53 . scalar list tc2 critico pvalue2
       tc2 =  2.7262827
   critico =  1.6662937
   pvalue2 =  .00803819

54 . scalar tc3=(_b[_cons]‐0)/(_se[_cons])

55 . scalar pvalue3=2*ttail(e(df_r),abs(tc3))

56 . scalar critico3=invttail(e(df_r),0.05)

57 . scalar list tc3 critico2 pvalue3
scalar critico2 not found
r(111);

58 . scalar list tc3 critico1 pvalue3
scalar critico1 not found
r(111);

59 . scalar list tc3 critico3 pvalue3
       tc3 =  18.721726
  critico3 =  1.6662937
   pvalue3 =  2.214e‐29

60 . reg ventas precio gaspubli

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.09268   ‐5.723034
    gaspubli     1.862584   .6831955     2.73   0.008     .5006587    3.224509
       _cons     118.9136   6.351638    18.72   0.000     106.2519    131.5754
  Sunday July 10 18:58:17 2022   Page 6

61 . estat vce

Covariance matrix of coefficients of regress model

        e(V)       precio    gaspubli       _cons 

      precio    1.2012009                         
    gaspubli   ‐.01974216   .46675603             
       _cons    ‐6.795065   ‐.7484205   40.343304 

62 . display "Std. Err._precio= " (1.2012009)^0.5
Std. Err._precio= 1.0959931

63 . reg ventas precio gaspubli

      Source         SS           df       MS      Number of obs   =        75
   F(2, 72)        =     29.25
       Model    1396.53921         2  698.269603   Prob > F        =    0.0000
    Residual    1718.94281        72  23.8742057   R‐squared       =    0.4483
   Adj R‐squared   =    0.4329
       Total    3115.48202        74  42.1011083   Root MSE        =    4.8861

      ventas        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

      precio    ‐7.907856   1.095993    ‐7.22   0.000    ‐10.09268   ‐5.723034
    gaspubli     1.862584   .6831955     2.73   0.008     .5006587    3.224509
       _cons     118.9136   6.351638    18.72   0.000     106.2519    131.5754

64 . clear

65 . use "C:\Users\HP\Desktop\multicolinealidad.dta"

66 . describe

Contains data from C:\Users\HP\Desktop\multicolinealidad.dta
  obs:            23                          
 vars:             6                          9 Jul 2022 23:20

              storage   display    value
variable name   type    format     label      variable label

y               double  %10.0g                y
x1              double  %10.0g                x1
x2              double  %10.0g                x2
x3              double  %10.0g                x3
x4              double  %10.0g                x4
x5              double  %10.0g                x5

Sorted by: 

67 . reg y x1 x2 x3 x4

      Source         SS           df       MS      Number of obs   =        23
   F(4, 18)        =     73.87
       Model    1127.25901         4  281.814752   Prob > F        =    0.0000
    Residual    68.6696892        18  3.81498274   R‐squared       =    0.9426
   Adj R‐squared   =    0.9298
       Total     1195.9287        22  54.3603953   Root MSE        =    1.9532

           y        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

          x1     .0050107   .0048929     1.02   0.319    ‐.0052688    .0152902
          x2    ‐.6111737   .1628489    ‐3.75   0.001    ‐.9533065   ‐.2690408
          x3     .1984094   .0637207     3.11   0.006     .0645371    .3322816
          x4     .0695029   .0509872     1.36   0.190    ‐.0376172    .1766229
       _cons     37.23236   3.717695    10.01   0.000     29.42178    45.04295
  Sunday July 10 18:58:17 2022   Page 7

68 . cor x1 x2 x3 x4
(obs=23)

                     x1       x2       x3       x4

          x1     1.0000
          x2     0.9317   1.0000
          x3     0.9571   0.9701   1.0000
          x4     0.9859   0.9285   0.9406   1.0000

69 . graph matrix x1 x2 x3 x4

70 . reg x1 x2 x3 x4

      Source         SS           df       MS      Number of obs   =        23
   F(3, 19)        =    327.44
       Model    8238813.79         3  2746271.26   Prob > F        =    0.0000
    Residual    159354.887        19  8387.09932   R‐squared       =    0.9810
   Adj R‐squared   =    0.9780
       Total    8398168.67        22   381734.94   Root MSE        =    91.581

          x1        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

          x2    ‐8.566327   7.378383    ‐1.16   0.260    ‐24.00946    6.876805
          x3     6.809181   2.546806     2.67   0.015     1.478654    12.13971
          x4     9.164188   1.138069     8.05   0.000     6.782182    11.54619
       _cons    ‐309.6421   159.1833    ‐1.95   0.067    ‐642.8165    23.53227

71 . scalar r2=e(mss)/(e(mss)+e(rss))

72 . display "FIV1= " 1/(1‐r2)
FIV1= 52.701042

73 . reg x2 x3 x4 x1

      Source         SS           df       MS      Number of obs   =        23
   F(3, 19)        =    113.37
       Model    2575.17528         3  858.391761   Prob > F        =    0.0000
    Residual    143.854283        19  7.57127805   R‐squared       =    0.9471
   Adj R‐squared   =    0.9387
       Total    2719.02957        22  123.592253   Root MSE        =    2.7516

          x2        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

          x3     .3000682   .0576125     5.21   0.000     .1794839    .4206525
          x4     .0988555   .0681546     1.45   0.163    ‐.0437937    .2415048
          x1    ‐.0077331   .0066607    ‐1.16   0.260     ‐.021674    .0062079
       _cons     16.57308   3.601907     4.60   0.000     9.034206    24.11196

74 . scalar r2=e(mss)/(e(mss)+e(rss))

75 . display "FIV2= " 1/(1‐r2)
FIV2= 18.901276

76 . reg x3 x4 x1 x2

      Source         SS           df       MS      Number of obs   =        23
   F(3, 19)        =    177.66
       Model    26356.0051         3  8785.33502   Prob > F        =    0.0000
    Residual    939.574926        19  49.4513119   R‐squared       =    0.9656
   Adj R‐squared   =    0.9601
       Total      27295.58        22  1240.70818   Root MSE        =    7.0322
  Sunday July 10 18:58:17 2022   Page 8

          x3        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

          x4    ‐.2243588    .176207    ‐1.27   0.218    ‐.5931643    .1444467
          x1     .0401477   .0150163     2.67   0.015     .0087183    .0715771
          x2     1.959876   .3762922     5.21   0.000     1.172287    2.747465
       _cons    ‐17.30398   12.78269    ‐1.35   0.192    ‐44.05847    9.450506

77 . scalar r2=e(mss)/(e(mss)+e(rss))

78 . display "FIV3= " 1/(1‐r2)
FIV3= 29.050988

79 . reg x4 x1 x2 x3

      Source         SS           df       MS      Number of obs   =        23
   F(3, 19)        =    245.49
       Model     56881.433         3  18960.4777   Prob > F        =    0.0000
    Residual    1467.47571        19  77.2355636   R‐squared       =    0.9748
   Adj R‐squared   =    0.9709
       Total    58348.9087        22  2652.22312   Root MSE        =    8.7884

          x4        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

          x1     .0843917   .0104803     8.05   0.000     .0624561    .1063272
          x2     1.008438   .6952538     1.45   0.163    ‐.4467453    2.463621
          x3    ‐.3504149    .275209    ‐1.27   0.218     ‐.926434    .2256042
       _cons     20.35645   16.06257     1.27   0.220    ‐13.26289     53.9758

80 . scalar r2=e(mss)/(e(mss)+e(rss))

81 . display "FIV4= " 1/(1‐r2)
FIV4= 39.761414

82 . reg ventas precio gaspubli
variable ventas not found
r(111);

83 . reg y x1 x2 x3 x4

      Source         SS           df       MS      Number of obs   =        23
   F(4, 18)        =     73.87
       Model    1127.25901         4  281.814752   Prob > F        =    0.0000
    Residual    68.6696892        18  3.81498274   R‐squared       =    0.9426
   Adj R‐squared   =    0.9298
       Total     1195.9287        22  54.3603953   Root MSE        =    1.9532

           y        Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

          x1     .0050107   .0048929     1.02   0.319    ‐.0052688    .0152902
          x2    ‐.6111737   .1628489    ‐3.75   0.001    ‐.9533065   ‐.2690408
          x3     .1984094   .0637207     3.11   0.006     .0645371    .3322816
          x4     .0695029   .0509872     1.36   0.190    ‐.0376172    .1766229
       _cons     37.23236   3.717695    10.01   0.000     29.42178    45.04295
  Sunday July 10 18:58:17 2022   Page 9

84 . vif

    Variable         VIF       1/VIF  

          x1       52.70    0.018975
          x4       39.76    0.025150
          x3       29.05    0.034422
          x2       18.90    0.052906

    Mean VIF       35.10

85 . 

You might also like