Description Usage Arguments Details Value See Also Examples

Given data from one arm of a repeated measures clinical trial, produces a sample based on the optimal smoothing parameters.

1 2 3 | ```
samonGen(mat, Npart = 10, InitialSigmaH = 1.0, HighSigmaH = 2.0,
InitialSigmaF = 1.0, HighSigmaF = 2.0, NSamples = 0, seed0 = 1,
MaxIter = 25, FAconvg = 1E-7, FRconvg = 1E-7, SAconvg = 1E-7)
``` |

`mat` |
a matrix with the (i,j) entry representing the outcome value for subject i at time-point j. |

`Npart` |
Number of partitions to use when estimating optimal smoothing parameters, sigma H and sigma F. |

`InitialSigmaH` |
Initial value when calculating optimal sigma H. |

`HighSigmaH` |
Upper bound of search region when calculating optimal sigma H. |

`InitialSigmaF` |
Initial value when calculating optimal sigma F. |

`HighSigmaF` |
Upper bound of search region when calculating optimal sigma F. |

`NSamples` |
Number of parametric bootstrap samples to generate. |

`seed0` |
Seed to use. |

`MaxIter` |
Maximum iterations to use in optimizer. |

`FAconvg` |
Absolute change in function convergence criterion. |

`FRconvg` |
Relative change in function convergence criterion. |

`SAconvg` |
Step size convergence criterion. |

The matrix mat represents repeated measure outcome data from a single arm or treatment group of a trial. Each row represents the data from a single subject and each column data from a single time-point.

The values in the first column of mat are the baseline values and should not be missing.

Samon determines two smoothing parameters, sigma H, which represents smoothing in the "missingness" model and, sigma F, which represents smoothing in the "outcome" model. These smoothing parameters are determined by minimizing loss functions. Minimization is performed using Newton's method. The parameter InitialSigmaH is used as the initial value in the optimization of the missingness model, and, InitialSigmaF is used as the initial value in the optimization of the outcome model.

A number of stopping criteria are available: MaxIter: the maximum number of iterations to perform FAconvg: stop when abs( f_i+1 - f_i ) < FAconvg, where f_i is the loss function value at iteration i. FRconvg: stop when abs( (f_i+1 - f_i)/(f_i+1 + f_i) ) < FRconvg. SAconvg: stop when the absolute step size falls below SAconvg, i.e., abs( x_i+1 - x_i ) < SAconvg. HighSigmaH: should the value of sigma H go above this value, then the optimal value of sigma H is set to HighSigmaH. This is useful if larger values of sigma H do not change the missingness model substantially. HighSigmaF: should the value of sigma F go above this value, then the optimal value of sigma F is set to HighSigmaF. This is useful if larger values of sigma F do not change the missingness model substantially.

samonGen returns a list which includes the following:

`HM` |
matrix of results from sigma H optimization for the input data mat. Columns are sample, type, return code, iterations, optimal sigma H, and the loss function value at optimal sigma H. The "M" in the name "HM" refers to the main or input matrix mat. In this case the sample and type columns are set to 0. |

`FM` |
matrix of results from sigma F optimization for the input data mat. Columns are sample, type, return code, iterations, optimal sigma F, and loss function value at optimal sigma F. The "M" in the name "FM" refers to the main or input matrix mat. In this case the sample and type columns are set to 0. |

The return code takes the following values:

`1` |
absolute function convergence was met |

`2` |
relative function convergence was met |

`3` |
second derivative has become too small |

`4` |
maximum iterations reached |

`5` |
value reset to HighSigmaH or HighSigmaF |

`6` |
loss function smaller at HighSigmaH or HighSigmaF |

`Sample` |
a matrix of size Nsamples by NT with the sample |

The samon_userDoc.pdf file in the Examples subdirectory.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
data(samonPANSS1)
Sample1 <- samonGen(
mat = samonPANSS1,
Npart = 5, # number of partitions
InitialSigmaH = 15.6, # initial value
HighSigmaH = 25.0, # high value for H
InitialSigmaF = 8.6, # initial value
HighSigmaF = 15.0, # high value for F
seed = 211,
NSamples = 30 )
``` |

```
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.