Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Challenging Stata Questions


From   TA Quilter <[email protected]>
To   [email protected]
Subject   st: Challenging Stata Questions
Date   Wed, 08 Feb 2006 18:36:03 +0000

Hi There,

I was wondering if anyone could possibly help me with a couple of questions?
>
> I'm running some simulations in a do file, producing a binary string.
> The model itself is not binomial, and I'm looking at how well the tests
> pick this up.
>
> I'm running some correlation stats on the binary string (of wins and
> losses).  The analysis including:
>             reg w l.w
>             reg w l.l.w
>             reg w l.w l.l.w
>             reg w l.w l.l.w l.l.l.w
>             runtest w, threshold(0) , where w=1 is a win, l=0 is a loss.
>
> I'm looking to see whether the stats pick up that
> P(w_t|w_{t-1}) > P(w_t|l_{t-1}) significantly or not.
>
> The stuff i get out is for example
>
> . *** The Analysis ***
> .
> . reg w l.w
>
>        Source |       SS       df       MS              Number of obs
> =      99
> -------------+------------------------------           F(  1,    97)
> =    1.21
>         Model |  .305025768     1  .305025768           Prob > F
> =  0.2740
>      Residual |   24.442449    97   .25198401           R-squared
> =  0.0123
> -------------+------------------------------           Adj R-squared
> =  0.0021
>         Total |  24.7474747    98  .252525253           Root MSE
> =  .50198
>
> ------------------------------------------------------------------------------
>             w |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>             w |
>           L1. |   .1110204   .1009069     1.10   0.274    -.0892519
>  .3112928
>         _cons |        .44   .0709907     6.20   0.000     .2991031
>  .5808969
> ------------------------------------------------------------------------------
>
> . reg w l.l.w
>
>        Source |       SS       df       MS              Number of obs
> =      98
> -------------+------------------------------           F(  1,    96)
> =    0.64
>         Model |  .163265306     1  .163265306           Prob > F
> =  0.4241
>      Residual |  24.3265306    96  .253401361           R-squared
> =  0.0067
> -------------+------------------------------           Adj R-squared
> = -0.0037
>         Total |  24.4897959    97  .252472123           Root MSE
> =  .50339
>
> ------------------------------------------------------------------------------
>             w |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>             w |
>           L2. |   .0816327   .1017001     0.80   0.424    -.1202405
>  .2835058
>         _cons |   .4489796   .0719128     6.24   0.000     .3062337
>  .5917254
> ------------------------------------------------------------------------------
>
> . reg w l.w l.l.w
>
>        Source |       SS       df       MS              Number of obs
> =      98
> -------------+------------------------------           F(  2,    95)
> =    0.73
>         Model |   .37218136     2   .18609068           Prob > F
> =  0.4832
>      Residual |  24.1176146    95  .253869627           R-squared
> =  0.0152
> -------------+------------------------------           Adj R-squared
> = -0.0055
>         Total |  24.4897959    97  .252472123           Root MSE
> =  .50385
>
> ------------------------------------------------------------------------------
>             w |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>             w |
>           L1. |   .0930626   .1025876     0.91   0.367    -.1105994
>  .2967246
>           L2. |   .0702372   .1025662     0.68   0.495    -.1333824
>  .2738569
>         _cons |   .4090956   .0843447     4.85   0.000     .2416502
>   .576541
> ------------------------------------------------------------------------------
>
> . reg w l.w l.l.w l.l.l.w
>
>        Source |       SS       df       MS              Number of obs
> =      97
> -------------+------------------------------           F(  3,    93)
> =    0.91
>         Model |  .688662088     3  .229554029           Prob > F
> =  0.4413
>      Residual |  23.5587606    93  .253320006           R-squared
> =  0.0284
> -------------+------------------------------           Adj R-squared
> = -0.0029
>         Total |  24.2474227    96   .25257732           Root MSE
> =  .50331
>
> ------------------------------------------------------------------------------
>             w |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
> Interval]
> -------------+----------------------------------------------------------------
>             w |
>           L1. |   .0961765   .1032586     0.93   0.354    -.1088746
>  .3012277
>           L2. |   .0708528   .1034346     0.69   0.495    -.1345478
>  .2762533
>           L3. |    .096522   .1032192     0.94   0.352    -.1084509
>  .3014948
>         _cons |   .3644247   .0945632     3.85   0.000     .1766409
>  .5522085
> ------------------------------------------------------------------------------
>
> runtest w, threshold(0)
>   N(w <= 0) = 50
>   N(w >  0) = 50
>         obs = 100
>     N(runs) = 45
>          z  = -1.21
>    Prob>|z| = .23
>
>
> 1) I'm believing L1 to be the first order serial correlation statistic
> - (the probability of a win(1) after a win(1) this period) minus (the
> probability of a win(1) after a loss(0) last period)...i.e if L1=0 the
> terms are independant. Am i right?
>
> 2) To work out the second order serial correlation statistic do I add
> the L1 and L2 terms together?  I'm looking for the prob of a win(1)
> after 2 previous losees(1's) compared to a win(1) after two previous
> losses(2's).
>
> 3) Why is the L2 from reg w l.l.w different from the L2 in reg w l.w l.l.w?
>
> 4) Is the P>|t| the p-value?
>
>
> 5) Not sure if this is possible but I'm looking to run say N
> simulations and record the p-val each time in order to estimate a power
> for the tests to pick up something that is there ... Is there any
> quicker way of doing this, rather than copying and pasting each p-value
> seperately in excel?
>
>
> Sorry for so many questions!  Any help would be much appreciated.

