Package XNomial. December 24, 2015

Similar documents
Package EMT. February 19, 2015

Package gmediation. R topics documented: June 27, Type Package

Package cnbdistr. R topics documented: July 17, 2017

Package cbinom. June 10, 2018

Package bunchr. January 30, 2017

Package ratesci. April 21, 2017

Package eesim. June 3, 2017

Package ph2mult. November 23, 2016

Package scenario. February 17, 2016

Package LNIRT. R topics documented: November 14, 2018

Package SMFI5. February 19, 2015

Basic Principles of Probability and Statistics. Lecture notes for PET 472 Spring 2010 Prepared by: Thomas W. Engler, Ph.D., P.E

Exam 2 Spring 2015 Statistics for Applications 4/9/2015

Package tailloss. August 29, 2016

Package ald. February 1, 2018

Probability Distributions: Discrete

Package uqr. April 18, 2017

Basic Principles of Probability and Statistics. Lecture notes for PET 472 Spring 2012 Prepared by: Thomas W. Engler, Ph.D., P.E

Package conf. November 2, 2018

Unit 5: Sampling Distributions of Statistics

Unit 5: Sampling Distributions of Statistics

Package smam. October 1, 2016

Package ELMSO. September 3, 2018

Package optimstrat. September 10, 2018

Chapter 3 Statistical Quality Control, 7th Edition by Douglas C. Montgomery. Copyright (c) 2013 John Wiley & Sons, Inc.

Statistics 431 Spring 2007 P. Shaman. Preliminaries

Package Strategy. R topics documented: August 24, Type Package

Package cumstats. R topics documented: January 16, 2017

Package ProjectManagement

Subject CS1 Actuarial Statistics 1 Core Principles. Syllabus. for the 2019 exams. 1 June 2018

Package finiteruinprob

Package stable. February 6, 2017

Package dng. November 22, 2017

Package BatchGetSymbols

Package quantileda. R topics documented: February 2, 2016

Package fmdates. January 5, 2018

Package BatchGetSymbols

Package MSMwRA. August 7, 2018

Package GCPM. December 30, 2016

2011 Pearson Education, Inc

Package GenOrd. September 12, 2015

Package SimCorMultRes

Package MultiSkew. June 24, 2017

The normal distribution is a theoretical model derived mathematically and not empirically.

Discrete Choice Modeling

A Test of the Normality Assumption in the Ordered Probit Model *

Maximum Likelihood Estimation

Contents. An Overview of Statistical Applications CHAPTER 1. Contents (ix) Preface... (vii)

ENGM 720 Statistical Process Control 4/27/2016. REVIEW SHEET FOR FINAL Topics

Econ 3790: Business and Economics Statistics. Instructor: Yogesh Uppal

Package QRank. January 12, 2017

Package beanz. June 13, 2018

Lecture Data Science

It is common in the field of mathematics, for example, geometry, to have theorems or postulates

Chapter 5 Normal Probability Distributions

Lecture 2. Probability Distributions Theophanis Tsandilas

Package xva. November 26, 2016

Package FADA. May 20, 2016

MVE051/MSG Lecture 7

Chapter 4 Probability and Probability Distributions. Sections

One sample z-test and t-test

CH 5 Normal Probability Distributions Properties of the Normal Distribution

Quantitative Introduction ro Risk and Uncertainty in Business Module 5: Hypothesis Testing Examples

mfx: Marginal Effects, Odds Ratios and Incidence Rate Ratios for GLMs

Gamma(alpha) Normal(mu,sig2) Uniform(a,b) 2.5

Package multiassetoptions

Mendelian Randomization with a Binary Outcome

The Binomial Distribution

Review: Population, sample, and sampling distributions

Week 1 Variables: Exploration, Familiarisation and Description. Descriptive Statistics.

The Binomial Distribution

Homework Problems Stat 479

Package easi. February 15, 2013

Package jrvfinance. R topics documented: August 29, 2016

Package tvm. R topics documented: August 29, Type Package Title Time Value of Money Functions Version Author Juan Manuel Truppia

Contents Part I Descriptive Statistics 1 Introduction and Framework Population, Sample, and Observations Variables Quali

Statistics TI-83 Usage Handout

Package bbdetection. September 8, 2017

XLSTAT TIP SHEET FOR BUSINESS STATISTICS CENGAGE LEARNING

Financial Econometrics (FinMetrics04) Time-series Statistics Concepts Exploratory Data Analysis Testing for Normality Empirical VaR

