Learn R Programming

sensR (version 1.5-2)

profile.samediff: Profile likelihood methods for samediff objects.

Description

Computes the (normalized or relative) profile likelihood for the parameters of a same-different test, plots the normalized profile likelihood and computes profile likelihood confidence intervals.

Usage

# S3 method for samediff
profile(fitted, which = 1:2, max = 2, numpts = 100,
           max.delta = 10, max.tau = 10, ...)
# S3 method for profile.samediff
plot(x, which = 1:nc, level = c(0.99, 0.95),
           fig = TRUE, ...)
# S3 method for samediff
confint(object, parm = c("tau", "delta"), level = 0.95, max = c(10, 10)
           , ...)

Arguments

fitted

a samediff object

x

a profile.samediff object

object

a samediff object

which

numeric: which parameters to profile or plot; either "1" or "2" or "1:2" to mean "tau", "delta" or both respectively.

parm

the parameter(s) to compute the confidence interval for

max

for profile: control parameter to specify how many units beyond the MLE, the profiling should proceed. For confint: control parameter, that can control the convergence for especially very large delta

numpts

control parameter: At how many points should the profile likelihood be evaluated?

max.delta

control parameter: The maximum point at which to evaluate the profile likelihood for delta

max.tau

same as max.delta for "tau".

level

for plot: At which levels to include horizontal lines to indicate confidence levels in plots of the normalized profile likelihoods. For confint: at which level to compute the confidence interval.

fig

logical: Should the normalized profile likelihoods be plotted?

not currently used.

Value

For profile: An object of class "profile.samediff", "data.frame"---a data.frame with two columns for each parameter profiled giving the value of the parameter and the corresponding value of the profile likelihood.

For plot: An object of class "nProfile.samediff", "data.frame"---the data.frame from the profile-object with extra columns corresponding to the which parameter containing the normalized profile liklelihood.

For confint: A 2x2 matrix with columns named "lower", "upper" giving the lower and upper (1 - alpha)% confidence interval for the parameters named in the rows.

See Also

summary.samediff

Examples

Run this code
# NOT RUN {
# data: 8 of the same samples were judged to be same
#       5 of the same samples were judged to be different
#       4 of the different samples were judged to be same
#       9 of the different samples were judged to be different

sadi <- samediff(8, 5, 4, 9)
confint(sadi)
plot(profile(sadi))

# }

Run the code above in your browser using DataLab