How to Do a Runs Test in MS Excel 2007

  Рет қаралды 53,338

ProfTDub

ProfTDub

Күн бұрын

This video shows you how to do a runs test in the basic package of MS Excel 2007 (i.e, without an Add-In). The purpose of a runs test is to determine if a set of binary data collected over time is random or not. The data I used represents the natural gas used in my home on a daily basis over a period of 30 days - starting near the end of January and ending near the end of February. The units of gas are in 100s of cubic feet.

Пікірлер: 41
@yabbadabbadoo3311
@yabbadabbadoo3311 7 жыл бұрын
WOW! I struggled for about 2+ hours today trying to calculate a p value for my CONNECT hw. FINALLY, I found your video and I actually determined the right p value. Cheers!
@mohammedyounus8632
@mohammedyounus8632 9 жыл бұрын
Excellent presentation. It really helps me in my research. Thank you so much. Mohd Younus Research Scholar, Osmania University. Hyd. India.
@MohanKumar-gj9th
@MohanKumar-gj9th 4 жыл бұрын
Mohammed Younus me too
@somethingirreversib
@somethingirreversib 2 жыл бұрын
Note: 4:52 "I know R is 10". He is talking about the number of counting runs. Excel would do that calculation for you with COUNTIF(E4:E34, 1) because each 1 in column E counts as a new run.
@hasanesenrona4527
@hasanesenrona4527 Жыл бұрын
It was a very nice, instructive example, thank you very much.🙏🙏
@ImmaMowYourLawnGuy
@ImmaMowYourLawnGuy 8 жыл бұрын
Thank you very much for your video. It was very easy to understand and follow for such a complicated equation!
@fcofelixx
@fcofelixx 14 жыл бұрын
you sir, saved my life, congratzz and thanks!!!!!!!!!!!
@ProfTDub
@ProfTDub 13 жыл бұрын
With your data, I calculated Z = -30.304 and the corresponding two-tailed p-value is 1x10 to the minus 201 power (a very small value). Stock prices tend to have far fewer runs than expected for a random process and because you have such a large data set, you get a big z-value and small p-value. Stock prices definitely do not follow a random process.
@ProfTDub
@ProfTDub 13 жыл бұрын
@nichtschwimmer0605 Yes, that sounds right. So, you were trying to see if the index follows a random walk by seeing if the index returns follow a random process? A random walk has differences (price changes) that form a random process, but not necessarily returns (price change over previous price).
@waelhussein4606
@waelhussein4606 10 жыл бұрын
very nice presentation. would just suggest to use the count() and countif() functions to count observations. Thanks for sharing!
@Raid3222
@Raid3222 12 жыл бұрын
Hi there, I really appreciate your help by posting this great video. I do have a question. Once I get a number of p-value. what does that mean. How can i know this is really random or not that much. How can I know how the randomness is?
@TheTechieman
@TheTechieman 9 жыл бұрын
There's a slight error in your Z calculation and therefore p-value. Because you are dealing with binary data and not continuous data, the continuity correction needs to be implemented. That is Cell H11 needs to be (H4-H8-SIGN(H4-H8)/2)/H10, not (H4-H8)/H10. This changes the p-value to 0.0834.
@ProfTDub
@ProfTDub 12 жыл бұрын
I think it's right in the video. I followed the order of operations, so given the denominator is N^2*(N-1), dividing the numerator by N^2 and then again by N-1 gives the same result as dividing by [(N^2)*(N-1)].
@ProfTDub
@ProfTDub 12 жыл бұрын
There are some variations of the Runs Test. Most common is to use the mean, but the median may be preferable if you have outliers in your data. It's fine to use the Runs Test on returns. Keep in mind this is an unsophisticated statistic for testing randomness. You might look into autocorrelation. You can use the Runs Test on weekly data.
@ProfTDub
@ProfTDub 13 жыл бұрын
Generally, stock prices follow a random walk, so their differences would form a random process. Over longer time periods, stock prices may show increases in variation (violating the random walk model form), so transforming them into natural log units (almost equivalent to calculating the returns) puts them back into the random walk form. Then, the differences of the transformed series should be a random process.
@ProfTDub
@ProfTDub 12 жыл бұрын
@lordjoesnow You should use a two-sided p-value if you're not sure - before collecting your data - whether you would have fewer or more runs than expected for a random process. Some returns have a slight positive autocorrelation over time, so you could justify a one-sided p-value (assuming there'd be less than expected runs compared to a random process).
@qibinbao6500
@qibinbao6500 10 жыл бұрын
thank you so much. it really help me a lot..
@ProfTDub
@ProfTDub 13 жыл бұрын
Excel has a function called normsdist() that I used in the video which returns the area to the left of the argument in the parentheses (in your case Z = 2.58). You want to find the area to the right of Z = 2.58, so you should find 1-normsdist(2.58) = 0.005 approximately. Then, multiply that value by 2 to get the two-sided p-value of about 1%. By the way, you are analyzing returns, not prices, right? It's surprising you ended up with significantly more runs than expected for a random process.
@ProfTDub
@ProfTDub 12 жыл бұрын
First, find the area to the right of z = 1.29696 under a standard normal curve. The answer is 0.0973. If you did a one-sided test (where the alternative hypothesis is "the process has more runs than expected for a random process"), then the p-value for the test is 0.0973. Since that value's greater than the typical significance level of 0.05, you would not reject the idea that the process is truly random. The 2-sided p-value is 2*0.0973 = 0.1946 which is > 0.05, too, so don't reject random.
@nichtschwimmer0605
@nichtschwimmer0605 13 жыл бұрын
@ProfTDub So, would you recommend to use price changes rather than returns for the RUNs test? Additionally I computed serial correlation coefficients for index and companies' returns. Independent from answer to question one, would you recommend to use price changes in terms of that test for autocorrelation?
@JMFDomingues
@JMFDomingues 10 жыл бұрын
What about not using averages but simple positive or negative variations? In this case the diference of the lograythm of the price.The test for randomness in gretl gave the same outcome but slightly diferent values for p and z. Nice video, very helpfull.
@nichtschwimmer0605
@nichtschwimmer0605 13 жыл бұрын
Yes, I'm analyzing returns! Was surprised as well, but for both examples, German Dax over 3 years daily returns and a German share over the same period, the results are more runs than expected. I would interpret Z=2,58 and the other which is Z=0,58 as follows: at a significance level of 5% Z should be between -1,96 and +1,96 (following Z table) Index return doesn't follow random walk, Company's return does by Z prediction approach rather than p-value approach. Am I on the right track?
@TheBunun
@TheBunun 11 жыл бұрын
Hey Prof, first of all thanks for the great tutorial. And, second, how should i calculate the p-value is my data set is negatively skewed?? Thanks
@TheBunun
@TheBunun 11 жыл бұрын
Thanks for answering,actually, i was employing the runs test on a series of daily movements of a stock price index. The series was negatively skewed and if i am getting it right since runs test is non-parametric, so it does not matter if my data set is non-normal. The p-value is still calculated using the NORMSDIST function, right?
@TIguyovwe
@TIguyovwe 8 жыл бұрын
So cool. So cool . Thanks
@KaiserinAstrid
@KaiserinAstrid 11 жыл бұрын
Pretty cool. Far easier to do than Eviews. :)
@zipporapper
@zipporapper 13 жыл бұрын
hi prof could you a demo on autocovariance and autocorellation of time series data? thanks
@martaleca1439
@martaleca1439 4 жыл бұрын
Hi, does someone know the reference of the book with the formulas? Really needed that to justify the usage of this technique. Thanks
@timothywelnetz3041
@timothywelnetz3041 11 жыл бұрын
-not sure what you mean. If your raw data is not in binary form, and it is a left-skewed distribution, that doesn't matter in calculating the runs test p-value. In the video, I had fewer runs than expected for a random process - leading to a negative z-value, but there could be more runs than expected in some data - leading to a positive z-value.
@lordjoesnow
@lordjoesnow 12 жыл бұрын
@ProfTDub ah okay. So the p-value in a one sided test shows how probable it is that the runs are less than expected. The 2 sided p-value shows how probable it is that the runs are less or more than expected? because im doing the financial crisis and i have sub samples for before, after and during the financial crisis ill do one sided. thanks for all your help
@lordjoesnow
@lordjoesnow 12 жыл бұрын
my z values are figures such as 1.29696011 and for another ln returns series i have 0.31624858 and then another has a z of 0.62716022. These are all positive so i minus 1 from them but my first value is still positive. Do you think maybe i made a mistake in the calculation? that particular series has 189 runs when its expected was 176 so i'd expect that it isnt particularily random but can't figure out what the z values are saying or how to get the correct p value and what that means
@lordjoesnow
@lordjoesnow 12 жыл бұрын
hey, the wiki page says that we use the median rather the average? Also im using this method on ln returns? is that advisable?
@nichtschwimmer0605
@nichtschwimmer0605 13 жыл бұрын
I don't get the point why to subtract from 1 when Z is positive. I'm examining a stock market index return's randomness and have N=764, R=415, E(R)=379,61, StDev(R)=13,69 and a Z of 2,58. Literature suggests that therefore the returns are not random, but subtracted from one Z is of course -1,58 (P=11,28% two tailed) and therefore they are random. I'm not sure how to proceed and how to interpret the whole thing, I find the "subtract from 1" pretty confusing.
@basmanasmathin4347
@basmanasmathin4347 5 жыл бұрын
Can you Please Explain How to Calculating R Value?
@sirlord001
@sirlord001 12 жыл бұрын
I think you have an error in calculating your variance. The denominator should be (N^2)(N-1), correct?
@lordjoesnow
@lordjoesnow 12 жыл бұрын
@ProfTDub so should i be doubling my P value?
@lordjoesnow
@lordjoesnow 12 жыл бұрын
@ProfTDub do i get this 0.0973 by looking in the tables?
@omotayoakinpelumi2061
@omotayoakinpelumi2061 8 жыл бұрын
Thanks alot brother, i appreciate this sooooooo much.
@lordjoesnow
@lordjoesnow 12 жыл бұрын
also does this work for weekly data?
@abbaskhanyousafzai1
@abbaskhanyousafzai1 5 жыл бұрын
I CAN NOT HEAR YOU WHAT IS THE VALUE R PLEASE EXPLAIN
@abbaskhanyousafzai1
@abbaskhanyousafzai1 5 жыл бұрын
in your data R is not zero dear sir R is 21
How to perform t-test in Excel
9:21
Innovative Learner
Рет қаралды 144 М.
How to Create Leave Tracker in Excel
25:10
ExcelDemy
Рет қаралды 42 М.
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 40 МЛН
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26
How to Add Double Underline in Excel - Easy to Follow
0:53
Statistics 101: Nonparametric Methods,  Friedman Test in Excel
30:11
Brandon Foltz
Рет қаралды 21 М.
Conducting the Runs Test using Excel
14:23
Dr. Todd Grande
Рет қаралды 10 М.
Bar chart with differences in Excel
13:49
RBX Excel videos
Рет қаралды 147 М.
Kolmogorov-Smirnov Test of Normality in Excel
12:54
Dr. Todd Grande
Рет қаралды 96 М.
Assessing Whether a Time-Series Follows a Random Walk
9:51
ProfTDub
Рет қаралды 33 М.
How to Make a Time-Series Plot in Excel 2007
6:24
ProfTDub
Рет қаралды 181 М.
Design of Experiment (CRD & RBD) using MS-Excel
14:55
RVision (Stat Solution)
Рет қаралды 932