Search This Blog

Wednesday, 14 June 2017

Chi Square

What is Chi Square?
Chi square statistic is a method of showing relationship between two categorical variables. In statistic, there are two types of variables which is the numerical and non-numerical variables. The chi squared statistic is a single number that tells you how much difference exists between your observed counts you would expect if there were no relationship at all in the population.

chi square formula

There are a few variations on the chi square statistic. However, all of the variations use the same idea, which is that you are comparing your expected values with the values you actually collect. One of the most common forms can be used for contingency tables.

Chi square test consists of two types which is the chi square goodness of fit test and chi square test for independence. In this section, we will focus on the chi square goodness of fit test. The purpose of this test was to determines if a sample data matches a population. This test is applied when there is one categorical variable from a single population. It is used to determine whether sample data are consistent with a hypothesized distribution.

example


 When to use it?
This test is appropriate when those conditions are met:
-               The sampling method is simple random sampling.
-               The variable under study is categorical.
-               The expected value of the number of sample observation in each level of the variable is at least 5.

Step in Chi Square

1)         State the hypothesis
2)         Formulate an analysis plan
3)         Analyze sample data
4)         Interpret results

Homogeneity of Proportions
The test were used to a single categorical variable from two or more different populations. It is used to determine whether frequency counts are distributed identically across different populations.
This test also will be used when:
-               In the population, the sampling method is simple random sampling.
-               The variable is categorical.
-               Data displayed in contingency table showed that the expected frequency count for each cell is less than 5.

The steps and procedures are also the same as the usual chi square test.

By : Hanis Jefry

References :
http://www.statisticshowto.com/probability-and-statistics/chi-square/
http://math.hws.edu/javamath/ryan/ChiSquare.html
http://www.statisticssolutions.com/non-parametric-analysis-chi-square/
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm

Correlation & Regression Analysis

Definition & Objective

The objective of correlation analysis is to see whether two measurements variables co vary, and also to quantify the strength of the relationship between variables. The regression, in the other hand will express the relationship in the form of an equation.


In an example, a group of students taking a maths and english test, we could use correlation to determine whether students who are good at maths tend to be good at english as well, and regression to determine whether the marks in english can be predicted for given marks in maths.

There are three main objective of this method which is :
- to test hypotheses about cause and effect relationships.
- to see whether two variables are associated, without necessarily inferring a cause and effect relationship.
- estimating the value of one variable corresponding to a particular value of the other variable.

Uses of Correlation

Correlation can be used such as the Pearson Product Moment Correlation Coefficient, to test if there is a linear relationship between the variables. To quantify the strength of the relationship, we can calculate the correlation coefficient (r). Its numerical values ranges from +1.0 to -1.0. r > 0 indicates positive linear relationship, while r < 0 indicates negative linear relationship and r = 0 indicates no linear relationship.


Uses of Regression

In the analysis of regression, the problem of interest is the nature of the relationship itself between the dependent variable and the independent variables.
The analysis consists of choosing and fitting an appropriate model, done by the method of least squares, with a view to exploiting the relationship between the variables to help estimate the expected response for a given value of the independent variable. For example, if we are interested in the effect of age on height, then by fitting a regression line, we can predict the height for a given age.



By: Hanis Jefry

References:

http://abyss.uoregon.edu/~js/glossary/correlation.html
http://sphweb.bumc.bu.edu/otlt/mph-modules/bs/bs704_multivariable/bs704_multivariable5.html
http://www.bmj.com/about-bmj/resources-readers/publications/statistics-square-one/11-correlation-and-regression
http://keydifferences.com/difference-between-correlation-and-regression.html

Thursday, 27 April 2017

Confidence Interval

A range of values that we fairly sure the true value lies in. In statistical inference, to estimate the population parameters used the observed sample data.

Confidence interval also known as estimated range of values which include as unknown population parameter and the estimated range calculated from set of sample data (taken from Valerie J. Easton and John H. McColl's).

The confidence interval formula is

X  ±  Z
s
√(n)
Where:
·         X is the mean
·         Z is the Z-value from the table below
·         s is the standard deviation
·         n is the number of samples


Z
80%
1.282
85%
1.440
90%
1.645
95%
1.960
99%
2.576
99.5%
2.807
99.9%
3.291


Calculating the confidence interval

Step 1:
Note down all the number in the data, calculate the mean and standard deviation for the samples.

·         Number of samples: n = 40
·         Mean: X = 175
·         Standard Deviation: s = 20

Step 2:
Decide the confidence interval that we want. There are 90%, 95% and 99%. Then, find the value of "Z" for the confidence interval and let's say we choose 95%, the value of Z value is 1.960


Z
80%
1.282
85%
1.440
90%
1.645
95%
1.960
99%
2.576
99.5%
2.807
99.9%
3.291

Step 3:
Insert the Z value into the formula and we have

175 ± 1.960 ×
20
√40

The result is 
175cm ± 6.20cm
In conclusion, the data lies between 168.8cm to 181.2cm
By: Nur Fariza

References:
Definition taken from Valerie J. Easton and John H. McColl's Statistics Glossary v1.1)
http://www.stat.yale.edu/Courses/1997-98/101/confint.htm






Tuesday, 25 April 2017

Sample Size, Power and Effect Size

What is sample size?

Sample size is when your sample size is increases, it is power of your test. This should make sense because the more you collected information, the larger sample of means for your data which makes it easy to reject the null hypothesis when you should. You have to conduct a power analysis to ensure that your sample size is big enough.

For any power calculation, you need to know
  1. What type of test you going to use either independent t-test, ANOVA and others.
  2. The alpha value that you are using. For example, 0.01 or 0.05.
  3. The expected effect size itself.
  4. The sample size that going to use.
After the values are already chosen, a power value between 0 and 1 will be generated. If the power less than 0.8, you have to increase your sample size.

What is power?

Power is when you conduct a inferential statistics test, it help to understand what is power. if you are comparing two hypotheses the null and alternative hypothesis. The inferential statistics looks for evidence that you can reject the null or alternative to conclude that you studies had an effect or not. With any statistical test, there always have a possibility to find a difference between group when one does not exist. This is known as Type I error but for Type II error it possible when difference does exist which the test not able to identify.

Power also refers to the probability that your test need to find statistically significant difference when such a difference actually exists. Power is probability you to reject the null hypothesis when you should and accept that the power is greater 0.8

What alpha value that need to use to calculate power?

An alpha level is less than 0.5, it showed a statistically significant and the most common alpha level used in evalutions


What is effect size?

When a difference is significant, it does not necessarily that mean is big. It simply means you that you data had a difference. For example, that you evaluate the effect of activity on student knowledge using pre-test and post-tests. The mean score for the pre-test was 83 out of 100 while the mean score on the post-test was 84 out of 100. Although you find that the difference in scores is statistically significant because of a large sample size, the difference is very slight, suggesting that the program did not lead to a meaningful increase in student knowledge.


How to calculate the effect size?


There are different ways to calculate the effect size depending on the evaluation that you use. Generally, effect size is calculated by taking the difference between the two groups such as the mean of treatment group "minus" the mean of the control group and "dividing" it by the standard deviation of one of the groups. For example, in an evaluation with a treatment group and control group, effect size is the difference in means between the two groups divided by the standard deviation of the control group.

To interpret the resulting number, most social scientists use this general guide developed by Cohen:
·         < 0.1      = trivial effect
·         0.1 - 0.3 = small effect
·         0.3 - 0.5 = moderate effect
·         > 0.5      = large difference effect



By: Nur Fariza


References: