Colorful Statistics with Basic Steps in Stata 14
Usman Zafar Paracha
M. Phil. Pharmaceutics,
Rawalpindi, Pakistan
(2018)
This Book will help the students to learn and utilize some basic concepts of statistics while utilizing Stata 14.
Any Feedback will be Highly Appreciated.
Usman Zafar Paracha
Owner of SayPeople.com
https://www.facebook.com/usmanzparacha
Some words from the author
I am thankful to the company StataCorp LLC for providing Author Support.
I tried to make this book on statistics as informative and illustrative as possible, especially for beginners in statistics.
This book may have some trademarked names without using trademark symbol. However, they are used only in an editorial context, and there is no intention of infringement of trademark.
It is important to note that calculations and examples used in this book could not take the place of actual research. Statistics has to be used under the guidance of experts.
People with authentic comments and/or feedbacks (on Amazon) can ask me questions or send me Message here: https://www.facebook.com/usmanzparacha, and I will try to answer them.
Contents
Hypothesis
Statistics is an art as well as science, and needs help of both fields for explanation. You need stronger imagination as an artist and well-designed research as a scientist. Lets start with a concept of hypotheses.
According to an ancient Chinese myth, there is an entirely different world behind mirrors. That world has its own creatures, and is known as Fauna of mirrors . So, if a person is of opinion that fauna of mirrors actually exist, and he wants to perform a research on fauna of mirrors, his hypothesis will be that fauna of mirrors actually exist. This is known as research hypothesis or alternative hypothesis as the person is doing research on this hypothesis. It is represented by H a or H1.
On the other hand, there is another opinion showing that there is nothing like fauna of mirrors. This opinion can be considered as null hypothesis as it is negating the statement for research hypothesis and showing that research hypothesis is not a commonly observed phenomenon. Null hypothesis is represented by H o or H0. For a research to be completed successfully, null hypothesis is usually rejected. So, in order to prove the fauna of mirrors after performing a research, null hypothesis has to be rejected.
Shortly, it can be said that according to null hypothesis, nothing is changed or no significant new thing can be found (anywhere in any group), and according to alternative hypothesis, some significant change must have occurred or some significant new thing can be found (somewhere or in some group).
Hypothesis testing
Frequency
Using Stata
In order to work on the absolute frequency, relative frequency, and cumulative frequency, we
can use these numbers: 1,1,1,2,2,3,3,3,3,3,4,5,5,5,5.
Click on the box in Command below.
Write edit and enter.
A window Data Editor appears. This is a kind of spreadsheet window. Enter the values in the first column from row 1 to row 15.
These values are named as var1 (pay special attention to number, capitalizations, etc). Close this window; it automatically saves var1.
In order to find absolute frequency of the numbers, percentage of relative frequency, and cumulative for percentage of relative frequency, we can write
tab var1
This gives the following results:
var1 | Freq. | Percent | Cum. |
| | 20.00 | 20.00 |
| | 13.33 | 33.33 |
| | 33.33 | 66.67 |
| | 6.67 | 73.33 |
| | 26.67 | 100.00 |
Total | | 100.00 |
In order to get cumulative frequency, enter
contract var1, cfreq(Cumfreq)
and now enter
list
the following results appear,
In this table, Cumfreq shows cumulative frequency.
Sample and Population
Sample refers to a small part of something that is used to represent the whole (population).
Type I Error and Type II Error
Consider the hypotheses mentioned earlier. Suppose initial findings on the hypotheses show that fauna of mirrors actually exist. So, it can be said that the null hypothesis is rejected. However, it is important to note that the results from initial findings could be false (or they could be true) due to the presence of errors in the research. Those errors are known as error and error.
error is also known as Type I error or False positive . In this condition, it is possible that we incorrectly reject the null hypothesis, i.e. the statement there is nothing like fauna of mirrors seems wrong after performing an experiment, when in reality it is right. So, it is also considered as False positive as in this condition, we think that alternative hypothesis is right (positive).This type of error can be fixed by performing further tests. Moreover, changing the level of significance can also help in reducing type I error.
On the other hand, error is also known as Type II Error or False negative . In this condition, it is possible that we incorrectly accept the null hypothesis.
Type II error is more serious as compared to type I error because after this error, nobody would do further research on alternative hypothesis.
Errors of the higher kind could also be present. As, for example, type III error occurs when a researcher or an investigator gives the right answer to some wrong question. It is also considered when an investigator or researcher correctly rejects the null hypothesis for some wrong reason/s.
Measuring the Central Tendencies (mean, median, and mode), and Range