Learn R Programming

MCPerm (version 1.1.4)

pearson_scatter: scatter plot and calculate Pearson correlation coefficient for paired data

Description

scatter plot and calculate Pearson correlation coefficient for paired data.

Usage

pearson_scatter(Trad_data, MC_data, scatter_col = "gray28", line_col = "black", title = NULL, xlab = "TradPerm P-value", ylab = "MCPerm P-value")

Arguments

Trad_data
numeric vector, e.g. the result('perm_Qp'/'perm_I2'/'perm_p') of function 'meta.TradPerm'.
MC_data
numeric vector, e.g. the result('perm_Qp'/'perm_I2'/'perm_p') of function 'meta.MCPerm'.
scatter_col
the color(default 'gray28') of the scatter points.
line_col
the color(default 'black') of the line x=y.
title
The main title (on top).
xlab,ylab
X axis label, default value is 'TradPerm P-value'. Y axis label, default value is 'MCPerm P-value'.

Details

Scatter plot and Pearson correlation coefficient(two.sided) for 'perm_Qp'/'perm_I2'/'perm_p' of 'meta.TradPerm' and 'meta.MCPerm' are to test the consistency between them.

See Also

meta.MCPerm, meta.TradPerm, chisq.MCPerm, chisq.TradPerm, VS.Hist, VS.KS, VS.Genotype.Hist, VS.Allele.Hist, PermMeta.LnOR.Hist, PermMeta.LnOR.CDC, PermMeta.LnOR.boxplot, PermMeta.LnOR.qqnorm, PermMeta.Hist, PermMeta.boxplot

Examples

Run this code
# Trad=read.table("Trad_result.txt",sep=" ",header=FALSE)
# MC=read.table("MC_result.txt",sep=" ",header=FALSE)
# par(mfrow=c(3,1))
# pearson_scatter(as.numeric(Trad[,4]),as.numeric(MC[,4]),
    # title="Q p_value ",
    # xlab="TradPerm Qp_value",
    # ylab="MCPerm Qp_value")
# pearson_scatter(as.numeric(Trad[,6]),as.numeric(MC[,6]),
    # title="I2 p_value",
    # xlab="TradPerm I2p_value",
    # ylab="MCPerm I2p_value")	 
# pearson_scatter(as.numeric(Trad[,9]),as.numeric(MC[,9]),
    # title="p_value",
    # xlab="TradPerm p_value",
    # ylab="MCPerm p_value")

Run the code above in your browser using DataLab