Tag Archives: statistics

2 types of chi-squared test

Most people have heard of chi-squared test, but not many know that there are (at least) two types of chi-squared tests. The two most common chi-squared tests are: 1-way classification: Goodness-of-fit test 2-way classification: Contingency test The goodness-of-fit chi-squared test … Continue reading

Posted in Uncategorized | Tagged , , | 1 Comment

Calculate Cronbach Alpha using Python

R has the package “psych” which allows one to calculate the Cronbach’s alpha very easily just by one line: psych::alpha(your_data, column_list) For Python, the situation is more tricky since there does not seem to exist any package for calculating Cronbach’s … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Python code for PCA Rotation “varimax” matrix

The R programming language has an excellent package “psych” that Python has no real equivalent of. For example, R can do the following code using the principal() function: principal(r=dat, nfactors=num_pcs, rotate=”varimax”) to return the “rotation matrix” in principal component analysis … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment