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 average of other variables for the cases there is data missing in one variable or no data is missing.

A t test for the difference of the means can tell you if the missing data shows the same behaviour.

A difference is enough to tell that they are not equal but for say that the missing data is random it must be checked against all other variables.

Sensitivity deals with how acurate the test considering false negatives effect.

Specificity deals with false positive.

[table id=2 /]

]]>qchisq(c(0.025), df=286, lower.tail=TRUE)

For plotting the graph the command is:

local({

+ .x <- seq(213.788, 371.301, length.out=1000)

+ plotDistr(.x, dchisq(.x, df=286), cdf=FALSE, xlab=”x”, ylab=”Density”,

+ main=paste(“ChiSquared Distribution: Degrees of freedom=286”))

+ })

but can be done from Rcmdr

]]>

In a small enterprise with 3 departments the persons from one department give on average 1 value less (in 5) to the restaurant but that was caused by the troubles with the chef of one department.

]]>Better use when:

- variables are not normally distributed or
- the relationship between the variables is not linear

]]>

data<-data[,-1]

The number will be the column to be deleted.

]]>To calculate de correlation in R you just have to use:

cor(variable1,variable2)

You can use the **cor.test( )**function to test a single correlation coefficient.

Is possible to have an overview of all the correlation in a correlogram http://www.statmethods.net/advgraphs/correlograms.html

]]>`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

]]>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 matrix.“)

if(!identical(rownames(m), colnames(m))) stop(“Row and column names must be equal.“)

ut <- upper.tri(m)

data.frame(i = rownames(m)[row(m)[ut]],

j = rownames(m)[col(m)[ut]],

cor=t(m)[ut],

p=m[ut])

}

]]>as.matrix(mtcars)

Some commands work over matrix and not over dataframes

]]>