Calculate Sample Size for Chi-square Test

This tutorial shows how you can calcuate sample size for one variable chi-square test here. The example in this tutorial is that a marketing agency tests two versions of packaging (A version vs. B Version). The null hypothesis is that there is no difference between these two versions, and the alternative hypothesis is that there … Read more

Fisher’s LSD (Least Significant Different) in R

This tutorial shows how to do the post hoc test using Fisher’s LSD (Least Significant Different) in R. When to use Fisher’s LSD  Typically, it is when you are doing one-way ANOVA with more than 2 groups (e.g., 3 groups). Further, you should note that Fisher’s LSD is the most liberal of all post hoc tests. … Read more

Can you use one-way ANOVA for three groups?

Can you use one-way ANOVA for three groups? Yes, you can use one-way ANOVA for three groups (or, three levels). Actually, one-way ANOVA can be used for 2 groups and more than 2 groups. Example of one-way ANOVA for three groups The following is a hypothetical data example for one-way ANOVA for three groups generated … Read more

Setup Hayes PROCESS in R (4 Steps)

The following shows steps of setup Hayes Mediation PROCESS in R. After setting up the PROCESS in R, we can use Model 4 as a simple example. In the following R code, we first download the data from GitHub. Then, run it using the process(). After running the R code above, you should see the … Read more

Meaning of Hessian Matrix from optim() in R

The inverse of the Hessian matrix from optim() can be used as the asymptotic covariance matrix for estimated parameters. The name “asymptotic” is due to the direct replace the σ2 in the variance of estimated parameters with the estimated one, namely \( \hat{\sigma}^2\). If the sample size is large enough, t-distribution will be very close … Read more

OLS vs. MLE in Linear Regression

This tutorial is to compare OLS (Ordinary Least Square) and Maximum Likelihood Estimate (MLE) in linear regression. We are going to use simple linear regression as examples here. Most of the conclusions can be directly extended into general linear regressions. OLS in Linear Regression Coefficients The principle of ordinary least squares is to minimize the … Read more

Maximum Likelihood Estimation for Linear Regression in R

To use maximum likelihood estimation (MLE) in linear regression in R, you can use either optim() or mle() function. The following provides detailed R code examples. Data and Model Suppose we want to test the effect of teaching method (new vs. old) on students’ test scores. The following is the data. In the R code, 0 represents ‘old’ … Read more

List of Master’s in Data Science in Ivy League Universities

This post provides a list of Ivy League universities offering Master’s in Data Science. In short, except for Princeton and Dartmouth, most schools offers Master’s in Data Science. University Names Master’s in Data Science Webpage Columbia Yes MS Data Science webpage Cornell Yes MS Operations Research and Information Engineering Harvard Yes Program info webpage UPenn … Read more

Maximum Likelihood Estimation (MLE) in Linear Regression

This tutorial is going to explain what Maximum Likelihood Estimation (MLE) is and how Maximum Likelihood Estimation (MLE) can be used in linear regression. Basics of Maximum Likelihood Estimation Before discussing about linear regression, we need to have a basic idea of MLE. In particular, assume that \( y_i \) are all independently and identically … Read more

Chi-square Independence Test in SPSS

The chi-square independence test is a statistical test used to determine if there is a significant association between two categorical variables. It assesses whether the observed frequencies of the variables in a contingency table differ significantly from the expected frequencies under the assumption of independence. SPSS Data for Chi-square Independence Test This hypothetical data set … Read more