> Tom.
>
>
>
>
>
>
>
>
>
>
>
> Quoting "Scott Morton, Fiona" <[email protected]>:
>
>> Yes, I use it all the time. Send any questions you have by email or
>> try me in the morning at +33 5 61 12 86 31
>> Fiona
>>
>> -----Original Message-----
>> From:	TA Quilter [mailto:[email protected]]
>> Sent:	Wed 2/1/2006 8:37 AM
>> To:	Scott Morton, Fiona
>> Cc:
>> Subject:	Stata?
>> Hi Fiona,
>>
>> I'm on of Ed's PhD students in my 3rd year.
>>
>> I was wondering if you'd ever used the stats package Stata in your
>> research and could spare me some mins for some quick questions?
>>
>> It would be a real help.
>>
>> Cheers,
>>
>> Tom.
>>>>
>>>>
>>>>
>>>> Quoting Richard Holt <[email protected]>:
>>>>
>>>>> Tom, Haibo and Marco,
>>>>>
>>>>> I attach exercises and solutions for Econ 2 this week and next week.
>>>>> Apologies for the timing - I have only just completed the solutions
>>>>> sheet.
>>>>>
>>>>> This week the exercise is based around analysis of economic data. I
>>>>> attach the exercise, the solution set and an Excel spreadsheet
>>>>> containing the data and the regression and other output.
>>>>>
>>>>> Students were asked to use Excel to look at histograms, compute
>>>>> descriptive statistics and run regressions (using consumption and
>>>>> income data (cross-section)).
>>>>>
>>>>> Most students have used Excel before - those intending to have the
>>>>> option to take a course containing economics (or accounting or business
>>>>> studies) at honours level have to take Computing in Management and
>>>>> Economics which includes a unit on Excel.
>>>>>
>>>>> As I understand it they did some probability theory with Jozsef last
>>>>> semester but this will be the first time that they look at statistics
>>>>> and / or do any data work. You might emphasise links between
>>>>> probability theory (esp mathematical expectation, correlation etc) and
>>>>> the sample counterparts.
>>>>>
>>>>> I have not devoted any time to statistical theory / methods in the
>>>>> lectures (we are currently discussing consumption / savings decisions
>>>>> under uncertainty, and I mention the idea of regression in order to be
>>>>> able to present Hall's work on the rational expectations permanent
>>>>> income model.
>>>>>
>>>>> The reason for setting an Excel based exercise is that they will be
>>>>> doing a project later this semester leading to a poster presentation,
>>>>> that will 'require' use of Excel to analyse and convey information
>>>>> about the relationship(s) between economic variables.
>>>>>
>>>>> I have asked students to bring their Excel output / a report containing
>>>>> details of the output to the tutorial for discussion.
>>>>>
>>>>> If you run out of things to discuss / discussion is not very fruitful
>>>>> then you could talk about the use of statistical analysis in economics,
>>>>> the difference between the population and sample distribution. The
>>>>> distinction between descriptive and inferential statistics, to
>>>>> illustrate that there is more to econometrics than computing means and
>>>>> standard deviations.
>>>>>
>>>>> If all else fails you can discuss material that you didn't have time to
>>>>> cover last week, or discuss issues that arise from this week's lectures.
>>>>>
>>>>> Let me know if you think the exercises/solutions contain errors so that
>>>>> I can correct them. Also could you let me know how the material is
>>>>> being received by the students - is it too difficult for them?
>>>>>
>>>>> Kind regards,
>>>>>
>>>>> Ric
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
>
>
>



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index