qqplot in ttest
Posted: Thu Nov 22, 2018 8:10 am
Hi,
When performing a ttest, the qq plot sometimes only shows the diagonal line, with no points.
I think I found the problem is when there are missing values in both groups being compared.
The code in ttestISClass should remove NAs in line
pieces <- lapply(pieces, function(y) y - mean(y))
i.e.
pieces <- lapply(pieces, function(y) y - mean(y, na.rm=TRUE))
or remove NAs before for x & y
When NAs are in one group only, points are shown, but I suppose are only for the group without missings.
When performing a ttest, the qq plot sometimes only shows the diagonal line, with no points.
I think I found the problem is when there are missing values in both groups being compared.
The code in ttestISClass should remove NAs in line
pieces <- lapply(pieces, function(y) y - mean(y))
i.e.
pieces <- lapply(pieces, function(y) y - mean(y, na.rm=TRUE))
or remove NAs before for x & y
When NAs are in one group only, points are shown, but I suppose are only for the group without missings.