ก ก ก ก ก ก ก. ก (Food Safety Risk Assessment Workshop) 1 : Fundamental ( ก ( NAC 2010)) 2 3 : Excel and Statistics Simulation Software\

Distributions in Excel

The topics in this section are related and necessary topics for both course objectives.

Omitted Variables Bias in Regime-Switching Models with Slope-Constrained Estimators: Evidence from Monte Carlo Simulations

Web Science & Technologies University of Koblenz Landau, Germany. Lecture Data Science. Statistics and Probabilities JProf. Dr.

Data that can be any numerical value are called continuous. These are usually things that are measured, such as height, length, time, speed, etc.

KARACHI UNIVERSITY BUSINESS SCHOOL UNIVERSITY OF KARACHI BS (BBA) VI

Lecture 21: Logit Models for Multinomial Responses Continued

Monte Carlo Simulation (Random Number Generation)

Probability Distributions

The actuar Package. March 24, bstraub... 1 hachemeister... 3 panjer... 4 rearrangepf... 5 simpf Index 8. Buhlmann-Straub Credibility Model

Chapter 8 Estimation

Math 160 Professor Busken Chapter 5 Worksheets

STA 4504/5503 Sample questions for exam True-False questions.

The FREQ Procedure (Book Excerpt)

Package valuer. February 7, 2018

Mark-recapture models for closed populations

Case Study: Applying Generalized Linear Models

STA 103: Final Exam. Print clearly on this exam. Only correct solutions that can be read will be given credit.

Appendix A. Selecting and Using Probability Distributions. In this appendix

Transcription:

Type Package Package XNomial December 24, 2015 Title Exact Goodness-of-Fit Test for Multinomial Data with Fixed Probabilities Version 1.0.4 Date 2015-12-22 Author Bill Engels <wrengels@wisc.edu> Maintainer Bill Engels <wrengels@wisc.edu> Description Tests whether a set of counts fit a given expected ratio. For example, a genetic cross might be expected to produce four types in the relative frequencies of 9:3:3:1. To see whether a set of observed counts fits this expectation, one can examine all possible outcomes with xmulti() or a random sample of them with xmonte() and find the probability of an observation deviating from the expectation by at least as much as the observed. As a measure of deviation from the expected, one can use the log-likelihood ratio, the multinomial probability, or the classic chi-square statistic. A histogram of the test statistic can also be plotted and compared with the asymptotic curve. VignetteBuilder knitr Depends R (>= 2.14) Suggests knitr NeedsCompilation yes License GPL RoxygenNote 5.0.0 Repository CRAN Date/Publication 2015-12-24 08:19:02 R topics documented: xmonte........................................... 2 xmulti............................................ 3 Index 6 1

2 xmonte xmonte Perform Multinomial Goodness-Of-Fit Test By Monte-Carlo Simulations Description Usage Use xmonte to compute a P value to test whether a set of counts fits a specific multinomial distribution. It does this by examining a large number of random outcomes and finding the probability of those cases which deviate from the expectation by at least as much as the observed. xmonte(obs, expr, ntrials = 1e+05, statname = "LLR", histobins = F, histobounds = c(0, 0), showcurve = T, detail = 1, safety = 1e+08) Arguments obs expr ntrials statname histobins histobounds showcurve detail safety vector containing the observed numbers. All are non-negative integers summing to > 0. vector containing expectation. The length should be the same as that of obs and they should be non-negative summing to > 0. They need not be integers or sum to one. the number of random trials to look at, such as ntrials=100000 name of the test statistic to use as a measure of how deviant an observation is from the expectation. The choices are: LLR for the log-likelihood ratio, Prob for the probability, Chisq for the chisquare statistic. specifies histogram plot. If set to 0, F or FALSE no histogram is plotted. If set to 1 or T or TRUE a histogram with 500 bins will be plotted. If set to a number > 1 a histogram with that number of bins is plotted. vector of length 2 indicating the bounds for the histogram, if any. If unspecified, bounds will be determined to include about 99.9 percent of the distribution. should an asymptotic curve be drawn over the histogram? how much detail should be reported concerning the P value. If 0, nothing is printed for cases where the function is used programmatically. Minimal information is printed if detail is set to 1, and additional information if it is set to 2. a large number, such as one billion, to set a limit on how many samples will be examined. This limit is there to avoid long computations. Value xmonte returns a list with the following components: $ obs the observed numbers used as imput $ expr expected ratios, arbitrary scale

