mcp_example {mcp} | R Documentation |
Get example models and data
Description
Get example models and data
Usage
mcp_example(name, sample = FALSE)
Arguments
name |
Name of the example. One of:
|
sample |
TRUE (run |
Value
List with
-
model
: A list of formulas -
data
: The simulated data -
simulated
: The parameters used for simulating the data. -
fit
: anmcpfit
ifsample = TRUE
, -
call
: the code to run the above.
Author(s)
Jonas Kristoffer Lindeløv jonas@lindeloev.dk
Examples
ex = mcp_example("demo")
plot(ex$data) # Plot data
print(ex$simulated) # See true parameters used to simulate
print(ex$call) # See how the data was simulated
# Fit the model. Either...
fit = mcp(ex$model, ex$data)
plot(fit)
ex_with_fit = mcp_example("demo", sample = TRUE)
plot(ex_with_fit$fit)