Veterinary · Pre-clinical and foundation · also MSVE AGB-111, Veterinary Biostatistics
The statistics a veterinarian needs to read a paper, design a trial or analyse herd records: descriptive statistics, tests of significance, regression and experimental design.
In the exams: ICAR AIEEA-PG 14 (statistics unit); ASRB NET
Biostatistics is the use of statistical method on biological data: the milk records of a herd, the faecal egg counts of a flock, the antibody titres of vaccinated birds, the outcome of a drug trial in dogs. Research methodology is the discipline of asking a question in a way that data can answer, and then collecting, analysing and reporting those data honestly. In the Indian BVSc & AH curriculum the subject sits with Animal Genetics & Breeding as 'Biostatistics, Computer Application & Research Methodology'; veterinary schools elsewhere teach the same material as quantitative methods, epidemiological methods or evidence-based veterinary medicine.
The practitioner needs it to read a paper and judge whether its conclusion follows from its data, to interpret a diagnostic test, to analyse herd records, and to avoid being misled by a small, uncontrolled 'trial' in a sales pitch. The researcher needs it before the first animal is enrolled: the design, the experimental unit and the sample size decide what a study can ever show, and no analysis rescues a badly designed experiment.
Examinations test the subject in a predictable way. Postgraduate entrance and scientist-recruitment papers (ICAR AIEEA-PG Animal Sciences, ICAR AICE-JRF/SRF, ASRB NET and their equivalents elsewhere) ask short numerical problems on means, standard deviations, standard errors, t, chi-square and F statistics, regression coefficients and degrees of freedom in experimental designs, plus recall of which test fits which data. This manual works through each of these with livestock and companion-animal examples. Every formula is stated with its variant, because textbooks differ (for example, the divisor n or n − 1 in a variance), and an examiner expects you to apply the one stated in the question.
A variable is a characteristic that varies from one animal or unit to another. Qualitative (categorical) variables place an animal in a class: breed, sex, vaccination status, body condition grade. Quantitative variables are counted or measured. Discrete variables take whole-number values (litter size, number of ticks, parity); continuous variables can take any value in a range (body weight, milk yield, rectal temperature). Stevens' four scales of measurement decide which statistics are valid. A nominal scale only names classes (coat colour). An ordinal scale orders them without equal intervals (lameness score 1 to 5, body condition score). An interval scale has equal intervals but an arbitrary zero (temperature in degrees Celsius), so ratios are meaningless: 40 °C is not twice as hot as 20 °C. A ratio scale has a true zero (weight, yield, cell count), so every arithmetic operation is valid. Means and standard deviations suit interval and ratio data; medians and percentiles suit ordinal data; nominal data are summarised by counts and proportions. Raw data are usually condensed into a frequency distribution: class intervals, their frequencies and cumulative frequencies, displayed as a histogram, frequency polygon or ogive (a cumulative frequency curve).
A measure of central tendency is a single value that represents the centre of a distribution. The arithmetic mean is the sum of the observations divided by their number, x̄ = Σx / n. For grouped data, x̄ = Σfx / Σf, where x is the class mid-point and f its frequency. The mean uses every observation and is the basis of most further statistics, but one extreme value pulls it strongly: one cow giving 30 litres in a herd of 8 to 15 litre cows inflates the herd mean. Two algebraic properties are examined often: the sum of deviations from the mean is zero, Σ(x − x̄) = 0, and the sum of squared deviations is smallest when taken about the mean. A weighted mean, Σwx / Σw, is needed when groups of different size are combined; averaging the means of a 20-cow farm and a 50-cow farm without weighting gives the small farm too much influence. The geometric mean, the nth root of the product of n values, equals the antilog of the mean of the logarithms. It is the correct average for ratios, growth rates and serial-dilution titres; veterinary serology reports the geometric mean titre (GMT) of a vaccinated group. The harmonic mean, n / Σ(1/x), is the correct average of rates when the numerator is fixed, such as speeds over equal distances. For any set of positive values that are not all equal, AM > GM > HM.
The median is the middle value of the ordered observations: the ((n + 1)/2)th value, or the mean of the two middle values when n is even. For grouped data, median = L + ((N/2 − cf) / f) × h, where L is the lower limit of the median class, cf the cumulative frequency before it, f its frequency and h the class width. The median is unaffected by extreme values, which makes it the right summary for skewed data such as faecal egg counts, somatic cell counts, parasite burdens and survival times. The sum of absolute deviations is smallest when taken about the median. The mode is the most frequent value; a distribution may be unimodal, bimodal or multimodal. For grouped data, mode = L + ((f1 − f0) / (2f1 − f0 − f2)) × h, where f1 is the modal class frequency and f0 and f2 the frequencies of the classes before and after it. The mode is the only average for nominal data (the commonest breed presented at a clinic). In a symmetrical distribution mean, median and mode coincide. In a positively (right) skewed distribution the long tail pulls the mean above the median, which lies above the mode; in negative skew the order reverses. For moderately skewed distributions Karl Pearson's empirical relation, mode ≈ 3 median − 2 mean, links the three.
Two herds can share a mean yield of 10 litres while one is uniform and the other ranges from 2 to 25 litres; dispersion measures that spread. The range, maximum minus minimum, is quick but depends on only two values and grows with sample size. The quartile deviation (semi-interquartile range) is (Q3 − Q1)/2, and the interquartile range Q3 − Q1 contains the middle 50% of observations; like the median, both resist outliers and are the natural partners of the median in box-and-whisker plots. The mean deviation is the average absolute deviation from the mean or median. The variance is the mean squared deviation. For a whole population, σ² = Σ(x − μ)² / N. For a sample used to estimate the population variance the divisor is n − 1: s² = Σ(x − x̄)² / (n − 1). Dividing by n − 1 (Bessel's correction) makes s² an unbiased estimator of σ², because deviations measured from the sample mean are on average slightly smaller than deviations from the true mean; n − 1 is the degrees of freedom, since only n − 1 deviations are free once the mean is fixed. A convenient computing formula is Σ(x − x̄)² = Σx² − (Σx)²/n. Some older texts define the sample variance with divisor n; an examination question that wants this will say so, and you must use whichever divisor the question states.
The standard deviation is the positive square root of the variance and is in the same units as the data. Adding a constant to every observation shifts the mean by that constant but leaves the standard deviation unchanged; multiplying every observation by a constant multiplies the mean and the standard deviation by that constant and the variance by its square. The coefficient of variation, CV = (s / x̄) × 100, is unit-free, so it compares variability of traits measured in different units or with very different means: the variability of milk yield against fat percentage, or of laboratory assay replicates. The standard error of the mean, SE = s / √n, is not a measure of spread among animals; it measures how precisely the sample mean estimates the population mean. It shrinks as sample size grows, which is why a paper that reports mean ± SE looks less variable than one reporting mean ± SD. Report SD to describe animals and SE (or better, a confidence interval) to describe the precision of an estimate, and always state which one you are giving.
Skewness measures asymmetry. Karl Pearson's first coefficient is Sk = (mean − mode) / SD; because the mode is unstable, the second coefficient, Sk = 3(mean − median) / SD, is often preferred. Bowley's coefficient uses quartiles: (Q3 + Q1 − 2 median) / (Q3 − Q1). A positive value means a long right tail, which is the usual shape of parasite counts, somatic cell counts and hospital stay. Moment-based measures use the second, third and fourth central moments: β1 = μ3² / μ2³ for skewness and β2 = μ4 / μ2² for kurtosis. Kurtosis describes the peakedness and tail weight of a distribution relative to the normal curve, for which β2 = 3. A distribution with β2 > 3 is leptokurtic (sharper peak, heavier tails), one with β2 < 3 platykurtic, and the normal curve mesokurtic. Some software reports excess kurtosis, β2 − 3, so that the normal curve scores zero; check which convention a printout uses. Strongly skewed data are often transformed before analysis: logarithms for counts and titres, square roots for small counts, and the arcsine square-root transformation for proportions.
Probability is a number between 0 and 1 expressing how likely an event is. In the classical (a priori) definition it is the number of favourable outcomes divided by the number of equally likely outcomes; in the relative-frequency definition it is the long-run proportion of times the event occurs, which is how most veterinary probabilities (a conception rate, a case-fatality rate) are estimated. The addition rule: P(A or B) = P(A) + P(B) − P(A and B), which reduces to P(A) + P(B) for mutually exclusive events. The multiplication rule: P(A and B) = P(A) × P(B|A), which reduces to P(A) × P(B) for independent events. The probability of at least one event among independent events is most easily found as 1 minus the probability of none. Conditional probability and Bayes' theorem underpin diagnostic testing. Sensitivity is the probability that a test is positive in a diseased animal; specificity the probability that it is negative in a non-diseased animal. The positive predictive value, the probability that a test-positive animal is truly diseased, is (Se × P) / (Se × P + (1 − Sp)(1 − P)), where P is the prevalence. Because PPV depends on prevalence, even a good test gives mostly false positives when used to screen a population in which the disease is rare, which is why screening programmes confirm positives with a second, more specific test.
A random variable takes values with given probabilities; its probability distribution lists them. The binomial distribution describes the number of 'successes' x in n independent trials, each with the same success probability p: P(x) = nCx p^x q^(n − x), where q = 1 − p. Its mean is np and its variance npq, so the variance is always less than the mean. Examples: the number of female calves among n births, the number of cows conceiving out of n inseminated, the number of seropositive animals in a sample from a large population. The Poisson distribution describes counts of rare events in a fixed interval of time or space when events occur independently at a constant average rate m: P(x) = e^(−m) m^x / x!. Its mean and variance are both equal to m, a property used to check whether counts are random. Examples: dystocia cases per month in a large herd, colonies per plate, cells per haemocytometer square. Counts whose variance is much greater than the mean, as parasite counts usually are, are over-dispersed or aggregated; the negative binomial distribution is commonly used to describe them.
The normal (Gaussian) distribution is the symmetrical, bell-shaped curve defined by its mean μ and standard deviation σ. Mean, median and mode coincide; the curve is asymptotic to the horizontal axis; about 68.27% of values lie within μ ± 1σ, 95.45% within μ ± 2σ and 99.73% within μ ± 3σ, while exactly 95% lie within μ ± 1.96σ and 99% within μ ± 2.576σ. Any normal variable is converted to the standard normal variable by z = (x − μ)/σ, which has mean 0 and SD 1; tables of z give areas under the curve. Many biological measurements (body length, birth weight within a breed, haematological values in healthy animals) are close to normal, and the central limit theorem makes sample means approximately normal whatever the parent distribution. Reference intervals in clinical pathology are traditionally the central 95% of values from healthy animals, which is why about 5% of healthy animals fall outside them. Three distributions derived from the normal are used for testing. Student's t distribution (W.S. Gosset, 1908) is symmetrical with heavier tails than the normal; its shape depends on degrees of freedom and it approaches the standard normal as df increase. The chi-square distribution is the distribution of a sum of squared standard normal variables; it is positively skewed, takes only non-negative values, and has mean equal to its df and variance twice its df. The F distribution, named for R.A. Fisher, is the ratio of two independent chi-square variables each divided by its df; it has two df, one for the numerator and one for the denominator, and the square of t with v df is F with 1 and v df.
The population (universe) is the whole set of units about which a conclusion is wanted: all dairy cattle in a district, all dogs presented to a hospital in a year. A census examines every unit; the livestock census is the familiar example. A sample examines a part and generalises, which is cheaper, faster and often more accurate, because fewer, better-trained enumerators make fewer measurement errors. The sampling frame is the list from which the sample is drawn: a register of villages, a herd book, a list of client records. The sampling unit is what is selected (a village, a herd, an animal) and may differ from the unit on which measurements are made. A statistic (x̄, s, p) is computed from a sample and estimates the corresponding parameter (μ, σ, π) of the population. Errors are of two kinds. Sampling error is the chance difference between a statistic and the parameter; it is unavoidable, measurable, and shrinks as sample size grows. Non-sampling errors arise from a defective frame, non-response, mis-recording, faulty instruments or interviewer bias; they occur in censuses as well as samples, do not fall with sample size, and are controlled only by good design and training.
In probability sampling every unit has a known, non-zero chance of selection, which is what allows sampling error to be calculated. In simple random sampling every possible sample of size n is equally likely; units are chosen with random-number tables or a random-number generator, without replacement in practice. Systematic sampling picks every kth unit after a random start between 1 and k, where k = N/n is the sampling interval; it is easy in an abattoir line or milking parlour but can be biased if the list has a periodic pattern that matches k. Stratified random sampling divides a heterogeneous population into internally homogeneous strata (by agro-climatic zone, breed or herd size) and samples randomly within each; it guarantees each stratum is represented and gives a more precise estimate than a simple random sample of the same total size when strata differ. With proportional allocation, each stratum's sample is proportional to its size, n_h = n × N_h / N; Neyman (optimum) allocation also weights by the stratum SD. Cluster sampling selects groups (villages, herds, pens) and examines all units in the chosen groups; it is cheap where no list of individual animals exists, but animals in the same cluster resemble each other, so precision is lower than for a simple random sample of the same number of animals. Multistage sampling selects clusters, then units within them (districts, villages, households, animals), as most national livestock surveys do. Non-probability methods (convenience, purposive or judgement, quota and snowball sampling) are quick but their sampling error cannot be estimated validly and they are prone to selection bias.
If repeated samples of size n were drawn, the sample means would themselves form a distribution, the sampling distribution of the mean, with mean μ and standard deviation σ/√n, the standard error. By the central limit theorem this distribution is approximately normal for reasonably large n even when the observations are not. A confidence interval uses this. For a large sample, the 95% confidence interval for a mean is x̄ ± 1.96 × SE; for a small sample from a normal population, replace 1.96 with the t value for n − 1 df. For a proportion p from a large sample, the 95% interval is p ± 1.96 √(p(1 − p)/n), the Wald interval; exact (Clopper-Pearson) or Wilson intervals are preferred when n is small or p is near 0 or 1. Interpret a 95% interval as the result of a procedure that captures the true parameter in 95% of repeated samples; it is not a statement that 95% of animals lie inside it. When a sample is a sizeable fraction of a finite population, the standard error is multiplied by the finite population correction √((N − n)/(N − 1)), which some texts approximate as √(1 − n/N).
A test of significance asks whether an observed difference is larger than chance alone would readily produce. The null hypothesis H0 states no effect or no difference (the new anthelmintic and the standard give the same mean egg-count reduction); the alternative hypothesis H1 states that there is a difference (two-tailed) or a difference in a stated direction (one-tailed). A test statistic is computed and compared with its sampling distribution under H0. The P value is the probability, if H0 were true, of a result at least as extreme as the one observed. It is not the probability that H0 is true. If P is below the chosen significance level α (conventionally 0.05), H0 is rejected. Rejecting a true H0 is a Type I error, whose probability is α. Failing to reject a false H0 is a Type II error, probability β. Power, 1 − β, is the probability of detecting a real effect of a stated size; it rises with sample size, effect size and α, and falls with variability. The critical values of z are 1.96 (two-tailed) and 1.645 (one-tailed) at α = 0.05, and 2.576 and 2.326 at α = 0.01. A non-significant result in a small study is not evidence of no effect; it may simply lack power. Equally, a statistically significant difference is not necessarily large enough to matter in practice.
When σ is unknown and estimated by s, the standardised mean follows Student's t distribution. The one-sample t-test compares a sample mean with a hypothesised value μ0: t = (x̄ − μ0) / (s/√n), with n − 1 df. The paired t-test is used when each observation in one set is matched with one in the other: the same animals before and after treatment, the two eyes or two udder halves of an animal, or twin calves. Compute each difference d, then t = d̄ / (s_d/√n) with n − 1 df, where n is the number of pairs. Pairing removes between-animal variation and is usually far more powerful than treating the data as independent. The independent (unpaired) two-sample t-test compares the means of two separate groups. The classical (Student) version assumes equal population variances and pools them: s_p² = [(n1 − 1)s1² + (n2 − 1)s2²] / (n1 + n2 − 2), t = (x̄1 − x̄2) / √(s_p²(1/n1 + 1/n2)), with n1 + n2 − 2 df. Equality of variances can be checked with the variance-ratio F test, F = larger s² / smaller s². When variances differ, Welch's t-test uses separate variances and an adjusted (usually fractional) df. For large samples the same formulas are used with z in place of t. Assumptions are independence of observations, approximate normality of the data (or of the differences in a paired test) and, for Student's version, equal variances.
Non-parametric (distribution-free) tests do not assume a particular distribution; most work on ranks. They suit ordinal data such as lameness or pain scores, small samples from clearly non-normal populations, and data with outliers. The sign test uses only the direction of paired differences. The Wilcoxon signed-rank test is the non-parametric counterpart of the paired t-test: rank the absolute differences, attach their signs and compare the positive and negative rank sums. The Mann-Whitney U test (Wilcoxon rank-sum test) is the counterpart of the independent two-sample t-test: rank all observations together and compare rank sums between groups. For more than two groups the Kruskal-Wallis test replaces one-way ANOVA, and the Friedman test replaces the randomised block (two-way) ANOVA. Spearman's rank correlation replaces Pearson's correlation. When the assumptions of a parametric test hold, the parametric test is more powerful, so the non-parametric test needs somewhat more animals to detect the same effect; when the assumptions fail badly, the non-parametric test is the safer choice.
Karl Pearson's chi-square test (1900) compares observed frequencies with frequencies expected under a hypothesis: χ² = Σ (O − E)² / E, summed over all classes. It works on counts, never on percentages, proportions or means; converting counts to percentages changes the statistic. In a goodness-of-fit test the expected frequencies come from a theoretical ratio or distribution. The genetic example is classic: are 110 polled and 50 horned calves consistent with a 3:1 ratio? Expected frequencies are 120 and 40, χ² = (110 − 120)²/120 + (50 − 40)²/40 = 3.33, with df = number of classes − 1 = 1. The 5% critical value for 1 df is 3.841, so the data do not contradict the 3:1 hypothesis. A dihybrid 9:3:3:1 test has 3 df (critical value 7.815). When parameters of the expected distribution are estimated from the same data, one further df is lost for each parameter estimated: fitting a Poisson distribution whose mean is estimated from the data gives df = classes − 2.
A contingency table cross-classifies animals by two attributes, for example vaccination status against whether the animal fell ill, or breed against mastitis status. The test of independence asks whether the attributes are associated. The expected frequency of each cell is (row total × column total) / grand total, and df = (r − 1)(c − 1) for r rows and c columns, so a 2 × 2 table has 1 df and a 3 × 4 table 6 df. For a 2 × 2 table with cells a, b, c, d, a short-cut formula is χ² = N(ad − bc)² / [(a + b)(c + d)(a + c)(b + d)]. Yates' continuity correction (1934) subtracts 0.5 from each |O − E| before squaring in a 2 × 2 table; equivalently, N(|ad − bc| − N/2)² in the short-cut form. It makes the test more conservative and is traditionally recommended when an expected frequency is small, although many statisticians now prefer Fisher's exact test, which computes the exact probability of the observed table from the hypergeometric distribution and is the standard choice when any expected frequency is below 5. Cochran's guideline for larger tables is that no expected frequency should be below 1 and no more than 20% below 5; otherwise merge classes sensibly. A significant χ² shows association, not causation, and says nothing about its strength; report a measure such as the relative risk or odds ratio with its confidence interval as well.
McNemar's test is the chi-square test for paired nominal data, such as two diagnostic tests applied to the same animals; it uses only the discordant pairs b and c: χ² = (b − c)² / (b + c), or (|b − c| − 1)² / (b + c) with continuity correction, on 1 df. The chi-square test of homogeneity, which compares the distribution of a category across several independently sampled groups, uses the same arithmetic as the test of independence. The test has clear limits. Observations must be independent, so the same animal must not be counted twice; animals within a herd are not independent for an infectious disease, and herd-level clustering inflates apparent significance unless accounted for. The test needs absolute frequencies of adequate size. And because χ² rises with N for the same proportions, a large survey can make a trivial association significant.
Comparing three or more means by repeated t-tests inflates the chance of a false positive: with three groups there are three pairwise tests, and if each uses α = 0.05 the probability of at least one false positive when all means are truly equal is 1 − 0.95³ ≈ 0.14 (treating the tests as independent). Analysis of variance, developed by R.A. Fisher at Rothamsted, tests all means at once. It partitions the total variation into components. In one-way ANOVA with k groups and N observations in total: total sum of squares SST = Σ(x − x̄)², computed as Σx² − CF where the correction factor CF = G²/N and G is the grand total; treatment (between-group) sum of squares SSTr = Σ(T_i²/n_i) − CF, where T_i is a group total; error (within-group) sum of squares SSE = SST − SSTr. Degrees of freedom are N − 1 total, k − 1 treatment, N − k error. Each sum of squares divided by its df gives a mean square. The error mean square estimates the common variance σ² whether or not H0 holds; the treatment mean square estimates σ² only when the group means are equal and is larger otherwise. Their ratio, F = MSTr/MSE, is compared with the F table at (k − 1, N − k) df. With only two groups, one-way ANOVA is equivalent to the pooled t-test and F = t².
ANOVA assumes that observations are independent, that the residuals within each group are approximately normal, and that the groups have equal variances (homoscedasticity). Bartlett's or Levene's test checks the last assumption; transformations (logarithm, square root, arcsine) often correct skewness and unequal variances together. When assumptions fail badly, the Kruskal-Wallis test is the non-parametric alternative for a one-way layout. A significant F says only that not all means are equal. To find which differ, a multiple-comparison procedure follows. The least significant difference, LSD = t(α, error df) × √(2 MSE / r) for r replicates per treatment, is the simplest and is widely used in agricultural research when the F test is significant (Fisher's protected LSD). Duncan's multiple range test (DMRT) remains common in animal-science journals and reports results as superscript letters, means sharing a letter not differing significantly. Tukey's honestly significant difference controls the family-wise error rate for all pairwise comparisons and is more conservative; Dunnett's test compares each treatment only with a control; the Bonferroni approach divides α by the number of comparisons.
Beyond the F test, report how much of the variation the treatments explain. Eta squared, η² = SSTr/SST, is the proportion of total variation attributable to treatments; in regression language it is R². In a fixed-effects model (Model I) the treatments are the specific levels of interest (three named diets), and conclusions apply only to them. In a random-effects model (Model II) the levels are a random sample from a larger population (sires drawn from a breed), and interest lies in the variance component among them. Animal breeders estimate heritability from exactly this: in a one-way sire model with k progeny per sire, the between-sire variance component is (MS between − MS within)/k. Two-way ANOVA extends the partition to two factors and, with replication, to their interaction; it is the analysis behind the randomised block and factorial designs in the next chapter.
Correlation measures the strength and direction of a linear relationship between two variables measured on the same units, such as heart girth and body weight in goats. Plot a scatter diagram first: a curved relationship or one outlier can give a misleading coefficient. Karl Pearson's product-moment correlation coefficient is r = Sxy / √(Sxx Syy), where Sxy = Σ(x − x̄)(y − ȳ) = Σxy − ΣxΣy/n, Sxx = Σ(x − x̄)² and Syy = Σ(y − ȳ)². It lies between −1 and +1; 0 means no linear relationship (not necessarily no relationship), and ±1 a perfect straight line. r has no units and is unchanged by adding constants to, or multiplying by positive constants, either variable (change of origin and scale). The coefficient of determination r² is the proportion of variation in one variable explained by its linear relationship with the other: r = 0.7 explains 49%. To test whether a sample r differs from zero, t = r √(n − 2) / √(1 − r²) with n − 2 df. Spearman's rank correlation, r_s = 1 − 6Σd² / (n(n² − 1)), where d is the difference between the ranks of each pair, is used for ordinal data or when the relationship is monotonic but not linear, for example the agreement of two judges ranking animals at a show. Correlation does not establish causation: two variables may both depend on a third (herd size and both milk yield and mastitis incidence), and correlations computed from time series or group averages are especially prone to being spurious.
Regression describes how one variable (the dependent or response variable, y) changes with another (the independent or predictor variable, x), and is used for prediction, for example estimating body weight from heart girth when no weighbridge is available. The least-squares line ŷ = a + bx minimises the sum of squared vertical deviations of the points from the line. The regression coefficient (slope) of y on x is b_yx = Sxy / Sxx, the change in y per unit change in x, and the intercept is a = ȳ − b x̄, so the line always passes through the point (x̄, ȳ). The regression of x on y, b_xy = Sxy / Syy, is a different line unless r = ±1; the two lines intersect at (x̄, ȳ). Three relations are examined often: r² = b_yx × b_xy, so r is the geometric mean of the two regression coefficients and carries their common sign; b_yx = r (s_y / s_x); and, unlike r, a regression coefficient has units and changes with the units of measurement. The significance of b is tested with t = b / SE(b) on n − 2 df, which for simple regression is the same test as for r. Predictions should not be extrapolated beyond the range of x in the data: a heart-girth equation developed in adult goats does not hold for kids.
Multiple linear regression, y = a + b1x1 + b2x2 + …, predicts a response from several predictors at once; each partial regression coefficient is the change in y per unit change in that predictor with the others held constant. The multiple coefficient of determination R² is the proportion of variation explained; adjusted R² penalises the addition of predictors that add little. Residuals, the differences between observed and fitted values, should be plotted against fitted values to check linearity and constant variance. When the response is binary (diseased or not, conceived or not), logistic regression models the log odds of the outcome; the exponentiated coefficient of a predictor is an odds ratio, which is why logistic regression is the standard multivariable tool of veterinary epidemiology. Counts are modelled with Poisson or negative binomial regression, and time-to-event data such as days to conception or survival after diagnosis with survival methods such as Kaplan-Meier curves and Cox proportional-hazards regression.
An experiment differs from an observational study because the investigator assigns the treatments. R.A. Fisher set out three basic principles. Replication, applying each treatment to more than one experimental unit, provides an estimate of experimental error and increases precision, since the standard error of a treatment mean is σ/√r. Randomisation, allotting treatments to units by a chance mechanism, gives every unit the same chance of each treatment, protects against conscious and unconscious bias, and makes the error estimate valid. Local control (blocking) groups similar units so that treatments are compared within homogeneous groups, removing known sources of variation such as litter, parity, initial weight or pen location from the error. The experimental unit is the smallest unit to which a treatment is independently applied. If a diet is fed to a whole pen of pigs, the pen is the experimental unit, and treating each pig as a replicate (pseudoreplication) exaggerates the error df and the apparent significance. Treatments should include a suitable control, outcome assessment should be blinded wherever possible, and the response variable, the analysis and the sample size should be fixed before the trial begins.
In the completely randomised design (CRD) treatments are allotted to units entirely at random, with equal or unequal replication. It is the simplest and most flexible design, allows the maximum error df, and tolerates missing values easily, but it is efficient only when the experimental material is homogeneous: laboratory animals of one strain, age and sex, or uniform day-old chicks. The analysis is one-way ANOVA with df: treatments t − 1, error t(r − 1) for equal replication, total tr − 1. In the randomised block design (RBD, randomised complete block design) units are first grouped into r blocks of t similar units (littermates, animals of similar initial weight, cows of the same parity), and each treatment appears once in every block, at random. Two-way ANOVA removes block variation from the error: SS total = SS blocks + SS treatments + SS error, with df r − 1 for blocks, t − 1 for treatments and (r − 1)(t − 1) for error. RBD is the most widely used design in livestock feeding trials. If blocks do not in fact differ, a little precision is lost through the error df given to blocks. A single missing value in an RBD can be estimated by y = (tT + rB − G) / ((t − 1)(r − 1)), where T and B are the totals of the treatment and block containing the missing unit and G is the grand total of the observations present; one error df is then subtracted.
The Latin square design controls two sources of variation at once. With t treatments it needs t² units arranged in t rows and t columns, each treatment appearing once in each row and once in each column. In a feeding trial with dairy cows the rows may be periods and the columns cows, giving a change-over (switchover, crossover) design in which each cow receives every treatment in turn. The ANOVA has df t − 1 each for rows, columns and treatments and (t − 1)(t − 2) for error, so a 4 × 4 square has only 6 error df; small squares are often replicated. Change-over designs assume no carry-over effect of one treatment into the next period unless a washout period or a carry-over-balanced arrangement is used, and they suit short-term responses rather than whole lactations. A factorial experiment studies two or more factors simultaneously, every level of each factor combined with every level of the others: a 2 × 3 factorial of two protein levels and three energy levels has 6 treatment combinations, and a 2³ factorial has 8. Factorials estimate the main effect of each factor and their interaction, which exists when the effect of one factor depends on the level of another, such as a feed additive that improves growth only at the low protein level. The combinations are laid out in a CRD or RBD; for a factorial in an RBD the treatment df (combinations − 1) are split into main effects and interactions.
A study that is too small cannot detect the effect it was designed to find, wastes the animals it uses and can mislead by reporting 'no significant difference'; one that is too large wastes resources and exposes more animals than necessary, which animal ethics committees and the Reduction principle of the 3Rs forbid. Every sample-size calculation needs the same ingredients: the significance level α (usually 0.05, two-sided), the desired power 1 − β (usually 0.80 or 0.90), the smallest difference worth detecting or the precision required, and an estimate of variability (SD for a continuous outcome, expected proportion for a binary one) taken from a pilot study or the literature. Sample size rises when the detectable difference is smaller, when variability is larger, when α is made smaller or when power is raised. The z values used are z(α/2) = 1.96 for α = 0.05 two-sided and z(β) = 0.842 for 80% power or 1.282 for 90% power. Results are always rounded up to the next whole number, and the figure is then increased for expected losses: if 10% of animals may drop out, divide by 0.9.
To estimate a mean within ± d with 95% confidence, n = z² σ² / d². To estimate a proportion (a prevalence) within ± d absolute, n = z² p(1 − p) / d², where p is the expected prevalence; when nothing is known, p = 0.5 gives the largest, safest n, which is 384.16 for ± 5% at 95% confidence, so 385 after rounding up (often quoted as 384). To compare two means with a two-sided test, the number per group is n = 2(z(α/2) + z(β))² σ² / Δ², where Δ is the difference to detect and σ the common SD. To compare two proportions p1 and p2, a simple form is n = (z(α/2) + z(β))² [p1(1 − p1) + p2(1 − p2)] / (p1 − p2)² per group; other texts use a pooled-variance form or add a continuity correction, which give somewhat larger numbers, so state the formula used. When the sample is a sizeable fraction of a finite population N, the initial n0 is adjusted by the finite population correction, n = n0 / (1 + n0/N); some texts use n0 / (1 + (n0 − 1)/N). Cluster sampling needs more animals than simple random sampling: multiply by the design effect, DE = 1 + (m − 1)ρ, where m is the number of animals sampled per cluster and ρ the intra-cluster correlation coefficient.
Surveillance often asks not 'what is the prevalence?' but 'is the disease present at all?'. The sample must be large enough that, if the disease were present at or above a design (threshold) prevalence p*, at least one positive animal would be found with the stated confidence. For a large population and a perfect test, the probability that n animals are all negative when the true prevalence is p* is (1 − p*)^n; setting this equal to 1 − confidence gives n = ln(1 − CL) / ln(1 − p*). At 95% confidence and a design prevalence of 5% this gives 59 animals; at 1% it gives 299. For small populations the hypergeometric approximation of Cannon and Roe is used, n ≈ (1 − (1 − CL)^(1/D)) × (N − (D − 1)/2), where D = N × p* is the number of diseased animals expected. Imperfect sensitivity raises the required number, and imperfect specificity means positives must be confirmed. These calculations underlie the herd and zone freedom-from-disease surveys described in WOAH guidance, which countries use to support trade.
A computer has input devices (keyboard, scanner, barcode or RFID reader), a central processing unit (CPU) that executes instructions, memory, storage and output devices. Primary memory includes random-access memory (RAM), which is volatile and holds the programs and data in current use, and read-only memory (ROM), which is non-volatile and holds start-up instructions. Secondary storage (hard disk, solid-state drive, optical disc, flash drive, cloud storage) keeps data when power is off. System software, above all the operating system, manages the hardware and runs application software such as word processors, spreadsheets, database managers, statistical packages, practice-management and herd-recording programs. Computers represent data in binary: a bit is a 0 or 1, and a byte is 8 bits. Storage multiples are reported in two conventions: binary (1 kibibyte = 1,024 bytes, the traditional meaning of 'kilobyte' in computing) and decimal (1 kilobyte = 1,000 bytes, used by storage manufacturers and the SI). A decimal number is converted to binary by repeated division by 2, reading the remainders upward: 13 = 1101 in binary.
A spreadsheet is a grid of cells identified by column letter and row number (B4). A cell holds a value or a formula beginning with '='. Formulas follow operator precedence: brackets first, then exponentiation (^), then multiplication and division, then addition and subtraction, so =2+3*4 gives 14. A relative reference (B2) changes when a formula is copied; an absolute reference ($B$2) does not, and a mixed reference ($B2 or B$2) fixes only the column or the row. Absolute references are used for a constant such as a price per kilogram or a conversion factor applied to a whole column. Common functions include SUM, AVERAGE, MEDIAN, MODE, MIN, MAX, COUNT (counts numeric cells), COUNTA (non-empty cells), COUNTIF (cells meeting a condition), IF, VLOOKUP or its successors, CORREL, and the standard deviation functions. In most current spreadsheet programs STDEV.S (or STDEV) uses the sample divisor n − 1 and STDEV.P the population divisor n; VAR.S and VAR.P behave the same way.
Most errors in published analyses begin in the data sheet. Organise data in tidy form: one row per observation (animal, or animal-visit), one column per variable, a single header row with short names, and no merged cells, colour-coding or subtotals within the data. Give every animal a unique identifier that never changes; in a relational database this unique field is the primary key, and records in other tables (treatments, test results) link to it through a foreign key. Record dates in one unambiguous format, units in the column name, and missing values with one consistent code rather than a blank in one place and a zero in another, since a zero is a real value. Keep a data dictionary that defines every variable, its units and codes. Use data validation rules (allowed ranges, drop-down lists) to block impossible entries, and double data entry by two people with comparison of the files to catch transcription errors. Keep the raw data file unchanged and do all cleaning in documented steps or scripts so that the analysis can be repeated. Back up to more than one place, protect personal data of clients according to the law of the country, and archive the data with the thesis or paper; many journals and funders now require data sharing.
Research is a systematic search for new knowledge. Basic (fundamental) research seeks understanding; applied research solves a practical problem; action research is carried out with the people who will use the result, as in on-farm extension trials. Research may be descriptive (what is the prevalence of brucellosis in this district?), analytical (is brucellosis associated with communal grazing?) or experimental (does vaccination reduce abortions?). The process runs: identify a problem; review the literature; state a precise research question, often framed as PICO (population, intervention or exposure, comparison, outcome); formulate a testable hypothesis; choose the design, the variables and the sample size; obtain ethics approval; collect data with standardised, calibrated methods; analyse; interpret; and report. A good hypothesis is specific, testable, and stated before data are collected. The literature review uses bibliographic databases and full-text sources and should be systematic enough that another person could repeat it. A research proposal (synopsis) sets out the background, objectives, materials and methods, analysis plan, timeline and budget; a thesis or paper typically follows the IMRaD structure: introduction, materials and methods, results and discussion.
Observational studies observe without assigning exposure. A cross-sectional study measures exposure and disease at one time and estimates prevalence, but cannot show which came first. A case-control study starts from diseased animals (cases) and non-diseased controls and looks back at exposures; it is efficient for rare diseases and its measure of association is the odds ratio, OR = ad / bc for a 2 × 2 table with exposed cases a, exposed controls b, unexposed cases c and unexposed controls d. A cohort study follows exposed and unexposed animals forward and measures incidence; its measure is the relative risk, RR = incidence in exposed / incidence in unexposed, and the attributable risk is their difference. Experimental studies assign the exposure: the randomised controlled trial (clinical trial) is the strongest design for testing an intervention, ideally with random allocation, concealment of allocation, a control group given placebo or standard treatment, and blinding of owners, clinicians and assessors. In hierarchies of evidence, systematic reviews and meta-analyses of well-conducted randomised trials rank highest, followed by individual trials, cohort and case-control studies, case series and case reports, with expert opinion lowest. Validity has two parts: internal validity asks whether the result is true for the animals studied; external validity (generalisability) asks whether it applies to other populations.
Bias is systematic error. Selection bias arises when the animals studied differ systematically from the target population, for example a referral-hospital population. Information (measurement) bias arises from faulty measurement or recall; misclassification of exposure or disease is one form. Confounding occurs when a third factor is associated with the exposure and independently with the outcome, and is not on the causal pathway: age can confound an apparent association between a vaccine and mortality if older animals are both less often vaccinated and more often die. Confounding is controlled by randomisation, restriction, matching, stratified analysis or multivariable models. Research on animals must be approved by an institutional animal ethics committee under national law (in India the committee operates under CCSEA rules; elsewhere it may be called an IACUC or an animal welfare body). The 3Rs of Russell and Burch (1959), Replacement, Reduction and Refinement, guide every proposal. Research integrity forbids fabrication, falsification and plagiarism; every source used must be cited in a consistent referencing style. Reporting guidelines help readers judge a study: ARRIVE for animal research, CONSORT for randomised trials, REFLECT for livestock trials, and STROBE-Vet for observational veterinary studies.
A BVSc student uses this subject to pass the course examination and, more importantly, to read the papers set in later clinical subjects. Practise calculating a mean, SD and SE by hand for small data sets, decide which test fits which data (paired or unpaired, counts or measurements, two groups or more), and learn the degrees of freedom of the common designs, because postgraduate entrance papers ask them repeatedly. Use a spreadsheet to analyse the data from your own practical classes, learn the difference between the sample and population SD functions, and keep your records in tidy form. When you read a paper, find the experimental unit and the sample size before you look at the P value.
A practitioner five years out uses biostatistics every week without naming it. Interpreting a positive screening test in a low-prevalence herd needs predictive values, not sensitivity alone. Judging a sales claim for a new drug or additive means asking how many animals were used, whether there was a randomised control group, whether outcomes were assessed blind and whether the reported difference has a confidence interval that matters clinically. Herd health work uses means, medians and percentiles of milk records, somatic cell counts and calving intervals, and simple on-farm trials need a control group, randomisation and enough animals. A practitioner who designs a small field study before collecting data, rather than after, saves wasted effort.
A senior veterinarian with twenty-five years in practice, government service or industry designs and approves surveys and trials rather than analysing single herds. Disease surveillance and freedom-from-disease surveys need defensible sample sizes for detection and prevalence estimation, multistage and cluster designs with a design effect, and honest reporting of non-sampling errors. Programme managers must judge whether an apparent drop in incidence is real or a change in reporting. Field trials of vaccines and feeding strategies need block designs that fit village conditions, a pre-specified analysis plan, and an ethics approval. The senior also reviews staff reports and must spot pseudoreplication, unjustified extrapolation, and confusion of correlation with causation.
A researcher with a PhD and twenty-five years' experience works at the level of design and inference. The work includes choosing between fixed and random effects, fitting mixed models to unbalanced field and breeding data, using logistic, Poisson and survival models in epidemiology, and handling clustering, repeated measures and missing data properly. Such a researcher writes the statistical analysis plan and sample-size justification for grant and ethics proposals, supervises theses, reviews manuscripts against ARRIVE, CONSORT, REFLECT and STROBE-Vet, and leads systematic reviews and meta-analyses. They also teach that P values are not effect sizes, that power is decided before the study, and that data and code should be archived so that results can be reproduced.
This manual covers the BVSc/MVSc-entrance core. It gives only outlines of mixed models, generalised linear models, survival analysis, multivariate methods, Bayesian statistics and meta-analysis, and it does not teach any particular statistical software. Statistical tables are not reproduced; critical values are quoted only where a worked example needs them. National rules for animal ethics committees and data protection differ by country and are named, not detailed. The sample-size formulas given are the simple textbook forms; dedicated software and a statistician should be used for complex designs.
Original practice questions written to the syllabus and pattern of the exams named in each question's examTags. They are not past papers and do not reproduce any board's questions.
These notes are free to read here, with no account.
What the Laisha app adds:
Free for ten days, then a subscription. We would rather write that here than have you find it later.