xmulti 3 $ ntrials the number of random tables examined $ stattype which test statistic was used $ pllr/pprob/pchi the P value computed for the given test statistic $ standard.error the binomial standard error of the estimated P value $ observedllr the value of LLR statistic for these data $ observedprob the multinomial probability of the observed data under the null hypothesis $ observedchi observed value of the chi square statistic $ histobins number of bins in the histogram (suppressed if zero) $ histobounds range in histogram (suppressed if not used) $ histodata data for histogram (suppressed if not used) Length is histobins $ asymptotoc.p.value the P value obtained from the classical asymptotic test use for comparison only Examples One of Gregor Mendel s crosses produced four types of pea seeds in the numbers as follows: peas <- c(315, 108, 101, 32) and he expected them to appear in the ratio of 9:3:3:1 according to his genetic model. expected <- c(9, 3, 3, 1) Test Mendels theory using xmonte(peas, expected) To see a histogram of the likelihood ratio statistic, use: xmonte(peas, expected, histobins = TRUE) The red areas of the histogram represent those outcomes deviating from the expected 9:3:3:1 ratio at least as much as the observed numbers. (Much has been made of the tendency for Mendel s data to fit the expectations better than expected!) If you wish to use the standard chisquare statistic as a measure of goodness-of-fit instead of the LLR, use: xmonte(peas, expected, statname="chisq", histobins=true) xmulti Perform Multinomial Goodness-Of-Fit Test By Full Enumeration Description Usage Use xmulti to compute a P value to test whether a set of counts fits a specific multinomial distribution. It does this by examining all possible outcomes with the same total count and determining the total (multinomial) probability of those cases which deviate from the expectation by at least as much as the observed. Please see the vignette for more. xmulti(obs, expr, statname = "LLR", histobins = F, histobounds = c(0, 0), showcurve = T, detail = 1, safety = 1e+09)

4 xmulti Arguments obs expr statname histobins histobounds showcurve detail safety vector containing the observed numbers. All are non-negative integers summing to > 0. vector containing expectation. The length should be the same as that of obs and they should be non-negative summing to > 0. They need not be integers or sum to one. name of the test statistic to use as a measure of how deviant an observation is from the expectation. The choices are: LLR for the log-likelihood ratio, Prob for the probability, Chisq for the chisquare statistic. specifies histogram plot. If set to 0, F or FALSE no histogram is plotted. If set to 1 or T or TRUE a histogram with 500 bins will be plotted. If set to a number > 1 a histogram with that number of bins is plotted. vector of length 2 indicating the bounds for the histogram, if any. If unspecified, bounds will be determined to include about 99.9 percent of the distribution. should an asymptotic curve be drawn over the histogram? how much detail should be reported concerning the P value. If 0, nothing is printed for cases where the function is used programmatically. Minimal information is printed if detail is set to 1, and additional information if it is set to 2. a large number, such as one billion, to set a limit on how many samples will be examined. This limit is there to avoid long computations. Value xmulti returns a list with the following components: $ obs the observed numbers used as imput $ expr expected ratios $ stattype which test statistic was used $ pllr the P value with LLR as the test statistic $ pprob the P value with the multinomial probability as test statistic $ pchi the P value with the chisquare as test statistic $ observedllr the value of LLR statistic for these data $ observedprob the multinomial probability of the observed data under the null hypothesis $ observedchi observed value of the chi square statistic $ histobins number of bins in the histogram (suppressed if zero) $ histobounds range in histogram (suppressed if not used) $ histodata data for histogram (suppressed if not used) Length is histobins $ asymptotoc.p.value the P value obtained from the classical asymptotic test $ cases.examined the total number of possible tables

xmulti 5 Examples One of Gregor Mendel s crosses produced four types of pea seeds in the numbers: peas <- c(315, 108, 101, 32) and he expected them to appear in the ratio of 9:3:3:1 according to his genetic model. expected <- c(9, 3, 3, 1) Test Mendel s theory using xmulti(peas, expected) In this example, the number of cases examined was 28956759, and it probably took your computer less than half a second. To see a histogram of the likelihood ratio statistic, use: xmulti(peas, expected, histobins = TRUE) The red areas of the histogram represent those outcomes deviating from the expected 9:3:3:1 ratio at least as much as the observed numbers. (Much has been made of the tendency for Mendel s data to fit the expectations better than expected!) If you wish to use the standard chisquare statistic as a measure of goodness-of-fit instead of the LLR, use: xmulti(peas, expected, statname="chisq", histobins=true)

Index xmonte, 2 xmulti, 3 6