summary.ezsim: Summarize an ezsim Object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/summary.ezsim.r

Description

A quick summary to the simulation. Summary statistics included mean, true value (tv), bias, bias percentage (mean/tv-1), sd, rmse (root mean square error), min, q25 (first quarter), median, q75 (third quarter), max, p value of jb-test. See ezsim and plot.summary.ezsim for details and examples.

Usage

1
2
3
4
## S3 method for class 'ezsim'
summary(object,stat=c('mean','tv','bias',
'biaspercentage','sd','rmse','min','q25','median',
'q75','max','jb_test'),simple=TRUE,subset,...)

Arguments

object

An ezsim object

stat

Some preset summary statistics. Included, c('mean','tv','bias','biaspercentage','sd','rmse','min','q25','median','q75','max','jb_test')

simple

If True, shows only mean, true value, bias, sd and rmse of the estimator. If False, shows all statistics in stat.

subset

subset of estimators or parameters. See subset.ezsim for details.

...

Furhter summary statistics. Given in the form stat_name=stat. For example, Mean=mean

Value

A summary.ezsim object

Author(s)

TszKin Julian Chan ctszkin@gmail.com

See Also

ezsim, plot.summary.ezsim, getSelectionName.summary.ezsim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## 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))
)



## Summary of an ezsim object
summary(ezsim_basic)

## Summary of a subset of ezsim object
summary(ezsim_basic,subset=list(estimator='mean_hat',n=c(20,40),sigma=c(1,3)))

## More Summary Statistics
summary(ezsim_basic,simple=FALSE,subset=list(estimator='mean_hat',n=c(20,40),sigma=c(1,3)))

## Customize the Summary Statistics
summary(ezsim_basic,stat=c("q25","median","q75"),Q025=quantile(value_of_estimator,0.025),
  Q975=quantile(value_of_estimator,0.975),subset=list(estimator='mean_hat',n=c(20,40),sigma=c(1,3)))

## End(Not run)

ezsim documentation built on May 1, 2019, 8:04 p.m.