shuttle_sim_plot: Space shuttle: uncertainty in fitted linear logistic...

Description Usage Arguments Details Value See Also Examples

View source: R/shuttle_sim.R

Description

Illustrates the uncertainty in the fitted values of the probability of O-ring distress for different values of temperature, based on the linear logistic regression model fitted to the real data. Fake data from this fitted model are simulated repeatedly using the function shuttle_sim. The linear logistic model is fitted to each of these simulated datasets. A plot is produced containing the real proportions of distressed O-rings, the logistic curve fitted to the real data and each of the logistic curves fitted to the fake data.

Usage

1
2
shuttle_sim_plot(n_sim = 50, plot_real_data = TRUE, n_reps = 1,
  plot = TRUE, ...)

Arguments

n_sim

An integer scalar. The number of fake datasets to simulate, and hence the number of curves from simulated data to appear in the plot.

plot_real_data

A logical scalar. Should we add to the plot the real data and the linear logistic curve fitted to the real data? real_data = TRUE for “yes” and real_data = FALSE for “no”.

n_reps

An integer scalar. The number of flights to simulate for each of the 23 (pre-disaster) temperatures in the real dataset. For example, n_reps = 10 means that we simulate a dataset of size 230.

plot

A logical scalar indicating whether or not to produce the plot.

...

Further arguments to be passed to the lines function used to draw the curves for the simulated datasets.

Details

For details of the linear logistic model see Challenger Space Shuttle Disaster vignette and for simulation from this model see shuttle_sim.

Value

A numeric matrix with 2 columns and n_sim rows. Each row contains the estimates of the parameters of the linear logistic regression model fitted to a simulated dataset. The first column, alpha_hat, contains the estimates of the intercept parameter, the second column, beta_hat, the estimates of the slope parameter.

See Also

The Challenger Space Shuttle Disaster vignette.

shuttle_sim for simulating fake space shuttle data.

lines for arguments that can be supplied in ....

Examples

1
shuttle_sim_plot(n_sim = 50)

paulnorthrop/stat1004 documentation built on Nov. 17, 2019, 3:49 a.m.