Description Usage Arguments Value Author(s) References See Also Examples

Beale's ratio estimator \insertCiteBeale_1962funtimes
for estimating population total and
confidence intervals, with an option of calculating sample size for a required
relative error (`p`

) or margin of error (`d`

).

1 |

`x` |
a numeric vector with quantities of interest, such as river discharge
per month. Missing values ( |

`y` |
a numeric vector with quantities of interest for which the total shall
be estimated, such as total nutrient loads per month.
Missing values ( |

`level` |
confidence level, from 0 to 1.
Default is |

`N` |
population size for which the estimate of the total |

`p` |
optional argument specifying the required relative error, from 0 to 1,
for computing corresponding sample size. For example, |

`d` |
optional argument specifying the required margin of error
for computing corresponding sample size. If both |

`verbose` |
logical value defining whether the output should be printed out
in words. Default is set to |

A list with the following components:

`estimate` |
Beale's estimate of the population total for the variable |

`se` |
standard error of the estimate. |

`CI` |
a vector of length 2 with a confidence interval (lower and upper value) for the estimate. |

`level` |
confidence level for the interval. |

`N` |
population size. |

`n` |
the actual sample size. |

`p` |
the relative error used for sample size calculations.
Reported only if |

`d` |
the margin of error used for sample size calculations.
Reported only if |

`nhat` |
estimated sample size for the given |

Vyacheslav Lyubchich

`vignette("beales", package = "funtimes")`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
#Some hypothetical data for monthly river discharge
#and corresponding nutrient loads:
discharge <- c(NA, 50, 90, 100, 80, 90, 100, 90, 80, 70, NA, NA)
loads <- c(33, 22, 44, 48, NA, 44, 49, NA, NA, 36, NA, NA)
#Example 1:
#Estimate total annual load (12 months),
#with 90% confidence intervals
beales(discharge, loads, level = 0.9)
#Example 2:
#Calculate sample size required for 90% confidence intervals
#with a margin of error 30 units
beales(discharge, loads, level = 0.9, d = 30)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.