# Sensitivity analysis for sample size planning with the goal of Accuracy in Parameter Estimation (i.e., a narrow observed confidence interval)

### Description

Given `Estimated.R2`

and `True.R2`

, one can perform a sensitivity analysis to determine the effect of a misspecified population
squared multiple correlation coefficient using the Accuracy in Parameter Estimation (AIPE) approach to sample size planning. The function
evaluates the effect of a misspecified `True.R2`

on the width of obtained confidence intervals.

### Usage

1 2 3 4 5 |

### Arguments

`True.R2` |
value of the population squared multiple correlation coefficient |

`Estimated.R2` |
value of the estimated (for sample size planning) squared multiple correlation coefficient |

`w` |
full confidence interval width of interest |

`p` |
number of predictors |

`Random.Predictors` |
whether or not the sample size procedure and the simulation itself should be based on random (set to |

`Selected.N` |
selected sample size to use in order to determine distributional properties at a given value of sample size |

`degree.of.certainty` |
parameter to ensure confidence interval width with a specified degree of certainty |

`assurance` |
an alias for |

`certainty` |
an alias for |

`conf.level` |
confidence interval coverage (symmetric coverage) |

`Generate.Random.Predictors` |
specify whether the simulation should be based on random (default) or fixed regressors. |

`rho.yx` |
value of the correlation between |

`rho.xx` |
value of the correlation among the |

`G` |
number of generations (i.e., replications) of the simulation |

`print.iter` |
should the iteration number (between 1 and |

`...` |
for modifying parameters of functions this function calls upon |

### Details

When `Estimated.R2`

=`True.R2`

, the results are that of a simulation study when all assumptions
are satisfied. Rather than specifying `Estimated.R2`

, one can specify `Selected.N`

to determine the results of a particular sample size (when doing this `Estimated.R2`

cannot be specified).

The sample size estimation procedure technically assumes multivariate normal variables (`p`

+1) with fixed predictors (`x`

/indepdent variables),
yet the function assumes random multivariate normal predictors (having a `p`

+1 multivariate distribution). As Gatsonis and Sampson (1989) note in the context of statistical
power analysis (recall this function is used in the context of precision), there is little difference in the outcome.

In the behavioral, educational, and social sciences, predictor variables are almost always random, and thus `Random.Predictors`

should generally be used.
`Random.Predictors=TRUE`

specifies how both the sample size planning procedure and the confidence intervals are calculated based on the random predictors/regressors. The internal
simulation generates random or fixed predictors/regressors based on whether variables predictor variables are random or fixed.
However, when `Random.Predictors=FALSE`

, only the sample size planning procedure and the confidence intervals are calculated based on
the parameter. The parameter `Generate.Random.Predictors`

(where the default is `TRUE`

so that random predictors/regressors are generated) allows
random or fixed predictor variables to be generated. Because the sample size planning procedure and
the internal simulation are both specified, for purposes of sensitivity analysis random/fixed can be crossed to examine the effects of specifying sample size based on one but using it on
data based on the other.

### Value

`Results` |
a list containing vectors of the empirical results |

`Specifications` |
outputs the input specifications and required sample size |

`Summary` |
summary values for the results of the sensitivity analysis (simulation study) |

### Author(s)

Ken Kelley (University of Notre Dame; KKelley@ND.Edu)

### References

Algina, J. & Olejnik, S. (2000). Determining Sample Size for Accurate Estimation of the Squared
Multiple Correlation Coefficient. *Multivariate Behavioral Research, 35*, 119–136.

Gatsonis, C. & Sampson, A. R. (1989). Multiple Correlation: Exact power and sample size calculations. *Psychological Bulletin, 106*, 516–524.

Steiger, J. H. & Fouladi, R. T. (1992). R2: A computer program for interval estimation, power calculation,
and hypothesis testing for the squared multiple correlation. *Behavior research methods, instruments and computers, 4*, 581–582.

Kelley, K. (2008). Sample size planning for the squared multiple correlation coefficient:
Accuracy in parameter estimation via narrow confidence intervals, *Multivariate Behavioral Research, 43*, 524–555.

Kelley, K. & Maxwell, S. E. (2008). Sample Size Planning with applications to multiple regression: Power and accuracy for omnibus and targeted effects. In P. Alasuuta, J. Brannen, & L. Bickman (Eds.), *The Sage handbook of social research methods* (pp. 166–192). Newbury Park, CA: Sage.

### See Also

`ci.R2`

, `conf.limits.nct`

, `ss.aipe.R2`

### Examples

1 2 3 4 5 6 | ```
## Not run:
# Change 'G' to some large number (e.g., G=10,000)
# ss.aipe.R2.sensitivity(True.R2=.5, Estimated.R2=.4, w=.10, p=5, conf.level=0.95,
# G=25)
## End(Not run)
``` |