The post MCAR and MNAR appeared first on Statistics tutor.

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

The post MCAR and MNAR appeared first on Statistics tutor.

]]>The post Sensitivity and Specificity appeared first on Statistics tutor.

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

Specificity deals with false positive.

Test result TRUE | Test result FALSE | |
---|---|---|

Is True | Correct | Incorrect - False Negative |

Is False | Incorrect - False Positive | Correct |

The post Sensitivity and Specificity appeared first on Statistics tutor.

]]>The post How to calculate chi square value in R appeared first on Statistics tutor.

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

The post How to calculate chi square value in R appeared first on Statistics tutor.

]]>The post Satisfaction appeared first on Statistics tutor.

]]>

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.

The post Satisfaction appeared first on Statistics tutor.

]]>The post Difference between Pearson and Spearman correlation appeared first on Statistics tutor.

]]>Better use when:

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

The post Difference between Pearson and Spearman correlation appeared first on Statistics tutor.

]]>The post Remove a column from a R dataframe appeared first on Statistics tutor.

]]>data<-data[,-1]

The number will be the column to be deleted.

The post Remove a column from a R dataframe appeared first on Statistics tutor.

]]>The post Correlation in R appeared first on Statistics tutor.

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

The post Correlation in R appeared first on Statistics tutor.

]]>The post Format output of summary appeared first on Statistics tutor.

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

The post Format output of summary appeared first on Statistics tutor.

]]>The post Better way to present correlations appeared first on Statistics tutor.

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

}

The post Better way to present correlations appeared first on Statistics tutor.

]]>The post Dataframe to matrix appeared first on Statistics tutor.

]]>as.matrix(mtcars)

Some commands work over matrix and not over dataframes

The post Dataframe to matrix appeared first on Statistics tutor.

]]>