Calculate point-biserial and biserial correlations using R

When a correlation, usually Person type correlation, is calculated, two variables have to be continuous. But this requirement does not excludes the situation when one of the two variables is a dichotomous (binary) distributed. Say if we want to measure the correlations between height and gender for a group of people, the variable gender has clear dichotomous values. This kind of Pearson correlation is called point-biserial correlation, because the value for gender variable is strictly 0 or 1.

How to create factor variables in R programming

Categorical variables, including nominal and ordinal variables in R programming language are called factor variables. For example, gender(male/female) is nominal, and survey results (excellent, good, normal, bad) have ordinal values. Categorical variables are useful because many data analysis operations are related to values in different categories, such as contingency tables between two categorical variables for independence analysis, hypothesis testing of homogeneity of variances, just name a few.

Kernel density plots with ggplot2 in R

Kernel density function is a nonparametric method to find the drawing density curve of random samples, and it is often used to draw a smoothed curve in data visualization. In R programming with ggplot2 package, a chaining of functions ggplot() and geom_density() is often used to draw different smoothed curves showing the distribution of continuous variables.

Calculating The Power of a Test in Hypothesis Testing with R

In hypothesis testing, the analyst has chance to commit both Type I and Type II errors. The Type I error (α) refers to the probability of wrongly rejecting a true Null hypothesis – H0, while the Type II error (ß) represents the probability that failing to reject a false H0. The value of 1- ß is called the Power of Test in hypothesis testing. Its value says the ability of correctly rejecting a false H0, under the specified Null hypothesis – H0 and Alternative hypothesis – H1.