piplot.ct: Pre-analysis Plot for 'pistar.ct'

View source: R/piplot.ct.R

piplot.ctR Documentation

Pre-analysis Plot for pistar.ct

Description

piplot.ct is used to inform the choice of the interval on which to look for pi* with pistar.ct. It plots log-likelihood ratio statistic values of a two-point mixture of a user-supplied model and an unrestricted component fit to a contingency table on a specified number of equally-spaced points on a supplied interval.

Usage

piplot.ct(fn, data, ..., from = .Machine$double.neg.eps^0.25,
          to = 1 - .Machine$double.neg.eps^0.25,  n = 10, draw = TRUE, 
          color = "black", zero_line = TRUE, add = FALSE, values = FALSE)

Arguments

fn

a user-supplied function that inputs a contingency table of observed values and outputs a contingency table of predicted values. The function must output a named list with the contingency table of predicted values named 'fit'.

data

a contingency table.

...

further arguments passed to the user-supplied function.

from

numeric: lower bound of the interval of out-of-model proportions to be explored.

to

numeric: upper bound of the interval of out-of-model proportions to be explored.

n

numeric: number of equally-spaced points from the interval of out-of-model proportions to be explored.

draw

logical: draw a plot or lines?

color

color of the line.

zero_line

logical: plot a horizontal line at 0?

add

logical: add the line to a plot?

values

logical: return a dataframe with explored out-of-model proportions and their corresponding log-likelihood ratio statistics?

Details

Developed from John M. Grego's clr.plot

Value

A plot. If values = TRUE returns also an object of class 'PiplotCT' with the following slots:

pi

numeric vector of explored out-of-model proportions

lr

numeric vector of corresponding log-likelihood ratio statistics

lr_plus_eps

lr plus the value of eps

Author(s)

Juraj Medzihorsky, developed from John M. Grego's clr.plot

References

Grego, J.M. clr.plot function available at http://www.stat.sc.edu/~grego/courses/stat770/CLR.txt

See Also

pistar.ct rcl.em

Examples

	data(Fienberg1980a)

	mf <- function(data) loglin(data, list(1, 2), fit=TRUE, print=FALSE)

	a <- piplot.ct(fn=mf, data=Fienberg1980a, values=TRUE)

	a

	plot(a, color="red")

jmedzihorsky/pistar documentation built on June 4, 2022, 9:58 a.m.