profLikCI: Find confidence intervals for parameters in an NBDA

Description Usage Arguments Details Value Warning Getting confidence intervals for a difference between two parameters See Also

View source: R/profLikCI.R

Description

Find confidence intervals for a specific parameter, or a difference between two parameters using the profile likelihood method.

Usage

1
2
3
profLikCI(which, model, upperRange = NULL, lowerRange = NULL,
  constraintsVect = NULL, iterations = 150, inflation = 1,
  conf = 0.95, retainInt = NULL)

Arguments

which

numeric giving the parameter for which the confidence interval is to be calculated. The appropriate number can be identified from the fitted model, by entering <modelName>@varNames to extract the variable names from the model. Each variable name is preceded by its number.

model

object of class oadaFit or tadaFit

upperRange

numeric vector of length two, providing a range within which the upper endpoint of the confidence interval is known to be located. This range can be indentified using plotProfLik. upperRange can be omitted if the confidence interval only has a lower endpoint- i.e. if the profile likelihood levels out below the dotted line.

lowerRange

numeric vector of length two, providing a range within which the lower endpoint of the confidence interval is known to be located. This range can be indentified using plotProfLik. lowerRange can be omitted if the confidence interval only has a upper endpoint- e.g. if the profile likelihood is beneath the dotted line for s=0.

constraintsVect

optional numeric vector. This only needs to be used if the confidence interval for the difference between two parameters is required (see specific section below).

iterations

optional numerical giving the maximum number of iterations to be used by the optimization alogorithms.

inflation

numerical to be used if the confidence intervals are to be inflated by a specified amount, as suggested by Burnham & Anderson (2000) to allow for model selection uncertainty.

conf

numerical giving the level of confidence required, defaulting to the traditional 0.95.

retainInt

logical, can be used to force the model to retain int_ilvs in an asocial model. This is used internally by other functions when there is an offset on the s parameters, but can be safely ignored by the user.

Details

The profile likelihood method for finding (100-X)% confidence intervals works by finding the set of values for a parameter that would not be rejected in a likelihood ratio test at the X% level of significance. This is equivalent to finding the set of values for which the profile likelihood (-log likelihood optimized over all other parameters in the model) is within C units of the -log-likelihood for the model, where C is the critical value for rejection at the X% level of significance (1.92 for 95% confidence intervals). The plotProfLik function can be used to plot the profile likelihood for a parameter and find the approximate location of the endpoints of the confidence interval after which profLikCI can be used to locate the exact endpoints.

Value

A list of the form ("Lower CI","Upper CI")

Warning

This function does not work when trueTies are present in an OADA. Instead use profLikCITrueTies for the confidence intervals on a parameter, or profLikCIDiffTrueTies for the difference between two parameters.

Getting confidence intervals for a difference between two parameters

This can be achieved using the constraintsVect argument. e.g. if we wish to find the confidence interval for parameter 1 - parameter 2, we specify which=1 and constraintsVect=c(1,1,2,3,etc.). This constrains parameter 1 and 2 to be the same, but adds an offset to parameter 1 using the constrainedNBDAdata function. The resulting confidence interval is for parameter 1 - parameter 2. This can only be done for parameters of the same type i.e. differences must be within the s parameters, asoc_ilv, int_ilv or multi_ilv categories. If the user wishes to find confidence intervals for the difference between two s parameters which is thought to span zero, we advise doing this as a two step process. e.g. find the upper limit for s1-s2, setting range >0, then find the upper limit for s2-s1 setting range >0. This prevents values of s1 or s2<0 being condsidered in the optimization process, which may trigger errors.

See Also

plotProfLik


whoppitt/NBDA documentation built on April 25, 2021, 7:55 a.m.