[IPSUR-commits] r105 - in pkg/IPSUR: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Dec 27 05:27:36 CET 2009
Author: gkerns
Date: 2009-12-27 05:27:34 +0100 (Sun, 27 Dec 2009)
New Revision: 105
Removed:
pkg/IPSUR/R/sigmatest.R
pkg/IPSUR/man/sigma.test.Rd
Log:
deleted sigma.test; it is in TeachingDemos 2.5
Deleted: pkg/IPSUR/R/sigmatest.R
===================================================================
--- pkg/IPSUR/R/sigmatest.R 2009-12-27 03:50:59 UTC (rev 104)
+++ pkg/IPSUR/R/sigmatest.R 2009-12-27 04:27:34 UTC (rev 105)
@@ -1,32 +0,0 @@
-
-sigma.test <-
-function (x, sigma = 1, sigmasq = sigma^2,
- alternative = c("two.sided", "less", "greater"),
- conf.level = 0.95, ...) {
- alternative <- match.arg(alternative)
- sigma <- sqrt(sigmasq)
- n <- length(x)
- xs <- var(x)*(n-1)/sigma^2
- out <- list(statistic = c("X-squared" = xs))
- class(out) <- "htest"
- out$parameter <- c(df = n-1)
- minxs <- min(c(xs, 1/xs))
- maxxs <- max(c(xs, 1/xs))
- out$p.value <- switch(alternative,
- two.sided = pchisq(maxxs, df = n-1, lower.tail = FALSE) + pchisq(minxs, df = n-1),
- less = pchisq(xs, df = n-1),
- greater = 1 - pchisq(xs, df = n - 1))
- out$conf.int <- switch(alternative,
- two.sided = xs * sigma^2 * 1/c(qchisq(1-(1-conf.level)/2, df = n-1), qchisq((1-conf.level)/2, df = n-1)),
- less = c(0, xs * sigma^2 / qchisq(1-conf.level, df = n-1)),
- greater = c(xs * sigma^2 / qchisq(conf.level, df = n-1), Inf))
- attr(out$conf.int, "conf.level") <- conf.level
- out$estimate <- c("var of x" = var(x))
- out$null.value <- c(variance = sigma^2)
- out$alternative <- alternative
- out$method <- "One sample Chi-squared test for variance"
- out$data.name <- deparse(substitute(x))
- names(out$estimate) <- paste("var of", out$data.name)
- return(out)
-}
-
Deleted: pkg/IPSUR/man/sigma.test.Rd
===================================================================
--- pkg/IPSUR/man/sigma.test.Rd 2009-12-27 03:50:59 UTC (rev 104)
+++ pkg/IPSUR/man/sigma.test.Rd 2009-12-27 04:27:34 UTC (rev 105)
@@ -1,40 +0,0 @@
-\name{sigma.test}
-\alias{sigma.test}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ One sample Chi-square test for a population variance }
-\description{
- Compute the test of hypothesis and compute a confidence interval on the
- variance of a population.
-}
-\usage{
-sigma.test(x, sigma = 1, sigmasq = sigma^2, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, ...)
-}
-%- maybe also 'usage' for other objects documented here.
-\arguments{
- \item{x}{ Vector of data values. }
- \item{sigma}{ Hypothesized standard deviation of the population. }
- \item{sigmasq}{ Hypothesized variance of the population. }
- \item{alternative}{ Direction of the alternative hypothesis. }
- \item{conf.level}{ Confidence level for the interval computation. }
- \item{\dots}{ Additional arguments are silently ignored. }
-}
-\details{
- Many introductory statistical texts discuss inference on a single population variance and introduce the chi-square test for a population variance as another example of a hypothesis test that can be easily derived. Most statistical packages do not include the chi-square test, perhaps because it is not used in practice very often, or because the test is known to be highly sensitive to nonnormal data. For the two-sample problem, see \code{var.test}.
-}
-\value{
- An object of class \code{htest} containing the results
-}
-
-\author{ G. Jay Kerns \email{gkerns at ysu.edu} }
-\note{ This test is highly sensitive to nonnormality. }
-
-% ~Make other sections like Warning with \section{Warning }{....} ~
-
-\seealso{ \code{\link{var.test}}, \code{\link{print.htest}} }
-\examples{
-x <- rnorm(20, mean = 15, sd = 7)
-sigma.test(x, sigma = 6)
-
-}
-\keyword{ htest }% at least one, from doc/KEYWORDS
-
More information about the IPSUR-commits
mailing list