# Hypothesis testing of the ACE(t)-p models

### Description

Comparison of different ACE(t)-p models to test a linear or a constant variance component.

### Usage

1 | ```
test_acetp(acetp, comp, sim = 100, robust = 0, pe = TRUE)
``` |

### Arguments

`acetp` |
An object from the AtCtEtp function. |

`comp` |
The component to test linearity or constant. The variance of this component must be dynamic or linear in the object from the AtCtEtp function. |

`sim` |
The number of the bootstrap resampling for approximating the null distribution when testing linearity. |

`robust` |
An integer indicating the number of different initial values that the function will randomly generate and try in the optimization. The default value is 0. |

`pe` |
A logical argument indicating whether to use penalized spline model to test linearity. The default value is TRUE. |

### Details

When pe=TRUE, the linearity is tested under a p-spline framework in which an LRT is performed. Otherwise, a *χ^2* test is performed for linearity under a spline framework without penalty on smoothness.

### Value

`p ` |
The p-value for the test. |

`llr ` |
The LRT statistic for testing linearity. |

`llr_sim ` |
The simulated null distribution of the LRT statistic for testing linearity. |

`chisq ` |
The chisq statistic for testing a constant or linearity. |

### Author(s)

Liang He

### References

He, L., Sillanpää, M.J., Silventoinen, K., Kaprio, J. and Pitkäniemi, J., 2016. Estimating Modifying Effect of Age on Genetic and Environmental Variance Components in Twin Models. Genetics, 202(4), pp.1313-1328.

### Examples

1 2 3 4 | ```
# data(data_ace)
# result <- AtCtEtp(data_ace$mz, data_ace$dz, knot_e = 7, knot_c = 5, mod=c('d','d','l'))
# re <- test_acetp(result, comp='e')
``` |