profilelike.gls {ProfileLikelihood} | R Documentation |
Profile Likelihood for Linear Models for Longitudinal Responses Fitted by Generalized Least Squares
Description
This function provides values for a profile likelihood and a normalized profile likelihood for a parameter of interest in a linear model for longitudinal responses fitted by generalized least squares.
Usage
profilelike.gls(formula, data, correlation = NULL, subject, profile.theta,
method = "ML", lo.theta, hi.theta, length = 300, round = 2,
subset = NULL, weights = NULL, ...)
Arguments
formula |
see corresponding documentation in |
data |
a data frame. See corresponding documentation in |
correlation |
see corresponding documentation in |
subject |
see corresponding documentation in |
profile.theta |
a parameter of interest, theta; must be a numeric variable. |
method |
see corresponding documentation in |
lo.theta |
lower bound for a parameter of interest to obtain values for a profile likelihood. |
hi.theta |
upper bound for a parameter of interest to obtain values for a profile likelihood. |
length |
length of numerical grid values for a parameter of interest to obtain values for a profile likelihood. |
round |
the number of decimal places for |
subset |
should not be provided. |
weights |
should not be provided. |
... |
further arguments passed to or from other methods. |
Details
This function provides values for a profile likelihood and a normalized profile likelihood for a parameter of interest in a linear model for longitudinal responses fitted by generalized least squares. Users must define a parameter of interest in the model. This function can be used for models for longitudinal responses comparable with the gls
function. However, arguments weights and subset should not be provided. A normalized profile likelihood is obtained by a profile likelihood being divided by the maximum value of the profile likelihood so that a normalized profile likelihood ranges from 0 to 1.
Value
theta |
numerical grid values for a parameter of interest in a specified range (between lower and upper bounds). |
profile.lik |
numerical values for a profile likelihood corresponding to theta in a specified range (between lower and upper bounds). |
profile.lik.norm |
numerical values for a normalized profile likelihood ranging from 0 to 1. |
Warning
Arguments weights and subset in the gls
function are not comparable.
Missing values should be removed.
Author(s)
Leena Choi <naturechoi@gmail.com>
See Also
profilelike.plot
, profilelike.summary
, profilelike.lm
, profilelike.glm
, profilelike.polr
, profilelike.lme
, gls
Examples
data(Gasoline, package = "nlme")
xx <- profilelike.gls(formula=yield ~ endpoint, correlation=nlme::corAR1(form = ~ 1 | id),
data=Gasoline, subject="Sample", profile.theta="vapor", method="ML",
lo.theta=1, hi.theta=5, length=500, round=2)
profilelike.plot(theta=xx$theta, profile.lik.norm=xx$profile.lik.norm, round=4)