{smcl} {* *! version 1.0.0 07oct2019 Matteo Bottai}{...} {cmd:help m_power} {hline} {hi:m_power}: Power and sample size to detect slope differences between two groups with mixed effects models {title:Syntax} {p 8 13 2} {cmd:m_power [, {it:options}]} {title:Description} {pstd} {cmd:m_power} estimates the detectable difference in the slope of a longitudinal linear trend between two groups using a random-intercept, random-slope mixed effect model (Yi and Panzarella, 2002). {title:Options} {synoptset 13 tabbed}{...} {synopt:{opt diff:erence}}specifies the detectable difference; cannot be used if subjects is specified{p_end} {synopt:{opt s:ubjects}}specifies the number of subjects; cannot be used if difference is specified{p_end} {synopt:{opt t:imepoints}}specifies the number of timepoints{p_end} {synopt:{opt level}}specifies the level of the test{p_end} {synopt:{opt power}}specifies the desired power{p_end} {synopt:{opt sigma}}specifies the residual scalar standard deviation{p_end} {synopt:{opt r}}specifies the residual correlation matrix in mata syntax{p_end} {synopt:{opt d}}specifies the random coefficient covariance matrix in mata syntax{p_end} {title:Examples} {phang}{stata "m_power, subjects(100)"}{p_end} {phang}{stata "m_power, difference(1)"}{p_end} {phang}{stata "m_power, d(2,0\0,.5) sigma(1.5) subjects(200) power(.9)"}{p_end} {title:Also see} {phang}{manhelp mixed XT:mixed}, {manhelp power R:power}{p_end} {title:Reference} {pstd}Yi Q. and Panzarella T (2002). Estimating sample size for tests on trends across repeated measurements with missing data based on the interaction term in a mixed model. Controlled Clinical Trials 23: 481-496.{p_end} {title:Author} {pstd}Matteo Bottai{p_end} {pstd}Unit of Biostatistics{p_end} {pstd}{browse "http://ki.se/":Institute of Environmental Medicine, Karolinska Institutet}{p_end} {pstd}Stockholm, Sweden{p_end}