1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-27 11:26:11 +01:00
AMR/man/ratio.Rd

61 lines
1.9 KiB
Plaintext
Raw Normal View History

2018-07-01 21:40:37 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/g.test.R
2018-07-02 11:14:20 +02:00
\name{ratio}
\alias{ratio}
2018-07-01 21:40:37 +02:00
\title{Transform vector to ratio}
\usage{
2018-07-02 11:14:20 +02:00
ratio(x, ratio)
2018-07-01 21:40:37 +02:00
}
\arguments{
\item{x}{vector of values}
\item{ratio}{vector with ratios of \code{x} and with same length (like \code{ratio = c(1, 2, 1)}) or a text with characters \code{":"}, \code{"-"} or \code{","} (like \code{ratio = "1:2:1"} or even \code{ratio = "1:2:1.25"})}
}
\description{
Transform vector to ratio
}
\examples{
# = EXAMPLE 1 =
# Shivrain et al. (2006) crossed clearfield rice (which are resistant
# to the herbicide imazethapyr) with red rice (which are susceptible to
# imazethapyr). They then crossed the hybrid offspring and examined the
# F2 generation, where they found 772 resistant plants, 1611 moderately
# resistant plants, and 737 susceptible plants. If resistance is controlled
# by a single gene with two co-dominant alleles, you would expect a 1:2:1
# ratio.
x <- c(772, 1611, 737)
2018-07-10 12:27:07 +02:00
E <- ratio(x, "1:2:1")
E
2018-07-01 21:40:37 +02:00
# 780 1560 780
2018-07-10 12:27:07 +02:00
G <- g.test(x, p = c(1, 2, 1) / 4)
# G$p.value = 0.12574.
2018-07-01 21:40:37 +02:00
# There is no significant difference from a 1:2:1 ratio.
# Meaning: resistance controlled by a single gene with two co-dominant
# alleles, is plausible.
# = EXAMPLE 2 =
# Red crossbills (Loxia curvirostra) have the tip of the upper bill either
# right or left of the lower bill, which helps them extract seeds from pine
# cones. Some have hypothesized that frequency-dependent selection would
# keep the number of right and left-billed birds at a 1:1 ratio. Groth (1992)
# observed 1752 right-billed and 1895 left-billed crossbills.
x <- c(1752, 1895)
2018-07-10 12:27:07 +02:00
g.test(x)
2018-07-01 21:40:37 +02:00
# p = 0.01787343
# There is a significant difference from a 1:1 ratio.
# Meaning: there are significantly more left-billed birds.
}
\references{
McDonald, J.H. 2014. \strong{Handbook of Biological Statistics (3rd ed.)}. Sparky House Publishing, Baltimore, Maryland.
}
\seealso{
\code{\link{g.test}}
}