ttest1samp
ttest1samp is a one-sample t-test function used to determine whether the mean of a sample differs from a specified population mean (mu0). It is a common tool in statistical analysis for testing hypotheses about a single group's average.
Inputs typically include the data x and the hypothesized mean mu0. Optional parameters may specify the direction
Outputs generally include h, the test decision indicator (1 if the null hypothesis is rejected at the
Computation follows the standard one-sample t-test formula: t = (x_bar − mu0) / (s / sqrt(n)), where x_bar is the
Assumptions center on independence of observations and approximate normality of the population, particularly for small samples.
See also related one-sample testing methods in statistics for alternative approaches when normality or other assumptions