profile.hopit: Calculate the log likelihood profile for the fitted 'hopit'...

profile.hopitR Documentation

Calculate the log likelihood profile for the fitted hopit model

Description

Calculate the log likelihood profile for the fitted hopit model

Usage

## S3 method for class 'hopit'
profile(fitted, ..., scope = 0.15, steps = 101)

Arguments

fitted

a hopit object (a fitted model).

...

unused now.

scope

a value (fraction) defining the plotting range for a coefficient. The range is c(coef \* (1-scope), coef \* (1+scope)).

steps

at how many equally spaced points the log likelihood function is calculated for each coefficient.

Author(s)

Maciej J. Danko

See Also

plot.profile.hopit, print.profile.hopit, hopit

Examples


# DATA
data(healthsurvey)

# the order of response levels decreases from the best health to
# the worst health; hence the hopit() parameter decreasing.levels
# is set to TRUE
levels(healthsurvey$health)

# Example 1 ---------------------

# fitting the model:
model1 <- hopit(latent.formula = health ~ hypertension + high_cholesterol +
                heart_attack_or_stroke + poor_mobility + very_poor_grip +
                depression + respiratory_problems +
                IADL_problems + obese + diabetes + other_diseases,
              thresh.formula = ~ sex + ageclass + country,
              decreasing.levels = TRUE,
              control = list(trace = FALSE),
              data = healthsurvey)

# check the fit using the profile function (at 51 points)
pr <- profile(model1, steps = 51)
print(pr, plotf = FALSE)

# plot profile
plot(pr, relative = FALSE)

# alternative plot
plot(pr, relative = TRUE)


MaciejDanko/gotm documentation built on Oct. 1, 2022, 12:59 p.m.