top of page

6. One sample t-test with chick weight data set


One sample t-test

A one-sample t-test can be used when you have a “standard” value or an a priori value you want to compare your own data against. For example, you might have been advised by DOC that a new minimum standard of kiwi husbandry is that no chick is to weigh less than 500 g at 50 days old. You could test whether you are already meeting this standard (or not) by extracting some records and generating a dataset which includes a representative sample of the weight of 50 day old chicks from those that you have raised over the last, say, 2 years (whatever, this is make believe).

Using a one-sample test you can statistically evaluate whether you are meeting the standard. These data you gather will take the form of a single column of data set up in Excel with the heading “Weight”, you aren’t interested in any other information, just weight at 50 days. (Here “weight” is a continuous variable, and here “Chick at 50 days” is the categorical variable with two “levels” your own data and DOC’s value of “500”). See Excel file “Chick weight 50 days”.

To conduct the tests use the following two lines of commands (I have called the new dataframe “wts” and the new t-test obect “wtsonesample”):

wts<-read.table(file.choose(), header=TRUE)

wtsonesample<-t.test(wts$Weight, mu=500)

There is no “~” in this test as you are only testing whether your weights are significantly different to the “mu” of 500 (the standard value in this example).

To get the test results you would type in “wtsonesample”(the new t-test object name) into the console. It gives the following:

> wtsonesample

One Sample t-test

data: wts$Weight

t = 3.2128, df = 35, p-value = 0.00282

alternative hypothesis: true mean is not equal to 500

95 percent confidence interval:

530.9228 637.0772

sample estimates:

mean of x

584

The results are in! You average (mean) chick weight at 50 days is 584 g. If you were wanting to report these results you would write something like, “At Kiwi Encounter during 2015-2017 (the two years you gathered the data about in this imaginary example), chicks at 50 days old were on average 584 g. This is significantly heavier than the new DOC minimum standard of 500 g (t = 3.213, df = 35, P< 0.01)”. Hurray.


bottom of page