MCAR is an acronym for Missing Completely at Random MNAR means Missing not at Random When you have data missing you may try to check if this missing data is random or not. Usually this is done by checking the […]

Posts filled under:Uncategorized

MCAR is an acronym for Missing Completely at Random MNAR means Missing not at Random When you have data missing you may try to check if this missing data is random or not. Usually this is done by checking the […]

Spearman rank correlation method Better use when: variables are not normally distributed or the relationship between the variables is not linear

To remove a column from a R dataframe you have to check what is the column number and then give command like data<-data[,-1] The number will be the column to be deleted.

The correlation coefficient of two variables in a data sample is their covariance divided by the product of their individual standard deviations. It is a normalized measurement of how the two are linearly related with values beetween -1 and 1. To calculate […]

You can use function lapply() to apply function summary() to each column and then cbind() to show data as column. lapply(dataFrame,function(x) cbind(summary(x))) From http://stackoverflow.com/questions/14791075/r-format-data-frame-summary

http://www.r-bloggers.com/more-on-exploring-correlations-in-r/ cor() – table of correlations cor.prob() – Replaces the upper triangul with the significance flattenSquareMatrix(cor.prob(mydata)) – makes a table out of it flattenSquareMatrix <- function(m) { if( (class(m) != “matrix“) | (nrow(m) != ncol(m))) stop(“Must be a square […]

To pass a dataframe in R to matrix as.matrix(mtcars) Some commands work over matrix and not over dataframes

After selecting and copying the data to clipboard in Excel just do read.excel <- function(header=TRUE,…) { read.table(“clipboard”,sep=”\t”,header=header,…) } dat=read.excel() More details in http://alandgraf.blogspot.com.es/2013/02/copying-data-from-excel-to-r-and-back_24.html

For doing a test for the mean of a normal distributed variable in R do: t.test(variable, mu=55) mu= 55 is the value of the meaning that you want to test The output is something like: One Sample t-test data: variable […]

12