# In YiFengEDMS/simPM: SIMulation-based power analysis for Planned Missing designs

```knitr::opts_chunk\$set(
collapse = TRUE,
comment = "#>"
)
```

## Summarize the Results

Once the simulations are completed, we can use the `summary.simpm()` function to summarize the results. The function will print out the important information contained in the `simPM()` object.

## Examples

```setwd("C:/Users/yifeng94/Desktop/simPM/simPM-git/examples")
library(simPM)
```

In this hypothetical example, the `summary.simpm()` function prints out the following:

```summary(wave.ex1)
```
• The convergence rate, the name of the parameter with the weakest statistical power and the empirical power for testing this parameter, the cost of the PHPM design, and the number of missing waves (in the case of wave-level PHPM designs) for each of the plausible PHPM designs under consideration. In this specfic example, there is only one plausible wave-level PHPM designs given the budget constraints and the specification of other arguments.
```[1] "=================results summary================"
convergence.rate weakest.param.name weakest.para.power cost.design miss.waves
1             0.92               s~~s              0.999        4530          2
```
• The optimal design based on Monte Carlo simulations.
```[1] "=================Optimal design================="
convergence.rate weakest.param.name weakest.para.power cost.design miss.waves
1             0.92               s~~s              0.999        4530          2
```
• The simulation results for all the focal parameters under the selected optimal design. It does not only include the empirical power, but also additional information such as the average parameter estimate, the empirical standard error of the parameter estimate, and the bias of parameter estimate.
```[1] "=================Optimal design for focal parameters================="
Estimate Average Estimate SD  Average SE Power (Not equal 0)   Std Est   Std Est SD
i~1        2.98293751 0.031715239 0.031616120               1.000 5.8125191 3.214384e-01
s~1        0.08626832 0.012315538 0.011890850               1.000 0.5821286 1.071983e-01
i~~i       0.26565608 0.028395191 0.027694967               1.000 1.0000000 1.479881e-16
s~~s       0.02275121 0.004702874 0.004540174               0.999 1.0000000 1.476542e-16
Std Ave SE Average Param  Average Bias Coverage Average FMI1    SD FMI1
i~1   0.3109336         2.983 -6.248508e-05    0.945   0.06909154 0.02634767
s~1   0.1017555         0.086  2.683187e-04    0.939   0.33360543 0.03811522
i~~i  0.0000000         0.268 -2.343916e-03    0.935   0.25362176 0.04437375
s~~s  0.0000000         0.023 -2.487868e-04    0.939   0.62234904 0.04767489
```
• The missing pattern matrix for the optimal design, where 1 indicates missingness and 0 indicates complete data.
```[1] "=================Optimal patterns==============="
se1 se2 se3 se4
0   1   1   0
0   1   0   1
0   0   1   1
completers   0   0   0   0
```
• The proportion of participants randomly assigned to each of the (missing) data patterns. Those proportions should add up to 1.
```[1] "=================Optimal probs=================="
[1] 0.266667 0.266667 0.266667 0.200000
```
• The number of participants actually randomely assigned to each of the (missing) data patterns.
```[1] "=================Optimal ns===================="
[1] 86 86 86 65
```

To view more details of the simulation results for the optimal PHPM design, we can extract the `simsem` output and use the `summary()` function as follows. It will output the model fit and parameter estimates over replications for the selected design.

```summary(wave.ex1\$opt.output)
```

YiFengEDMS/simPM documentation built on Dec. 31, 2019, 8:54 a.m.