Description Usage Arguments Value Author(s) See Also Examples
View source: R/plot.summary.ezsim.r
Plot the summary statistics for several estimators in the same plot. Summary statistics abd estimators are separated by colour and linetype. The longest scalars parameter will be the x-variable of the plot. The rest of the scalars parameters will be become the facets of the plot (see ggplot2).Banker parameters will not be shown in the graph.
1 2 3 |
x |
An summary.ezsim Object |
parameters_priority |
Display priority of parameter. Any missed parameters will be sorted by length. |
ylab |
Label of y-axis |
title |
Title of the plot |
return_print |
If TRUE, return a list of ggplot2 object. If FALSE(default), all of the plot will be printed out. |
pdf_option |
A list of option pass to |
... |
unused |
Optional: a ggplot2 object
TszKin Julian Chan ctszkin@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
ezsim_basic<-ezsim(
m = 100,
run = TRUE,
display_name = c(mean_hat="hat(mu)",sd_mean_hat="hat(sigma[hat(mu)])"),
parameter_def = createParDef(list(n=seq(20,80,20),mu=c(0,2),sigma=c(1,3,5))),
dgp = function() rnorm(n,mu,sigma),
estimator = function(x) c(mean_hat = mean(x),
sd_mean_hat=sd(x)/sqrt(length(x)-1)),
true_value = function() c(mu, sigma / sqrt(n-1))
)
## Plot the summary ezsim
plot(summary(ezsim_basic,c("q25","q75")))
plot(summary(ezsim_basic,c("q25","q75"),subset=list(estimator='mean_hat')))
plot(summary(ezsim_basic,c("median"),subset=list(estimator='sd_mean_hat')))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.