[R] Plotting asymptote possible with plot?

Tom Kennedy tom.kennedy at bigpond.com
Thu Aug 28 05:40:19 CEST 2003


I am calculating LOD scores in genetic epidemiology where the number of 
non recombinants is 11 and recombinants is 1. I created a function to 
calculate the z scores for the following thetas.

theta <- c(0,0.01,0.05,0.10,0.20,0.45,0.5)

The z scores for the respective thetas in this cases are:

-Inf,1.56,2.07,2.11,1.85,0.410,0.0

I attempt to plot these values using the following commands.

plot(theta, zscore, xlab = "theta", ylab = "LOD Score", type = "l", ylim 
= c(-5,5), panel.first = grid(5,16), panel.last = abline(h=0),axes=F)

axis(side = 1,at = c(0,.1,.2,.3,.4,.5))

axis(side = 2,at = c(-5,-4,-3,-2,-1,0,1,2,3,4,5))

The plot works but does not plot from the points (0,-Inf) to 
(0.01,1.56). As this is an asymptotic value, I'm unsure that the plot 
function can plot to -Inf.

I am using R 1.7.1. on WinXP sp1.

Is there a way to plot the asymptote?

Regards Tom




More information about the R-help mailing list