Learn R Programming

granova (version 1.4)

granova.ds: Granova for Display of Dependent Sample Data

Description

Plots dependent sample data beginning from a scatterplot for the X,Y pairs; proceeds to display difference scores as point projections; also X and Y means, as well as the mean of the difference scores. Also prints various summary statistics including: effect size, means for X and Y, a 95% confidence interval for the mean difference as well as the t-statistic and degrees of freedom.

Usage

granova.ds(xdata, revc = FALSE, sw = 0.4, ne = 0.5, ptpch=c(19,3), 
        ptcex=c(1,1.4), labcex = 1, ident = FALSE, 
        colors = c(1,2,1,4,2,'green3'), pt.lab = NULL,
        xlab = NULL, ylab = NULL, main = NULL, sub = NULL, 
        par.orig = TRUE)

Arguments

Value

A list is returned with the following components:mean(X)Mean of X valuesmean(Y)Mean of Y valuesmean(D=X-Y)Mean of differences D = X - YSD(D)Standard deviation of differences DES(D)Effect Size for differences D: mean(D)/SD(D)r(X,Y)Correlation based on X,Y pairsr(x+y,D)Correlation based on X+Y,D pairsLL 95%CILower bound for 95% confidence interval for population mean(D)UL 95%CIUpper bound for 95% confidence interval for population mean(D)t(D-bar)t-statistic associated w/ test of hypothesis that population mean(D) = 0.0df.tDegrees of freedom for the t-statisticpval.tP-value for two sided t-test of null hypothesis that population mean(D) does not equal zero.

Details

Paired X & Y values are plotted as scatterplot. The identity reference line (for Y=X) is drawn. Since the better data view often entails having X's > Y's the revc argument facilitates reversal of the X, Y specifications. Because all data points are plotted relative to the identity line, and summary results are shown graphically, clusters, data trends, outliers, and possible uses of transformations are readily seen, possibly to be accommodated. Parallel projections of data points to (a lower-left) line segment show how each point relates to its X-Y = D difference; blue 'crosses' are used to display the distribution of difference scores and the mean difference is displayed as a heavy dashed (red) line, parallel to the identity reference line. Means for X and Y are also plotted (as thin dashed vertical and horizontal lines), and rug plots are shown for the distributions of X (at the top of graphic) and Y (on the right side). Several summary statistics are plotted as well, to facilitate both description and inference; see below. The 95% confidence interval for the population mean difference is also shown graphically.

References

Exploratory Plots for Paired Data, Rosenbaum P., The American Statistician, May 1989, vol. 43, no. 2, pp. 108-9.

Examples

Run this code
#Data analysis and graphics, by John McDonald
library(DAAG) 
#length of stretched rubber bands; scores show length 
#after being heated (X), as well as at ambient temperature (Y).
data(pair65) 
granova.ds(pair65, 
  main = "Dependent sample assessment plot for pair65 data, n = 9")

Run the code above in your browser using DataLab