Poisson Regression)

Total Page:16

File Type:pdf, Size:1020Kb

Poisson Regression) Stratford & Wilkes University DRAFT 1 Table of Contents 1 Probability ............................................................................................................................................1 1.1 Simple probabilities.......................................................................................................................1 1.2 Conditional Probability.................................................................................................................3 1.3 Bayes' theorem...............................................................................................................................3 2 Basic approaches to science and statistics ...........................................................................................5 2.1 Introduction ..................................................................................................................................5 2.2 Schools of statistical inference ......................................................................................................6 2.3 Neyman-Person and Bayesian statistics compared........................................................................9 2.4 Parameter estimation......................................................................................................................9 3 Fundamentals......................................................................................................................................10 3.1 Computing....................................................................................................................................10 3.2 Populations and samples.............................................................................................................10 3.3 Precision, Accuracy, Bias .........................................................................................................10 3.4 Significant units and rounding errors...........................................................................................11 4 Data Collection...................................................................................................................................12 4.1 Introduction.................................................................................................................................12 4.2 Types of Measurements...............................................................................................................12 4.3 Coding data..................................................................................................................................13 4.4 The data sheet .............................................................................................................................13 4.5 Sampling......................................................................................................................................14 4.6 Data management.........................................................................................................................15 5 Common Distributions.........................................................................................................................16 5.1 Histograms....................................................................................................................................16 5.2 Uniform........................................................................................................................................16 5.3 Binomial.......................................................................................................................................16 5.4 Poisson..........................................................................................................................................16 5.5 Gaussian or Normal distribution .................................................................................................17 5.6 Exponential ..................................................................................................................................18 5.7 Cauchy..........................................................................................................................................18 5.8 Gamma.........................................................................................................................................18 5.9 Beta ..............................................................................................................................................18 6 Descriptive Statistics and Exploratory Data Analysis.........................................................................19 6.1 Introduction.................................................................................................................................19 6.2 Law of large numbers...................................................................................................................19 6.3 Descriptive Statistics...................................................................................................................19 6.4 Relationships between variables ................................................................................................22 6.5 Missing values..............................................................................................................................23 6.6 Looking for curvilinear relationships ..........................................................................................23 7 Transformations..................................................................................................................................24 7.1 Introduction..................................................................................................................................24 7.2 Arcsine transformation.................................................................................................................24 7.3 Square-root arcsine transformation:.............................................................................................24 7.4 Exponential transformation..........................................................................................................24 Stratford & Wilkes University DRAFT 2 7.5 Square-root transformation...........................................................................................................24 7.6 Logarithmic transformation..........................................................................................................25 7.7 Rank transformations...................................................................................................................25 7.8 Box-Cox or power transformations..............................................................................................25 7.9 Data standardization.....................................................................................................................25 8 Introduction to Modeling.....................................................................................................................26 8.1 Introduction.................................................................................................................................26 8.2 Model Complexity and Error.......................................................................................................27 8.3 Types of models............................................................................................................................27 8.4 Fitting data to models...................................................................................................................29 8.5 Issues in Modeling .......................................................................................................................30 9 Variable and Model Selection.............................................................................................................31 9.1 Introduction..................................................................................................................................31 9.2 Stepwise........................................................................................................................................31 9.3 Likelihood ratio test......................................................................................................................31 9.4 Information Theoretic Methods....................................................................................................31 10 Generalized Linear Models (GLM)..................................................................................................34 10.1 Introduction................................................................................................................................34 11 Summary ...........................................................................................................................................35 12 Responses and Predictors are Continuous (Regression) ..................................................................36 1.2 Introduction.................................................................................................................................36 12.1 Simple linear regression.............................................................................................................36 12.2 Hypothesis testing and regression..............................................................................................38 12.3 Diagnostics.................................................................................................................................40
Recommended publications
  • Effect of Probability Distribution of the Response Variable in Optimal Experimental Design with Applications in Medicine †
    mathematics Article Effect of Probability Distribution of the Response Variable in Optimal Experimental Design with Applications in Medicine † Sergio Pozuelo-Campos *,‡ , Víctor Casero-Alonso ‡ and Mariano Amo-Salas ‡ Department of Mathematics, University of Castilla-La Mancha, 13071 Ciudad Real, Spain; [email protected] (V.C.-A.); [email protected] (M.A.-S.) * Correspondence: [email protected] † This paper is an extended version of a published conference paper as a part of the proceedings of the 35th International Workshop on Statistical Modeling (IWSM), Bilbao, Spain, 19–24 July 2020. ‡ These authors contributed equally to this work. Abstract: In optimal experimental design theory it is usually assumed that the response variable follows a normal distribution with constant variance. However, some works assume other probability distributions based on additional information or practitioner’s prior experience. The main goal of this paper is to study the effect, in terms of efficiency, when misspecification in the probability distribution of the response variable occurs. The elemental information matrix, which includes information on the probability distribution of the response variable, provides a generalized Fisher information matrix. This study is performed from a practical perspective, comparing a normal distribution with the Poisson or gamma distribution. First, analytical results are obtained, including results for the linear quadratic model, and these are applied to some real illustrative examples. The nonlinear 4-parameter Hill model is next considered to study the influence of misspecification in a Citation: Pozuelo-Campos, S.; dose-response model. This analysis shows the behavior of the efficiency of the designs obtained in Casero-Alonso, V.; Amo-Salas, M.
    [Show full text]
  • Lecture.7 Poisson Distributions - Properties, Normal Distributions- Properties
    Lecture.7 Poisson Distributions - properties, Normal Distributions- properties Theoretical Distributions Theoretical distributions are 1. Binomial distribution Discrete distribution 2. Poisson distribution 3. Normal distribution Continuous distribution Discrete Probability distribution Bernoulli distribution A random variable x takes two values 0 and 1, with probabilities q and p ie., p(x=1) = p and p(x=0)=q, q-1-p is called a Bernoulli variate and is said to be Bernoulli distribution where p and q are probability of success and failure. It was given by Swiss mathematician James Bernoulli (1654-1705) Example • Tossing a coin(head or tail) • Germination of seed(germinate or not) Binomial distribution Binomial distribution was discovered by James Bernoulli (1654-1705). Let a random experiment be performed repeatedly and the occurrence of an event in a trial be called as success and its non-occurrence is failure. Consider a set of n independent trails (n being finite), in which the probability p of success in any trail is constant for each trial. Then q=1-p is the probability of failure in any trail. 1 The probability of x success and consequently n-x failures in n independent trails. But x successes in n trails can occur in ncx ways. Probability for each of these ways is pxqn-x. P(sss…ff…fsf…f)=p(s)p(s)….p(f)p(f)…. = p,p…q,q… = (p,p…p)(q,q…q) (x times) (n-x times) Hence the probability of x success in n trials is given by x n-x ncx p q Definition A random variable x is said to follow binomial distribution if it assumes non- negative values and its probability mass function is given by P(X=x) =p(x) = x n-x ncx p q , x=0,1,2…n q=1-p 0, otherwise The two independent constants n and p in the distribution are known as the parameters of the distribution.
    [Show full text]
  • 1 One Parameter Exponential Families
    1 One parameter exponential families The world of exponential families bridges the gap between the Gaussian family and general dis- tributions. Many properties of Gaussians carry through to exponential families in a fairly precise sense. • In the Gaussian world, there exact small sample distributional results (i.e. t, F , χ2). • In the exponential family world, there are approximate distributional results (i.e. deviance tests). • In the general setting, we can only appeal to asymptotics. A one-parameter exponential family, F is a one-parameter family of distributions of the form Pη(dx) = exp (η · t(x) − Λ(η)) P0(dx) for some probability measure P0. The parameter η is called the natural or canonical parameter and the function Λ is called the cumulant generating function, and is simply the normalization needed to make dPη fη(x) = (x) = exp (η · t(x) − Λ(η)) dP0 a proper probability density. The random variable t(X) is the sufficient statistic of the exponential family. Note that P0 does not have to be a distribution on R, but these are of course the simplest examples. 1.0.1 A first example: Gaussian with linear sufficient statistic Consider the standard normal distribution Z e−z2=2 P0(A) = p dz A 2π and let t(x) = x. Then, the exponential family is eη·x−x2=2 Pη(dx) / p 2π and we see that Λ(η) = η2=2: eta= np.linspace(-2,2,101) CGF= eta**2/2. plt.plot(eta, CGF) A= plt.gca() A.set_xlabel(r'$\eta$', size=20) A.set_ylabel(r'$\Lambda(\eta)$', size=20) f= plt.gcf() 1 Thus, the exponential family in this setting is the collection F = fN(η; 1) : η 2 Rg : d 1.0.2 Normal with quadratic sufficient statistic on R d As a second example, take P0 = N(0;Id×d), i.e.
    [Show full text]
  • ONE SAMPLE TESTS the Following Data Represent the Change
    1 WORKED EXAMPLES 6 INTRODUCTION TO STATISTICAL METHODS EXAMPLE 1: ONE SAMPLE TESTS The following data represent the change (in ml) in the amount of Carbon monoxide transfer (an indicator of improved lung function) in smokers with chickenpox over a one week period: 33, 2, 24, 17, 4, 1, -6 Is there evidence of significant improvement in lung function (a) if the data are normally distributed with σ = 10, (b) if the data are normally distributed with σ unknown? Use a significance level of α = 0.05. SOLUTION: (a) Here we have a sample of size 7 with sample mean x = 10.71. We want to test H0 : μ = 0.0, H1 : μ = 0.0, 6 under the assumption that the data follow a Normal distribution with σ = 10.0 known. Then, we have, in the Z-test, 10.71 0.0 z = − = 2.83, 10.0/√7 which lies in the critical region, as the critical values for this test are 1.96, for significance ± level α = 0.05. Therefore we have evidence to reject H0. The p-value is given by p = 2Φ( 2.83) = 0.004 < α. − (b) The sample variance is s2 = 14.192. In the T-test, we have test statistic t given by x 0.0 10.71 0.0 t = − = − = 2.00. s/√n 14.19/√7 The upper critical value CR is obtained by solving FSt(n 1)(CR) = 0.975, − where FSt(n 1) is the cdf of a Student-t distribution with n 1 degrees of freedom; here n = 7, so − − we can use statistical tables or a computer to find that CR = 2.447, and note that, as Student-t distributions are symmetric the lower critical value is CR.
    [Show full text]
  • Chapter 6: Random Errors in Chemical Analysis
    Chapter 6: Random Errors in Chemical Analysis Source slideplayer.com/Fundamentals of Analytical Chemistry, F.J. Holler, S.R.Crouch Random errors are present in every measurement no matter how careful the experimenter. Random, or indeterminate, errors can never be totally eliminated and are often the major source of uncertainty in a determination. Random errors are caused by the many uncontrollable variables that accompany every measurement. The accumulated effect of the individual uncertainties causes replicate results to fluctuate randomly around the mean of the set. In this chapter, we consider the sources of random errors, the determination of their magnitude, and their effects on computed results of chemical analyses. We also introduce the significant figure convention and illustrate its use in reporting analytical results. 6A The nature of random errors - random error in the results of analysts 2 and 4 is much larger than that seen in the results of analysts 1 and 3. - The results of analyst 3 show outstanding precision but poor accuracy. The results of analyst 1 show excellent precision and good accuracy. Figure 6-1 A three-dimensional plot showing absolute error in Kjeldahl nitrogen determinations for four different analysts. Random Error Sources - Small undetectable uncertainties produce a detectable random error in the following way. - Imagine a situation in which just four small random errors combine to give an overall error. We will assume that each error has an equal probability of occurring and that each can cause the final result to be high or low by a fixed amount ±U. - Table 6.1 gives all the possible ways in which four errors can combine to give the indicated deviations from the mean value.
    [Show full text]
  • Poisson Versus Negative Binomial Regression
    Handling Count Data The Negative Binomial Distribution Other Applications and Analysis in R References Poisson versus Negative Binomial Regression Randall Reese Utah State University [email protected] February 29, 2016 Randall Reese Poisson and Neg. Binom Handling Count Data The Negative Binomial Distribution Other Applications and Analysis in R References Overview 1 Handling Count Data ADEM Overdispersion 2 The Negative Binomial Distribution Foundations of Negative Binomial Distribution Basic Properties of the Negative Binomial Distribution Fitting the Negative Binomial Model 3 Other Applications and Analysis in R 4 References Randall Reese Poisson and Neg. Binom Handling Count Data The Negative Binomial Distribution ADEM Other Applications and Analysis in R Overdispersion References Count Data Randall Reese Poisson and Neg. Binom Handling Count Data The Negative Binomial Distribution ADEM Other Applications and Analysis in R Overdispersion References Count Data Data whose values come from Z≥0, the non-negative integers. Classic example is deaths in the Prussian army per year by horse kick (Bortkiewicz) Example 2 of Notes 5. (Number of successful \attempts"). Randall Reese Poisson and Neg. Binom Handling Count Data The Negative Binomial Distribution ADEM Other Applications and Analysis in R Overdispersion References Poisson Distribution Support is the non-negative integers. (Count data). Described by a single parameter λ > 0. When Y ∼ Poisson(λ), then E(Y ) = Var(Y ) = λ Randall Reese Poisson and Neg. Binom Handling Count Data The Negative Binomial Distribution ADEM Other Applications and Analysis in R Overdispersion References Acute Disseminated Encephalomyelitis Acute Disseminated Encephalomyelitis (ADEM) is a neurological, immune disorder in which widespread inflammation of the brain and spinal cord damages tissue known as white matter.
    [Show full text]
  • 6.1 Definition: the Density Function of Th
    CHAPTER 6: Some Continuous Probability Distributions Continuous Uniform Distribution: 6.1 Definition: The density function of the continuous random variable X on the interval [A; B] is 1 A x B B A ≤ ≤ f(x; A; B) = 8 − < 0 otherwise: : Application: Some continuous random variables in the physical, management, and biological sciences have approximately uniform probability distributions. For example, suppose we are counting events that have a Poisson distribution, such as telephone calls coming into a switchboard. If it is known that exactly one such event has occurred in a given interval, say (0; t),then the actual time of occurrence is distributed uniformly over this interval. Example: Arrivals of customers at a certain checkout counter follow a Poisson distribution. It is known that, during a given 30-minute period, one customer arrived at the counter. Find the probability that the customer arrived during the last 5 minutes of the 30-minute period. Solution: As just mentioned, the actual time of arrival follows a uniform distribution over the interval of (0; 30). If X denotes the arrival time, then 30 1 30 25 1 P (25 X 30) = dx = − = ≤ ≤ Z25 30 30 6 Theorem 6.1: The mean and variance of the uniform distribution are 2 B 2 2 B 1 x B A A+B µ = A x B A = 2(B A) = 2(B− A) = 2 : R − h − iA − It is easy to show that (B A)2 σ2 = − 12 Normal Distribution: 6.2 Definition: The density function of the normal random variable X, with mean µ and variance σ2, is 2 1 (1=2)[(x µ)/σ] n(x; µ, σ) = e− − < x < ; p2πσ − 1 1 where π = 3:14159 : : : and e = 2:71828 : : : Example: The SAT aptitude examinations in English and Mathematics were originally designed so that scores would be approximately normal with µ = 500 and σ = 100.
    [Show full text]
  • Statistical Inference
    GU4204: Statistical Inference Bodhisattva Sen Columbia University February 27, 2020 Contents 1 Introduction5 1.1 Statistical Inference: Motivation.....................5 1.2 Recap: Some results from probability..................5 1.3 Back to Example 1.1...........................8 1.4 Delta method...............................8 1.5 Back to Example 1.1........................... 10 2 Statistical Inference: Estimation 11 2.1 Statistical model............................. 11 2.2 Method of Moments estimators..................... 13 3 Method of Maximum Likelihood 16 3.1 Properties of MLEs............................ 20 3.1.1 Invariance............................. 20 3.1.2 Consistency............................ 21 3.2 Computational methods for approximating MLEs........... 21 3.2.1 Newton's Method......................... 21 3.2.2 The EM Algorithm........................ 22 1 4 Principles of estimation 23 4.1 Mean squared error............................ 24 4.2 Comparing estimators.......................... 25 4.3 Unbiased estimators........................... 26 4.4 Sufficient Statistics............................ 28 5 Bayesian paradigm 33 5.1 Prior distribution............................. 33 5.2 Posterior distribution........................... 34 5.3 Bayes Estimators............................. 36 5.4 Sampling from a normal distribution.................. 37 6 The sampling distribution of a statistic 39 6.1 The gamma and the χ2 distributions.................. 39 6.1.1 The gamma distribution..................... 39 6.1.2 The Chi-squared distribution.................. 41 6.2 Sampling from a normal population................... 42 6.3 The t-distribution............................. 45 7 Confidence intervals 46 8 The (Cramer-Rao) Information Inequality 51 9 Large Sample Properties of the MLE 57 10 Hypothesis Testing 61 10.1 Principles of Hypothesis Testing..................... 61 10.2 Critical regions and test statistics.................... 62 10.3 Power function and types of error.................... 64 10.4 Significance level............................
    [Show full text]
  • Likelihood-Based Inference
    The score statistic Inference Exponential distribution example Likelihood-based inference Patrick Breheny September 29 Patrick Breheny Survival Data Analysis (BIOS 7210) 1/32 The score statistic Univariate Inference Multivariate Exponential distribution example Introduction In previous lectures, we constructed and plotted likelihoods and used them informally to comment on likely values of parameters Our goal for today is to make this more rigorous, in terms of quantifying coverage and type I error rates for various likelihood-based approaches to inference With the exception of extremely simple cases such as the two-sample exponential model, exact derivation of these quantities is typically unattainable for survival models, and we must rely on asymptotic likelihood arguments Patrick Breheny Survival Data Analysis (BIOS 7210) 2/32 The score statistic Univariate Inference Multivariate Exponential distribution example The score statistic Likelihoods are typically easier to work with on the log scale (where products become sums); furthermore, since it is only relative comparisons that matter with likelihoods, it is more meaningful to work with derivatives than the likelihood itself Thus, we often work with the derivative of the log-likelihood, which is known as the score, and often denoted U: d U (θ) = `(θjX) X dθ Note that U is a random variable, as it depends on X U is a function of θ For independent observations, the score of the entire sample is the sum of the scores for the individual observations: X U = Ui i Patrick Breheny Survival
    [Show full text]
  • (Introduction to Probability at an Advanced Level) - All Lecture Notes
    Fall 2018 Statistics 201A (Introduction to Probability at an advanced level) - All Lecture Notes Aditya Guntuboyina August 15, 2020 Contents 0.1 Sample spaces, Events, Probability.................................5 0.2 Conditional Probability and Independence.............................6 0.3 Random Variables..........................................7 1 Random Variables, Expectation and Variance8 1.1 Expectations of Random Variables.................................9 1.2 Variance................................................ 10 2 Independence of Random Variables 11 3 Common Distributions 11 3.1 Ber(p) Distribution......................................... 11 3.2 Bin(n; p) Distribution........................................ 11 3.3 Poisson Distribution......................................... 12 4 Covariance, Correlation and Regression 14 5 Correlation and Regression 16 6 Back to Common Distributions 16 6.1 Geometric Distribution........................................ 16 6.2 Negative Binomial Distribution................................... 17 7 Continuous Distributions 17 7.1 Normal or Gaussian Distribution.................................. 17 1 7.2 Uniform Distribution......................................... 18 7.3 The Exponential Density...................................... 18 7.4 The Gamma Density......................................... 18 8 Variable Transformations 19 9 Distribution Functions and the Quantile Transform 20 10 Joint Densities 22 11 Joint Densities under Transformations 23 11.1 Detour to Convolutions......................................
    [Show full text]
  • An Approach for Appraising the Accuracy of Suspended-Sediment Data
    An Approach for Appraising the Accuracy of Suspended-sediment Data U.S. GEOLOGICAL SURVEY PROFESSIONAL PAl>£R 1383 An Approach for Appraising the Accuracy of Suspended-sediment Data By D. E. BURKHAM U.S. GEOLOGICAL SURVEY PROFESSIONAL PAPER 1333 UNITED STATES GOVERNMENT PRINTING OFFICE, WASHINGTON, 1985 DEPARTMENT OF THE INTERIOR DONALD PAUL MODEL, Secretary U.S. GEOLOGICAL SURVEY Dallas L. Peck, Director First printing 1985 Second printing 1987 For sale by the Books and Open-File Reports Section, U.S. Geological Survey, Federal Center, Box 25425, Denver, CO 80225 CONTENTS Page Page Abstract ........... 1 Spatial error Continued Introduction ....... 1 Application of method ................................ 11 Problem ......... 1 Basic data ......................................... 11 Purpose and scope 2 Standard spatial error for multivertical procedure .... 11 Sampling error .......................................... 2 Standard spatial error for single-vertical procedure ... 13 Discussion of error .................................... 2 Temporal error ......................................... 13 Approach to solution .................................. 3 Discussion of error ................................... 13 Application of method ................................. 4 Approach to solution ................................. 14 Basic data .......................................... 4 Application of method ................................ 14 Standard sampling error ............................. 4 Basic data ........................................
    [Show full text]
  • Approximating the Distribution of the Product of Two Normally Distributed Random Variables
    S S symmetry Article Approximating the Distribution of the Product of Two Normally Distributed Random Variables Antonio Seijas-Macías 1,2 , Amílcar Oliveira 2,3 , Teresa A. Oliveira 2,3 and Víctor Leiva 4,* 1 Departamento de Economía, Universidade da Coruña, 15071 A Coruña, Spain; [email protected] 2 CEAUL, Faculdade de Ciências, Universidade de Lisboa, 1649-014 Lisboa, Portugal; [email protected] (A.O.); [email protected] (T.A.O.) 3 Departamento de Ciências e Tecnologia, Universidade Aberta, 1269-001 Lisboa, Portugal 4 Escuela de Ingeniería Industrial, Pontificia Universidad Católica de Valparaíso, Valparaíso 2362807, Chile * Correspondence: [email protected] or [email protected] Received: 21 June 2020; Accepted: 18 July 2020; Published: 22 July 2020 Abstract: The distribution of the product of two normally distributed random variables has been an open problem from the early years in the XXth century. First approaches tried to determinate the mathematical and statistical properties of the distribution of such a product using different types of functions. Recently, an improvement in computational techniques has performed new approaches for calculating related integrals by using numerical integration. Another approach is to adopt any other distribution to approximate the probability density function of this product. The skew-normal distribution is a generalization of the normal distribution which considers skewness making it flexible. In this work, we approximate the distribution of the product of two normally distributed random variables using a type of skew-normal distribution. The influence of the parameters of the two normal distributions on the approximation is explored. When one of the normally distributed variables has an inverse coefficient of variation greater than one, our approximation performs better than when both normally distributed variables have inverse coefficients of variation less than one.
    [Show full text]