# 5.1 CHI-SQUARE TEST OF INDEPENDENCE

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 C H A P T E R 5 Inferential Statistics and Predictive Analytics Inferential statistics draws valid inferences about a population based on an analysis of a representative sample of that population. The results of such an analysis are generalized to the larger population from which the sample originates, in order to make assumptions or predictions about the population in general. This chapter introduces linear, logistics, and polynomial regression analyses for inferential statistics. The result of a regression analysis on a sample is a predictive model in the form of a set of equations. The rst task of sample analysis is to make sure that the chosen sample is representative of the population as a whole. We have previously discussed the one-way chi-square goodness-of-t test for such a task by comparing the sample distribution with an expected distribution. Here we present the chi-square two-way test of independence to determine whether signicant dierences exist between the distributions in two or more categories. This test helps to determine whether a candidate independent variable in a regression analysis is a true candidate predictor of the dependent variable, and to thus exclude irrelevant variables from consideration in the process. We also generalize traditional regression analyses to Bayesian regression analyses, where the regression is undertaken within the context of the Bayesian inference. We present the most general Bayesian regression analysis, known as the Gaussian process. Given its similarity to other decision tree learning techniques, we save discussion of the Classication and Regression Tree (CART) technique for the later chapter on ML. To use inferential statistics to infer latent concepts and variables and their relationships, this chapter includes a detailed description of principal component and factor analyses. To use inferential statistics for forecasting by modeling time series data, we present survival analysis and autoregression techniques. Later in the book we devote a full chapter to AI- and ML-oriented 75

2 76 Computational Business Analytics techniques for modeling and forecasting from time series data, including dynamic Bayesian networks and Kalman ltering. 5.1 CHI-SQUARE TEST OF INDEPENDENCE The one-way Chi-Square (χ 2 ) goodness-of-t test (which was introduced earlier in the descriptive analytics chapter) is a non-parametric test used to decide whether distributions of categorical variables dier signicantly from predicted values. The two-way or two-sample chi-square test of independence is used to determine whether a signicant dierence exists between the distributions of two or more categorical variables. To determine if Outlook is a good predictor of Decision in our play-tennis example in Appendix B, for instance, the null hypothesis H0 is that two distributions are not equal; in other words, that the weather does not aect if one decides to play or not. The Outlook vs. Decision table is shown below in TABLE 5.1. Note that the row and the column subtotals must have equal sums, and that total expected frequencies must equal total observed frequencies. TABLE 5.1: : Outlook vs. Decision table Outlook Decision play Decision don't play Row Subtotal sunny overcast rain Column Subtotal 9 5 Total = 14 Note also that we are computing expectation as follows with a view that the observations are assumed to be representative of the past Exp (Outlook = sunny & Decision = play) = 14 p (Outlook = sunny & Decision = play) = 14 p ( (Outlook = sunny) p (Decision = play) ) = 14 (p (Outlook = sunny) p (Decision)) ( Decision ) (p (Decision = play) p (Outlook)) Outlook = 14 (p (sunny) p (play) + p (sunny) p (don t play)) (p (play) p (sunny) + p (play) p (overcast) + p (play) p (rain)) = 14 (Row subtotal for sunny/14) (Column subtotal for play/14) = (5 9) /14 The computation of Chi-square statistic is shown in TABLE 5.2.

3 Inferential Statistics and Predictive Analytics 77 TABLE 5.2: : Computation of Chi-square statistic Joint Variable Observed (O) Expected (E) (O-E) 2 /E sunny & play sunny & don't play overcast & play overcast & don't play rainy & play rainy & don't play Therefore, Chi-square statistic = i (O E) 2 E = 3.46 The degree of freedom is (3 1) (2 1), that is, 2. With 95% as the level of signicance, the critical value from the Chi-square table is Since the value 3.46 is less than 5.99, so we would reject the null hypothesis that there is signicant dierence between the distributions in Outlook and Decision. Hence the weather does aect if one decides to play or not. 5.2 REGRESSION ANALYSES In this section, we begin with simple and multiple linear regression techniques, then present logistic regression for handling categorical variables as the dependent variables, and, nally, discuss polynomial regression for modeling nonlinearity in data Simple Linear Regression Simple linear regression models the relationship between two variables X and Y by tting a linear equation to observed data: Y = a + bx where X is called an explanatory variable and Y is called a dependent variable. The slope b and the intercept a in the above equation must be estimated from a given set of observations. Least-squares is the most common method for tting equations, wherein the best-tting line for the observed data is calculated by minimizing the sum of the squares of the vertical deviations from each data point to the line. Suppose the set (y 1, x 1 ),..., (y n, x n ) of n observations are given. The expression to be minimized is the sum of the squares of the residuals (i.e., the dierences between the observed and predicted values): n (y i a bx i ) 2 i=1 By solving the two equations obtained by taking partial derivatives of the

4 78 Computational Business Analytics above expression with respect to a and b and then equating them to zero, the estimations of a and b can be obtained. n n n x iy i 1 n x i y j i=1 i=1 j=1 n (x i X) = ( 2 n n ) 2 = Cov(X,Y ) x 2 i 1 V ar(x) n x i i=1 i=1 i=1 n (x i ˆb X)(y i Ȳ ) = i=1 â = Ȳ ˆb X The plot in FIGURE 5.1 shows the observations and linear regression model (the straight line) of the two variables Temperature (Fahrenheit degree) and Humidity (%), with Temperature as the dependent variable. For any given observation of Humidity, the dierence between the observed and predicted value of Temperature provides the residual error. FIGURE 5.1 : Example linear regression The correlation coecient measure between the observed and predicted values can be used to determine how close the residuals are to the regression line Multiple Linear Regression Multiple linear regression models the relationship between two or more response variables X i and one dependent variable Y as follows: Y = a + b 1 X b p X p The given n observations (y 1, x 11,..., x 1p ),..., (y n, x n1,..., x np ) in matrix form are

5 Inferential Statistics and Predictive Analytics 79 y 1 y 2... y n = Or in abbreviated form a a... a + The expression to be minimized is b 1 b 2... b p T Y=A+B T X x 11 x x n1 x 12 x x n x 1p x 2p... x np n (y i a b 1 x i1... b p x ip ) 2 i=1 The estimates of A and B are as follows: Logistic Regression ˆB = ( X T X ) 1 X T Y = Cov(X,Y) V ar(x) Â = Ȳ ˆB X The dependent variable in logistic regression is binary. In order to predict categorical attribute Decision in the play-tennis example in Appendix B from a new category Temperature, suppose the attribute Temp_0_1 represents a continuous version of the attribute Decision, with 0 and 1 representing the values don't play and play respectively. FIGURE 5.2 shows the scatter plot and a line plot of Temperature vs. Temp_0_1 (left), and a scatter plot and logistic curve for the same (right). The scatter plot shows that there is a uctuation among the observed values, in the sense that for a given Temperature (say, 72), the value of the dependent variable (play/don't play) has been observed to be both 0 and 1 on two dierent occasions. Consequently, the line plot oscillates between 0 and 1 around that temperature. On the other hand, the logistic curve transitions smoothly from 0 to 1. We describe here briey how logistic regression is formalized. Since the value of the dependent variable is either 0 or 1, the most intuitive way to apply linear regression would be to think of the response as a probability value. The prediction will fall into one class or the other if the response crosses a certain threshold or not, and therefore the linear equation will be of the form: p (Y = 1 X) = a + bx However, the value of a+bx could be > 1 or < 0 for some X, giving probabilities that cannot exist. The solution is to use a dierent probability representation. Consider the following equation with a ratio as the response variable: p 1 p = a + bx

6 80 Computational Business Analytics FIGURE 5.2 : (left) Scatter and line plots of Temperature vs. Temp_0_1, and (right) scatter plot and logistic curve for the same The ratio ranges from 0 to for some X but the value of a + bx would be below 0 for some X. The solution is to take the log of the ratio: ( ) p log = a + bx 1 p The logit function above transforms a probability statement dened in 0 < p < 1 to one dened in < a + bx <. The value of p is as follows: p = ea+bx 1 + e a+bx A maximum likelihood method can be applied to estimate the parameters a and b of a logistic model with binary response: Y = 1 with probability p Y = 0 with probability 1 p For each Y i = 1 the probability p i appears in the likelihood product. Similarly, for each Y i = 0 the probability 1 p i appears in the product. Thus, the likelihood of the sample (y 1, x 1 ),..., (y n, x n ) of n observations takes the following form: L (a, b; (y 1, x 1 ),..., (y n, x n )) = n p yi (1 p) 1 yi i=1 = n ( ) yi ( i=1 = n i=1 e a+bx i 1+e a+bx i (e a+bx i ) y i 1+e a+bx i 1 1+e a+bx i ) 1 yi Alternatively, we can maximize the log likelihood, log (L (a, b; Data)), to solve

7 Inferential Statistics and Predictive Analytics 81 for a and b. In the example above, the two values of a and b that maximize the likelihood are and -0.62, respectively. Hence the logistic equation is: ( ) p log = X 1 p FIGURE 5.2 (right) shows the logistics curve plotted for the sample Polynomial Regression The regression model Y = a 0 + a 1 X + a 2 X a k X k is called the k-th order polynomial model with one variable, where a 0 is the Y -intercept of X, a 1 is called the linear eect parameter, a 2 is called the quadratic eect parameter, and so on. The model is a linear regression model for k = 1. This model is non-linear in the X variable, but it is linear in the parameters a 0, a 1, a 2,... and a k. One can also have higher-order polynomial regression involving more than one variable. For example, a second-order or quadratic polynomial regression with two variables X 1 and X 2 is Y = a 0 + a 1 X 1 + a 2 X 2 + a 11 X a 22 X a 12 X 1 X 2 FIGURE 5.3 (left) shows a plot of 7 noisy, evenly-spaced random training samples (x 1, y 1 ),..., (x 7, y 7 ) drawn from an underlying function f (shown in dotted line). Note that a dataset of k+1 observations can be modeled perfectly by a polynomial of degree k. In this case, a six-degree polynomial will t the data perfectly, but will over-t the data and will not generalize well for test data. To decide on the appropriate degree for a polynomial regression model, one can begin with a linear model and include higher-order terms one by one until the highest-order term becomes non-signicant (determined by looking at p-values for the t-test for slopes). One could also start with a high-order model and exclude the non-signicant highest-order terms one by one until the remaining highest-order term becomes signicant. Here we measure tness with respect to the test data of eight evenly-spaced samples as shown plotted in FIGURE 5.3 (right). FIGURE 5.4 shows six dierent polynomial regressions of degrees 1 to 6 along with the sample data. Note that the polynomial regression of degree 6 goes through all seven points and ts perfectly. The closest t to the sample training data is based on the R2 measure in Excel. FIGURE 5.5 (left) shows this measure of tness between the training data and the predictions of each polynomial model of certain degree. As shown in the gure, the polynomial of degree 6 has the perfect measure of tness 1.0. The test error is based on the error measure 8 y i f (x i ) i=1

8 82 Computational Business Analytics FIGURE 5.3 : Sample (left) and test data (right) from a function between the test data and the six polynomial regressions corresponding to degrees 1 to 6. We can see in FIGURE 5.5 (left) that while the measure of tness is steadily increasing towards 1.0, the test error in FIGURE 5.5 (right) reaches a minimum at degree 2 (hence the best t) and then increases rapidly as the models begin to over-t the training data. 5.3 BAYESIAN LINEAR REGRESSION Bayesian linear regression views the regression problem as introduced above as an estimation of the functional dependence between an input variable X in R d and an output variable Y in R as shown below: Y (X) = M w i φ i (X) + ε i=1 = w T Φ (X) + ε where w T Φ (X) (e.g., Φ (X) = ( 1, x, x 2,... ) ) is a linear combination of M predened nonlinear basis functions φ i (X) with input in R d and output in R. The observations are additively corrupted by i.i.d. noise with normal distribution ε N ( 0, σn 2 ) that has zero mean and variance σ 2 n. The goal of Bayesian regression is to estimate the weights w i given a training set {(x 1, y 1 ),..., (x n, y n )} of data points. In contrast to classical regression, a Bayesian linear regression characterizes the uncertainty in w through a probability distribution p (w). We use a multivariate normal distribution as prior on the weights as p (w) = N (0, Σ w )

9 Inferential Statistics and Predictive Analytics 83 FIGURE 5.4 : Fitting polynomials of degrees 1 to 6 with zero mean and Σ w as an M M -sized covariance matrix. Further observations of data points modify this distribution using Bayes' theorem, with the assumption that the data points have been generated via the likelihood function. Let us illustrate Bayesian linear regression as Y = w T X + ε

10 84 Computational Business Analytics FIGURE 5.5 : Plots of tness measures (left) and test errors (right) against polynomial degrees Suppose D is the d n matrix of input x vectors from this training set and y is the vector of y values. We have a Gaussian prior p (w) of parameters w, and the likelihood of the parameters is p (y D, w) = N ( w T D, σ 2 ni ) According to Bayes' rule, the posterior distribution over w is p (w y, D) p (y D, ( w) p (w) = N 1 σ 2 n The predictive distribution is ) A 1 Dy, A 1, where A = Σ 1 w + 1 σ DD T n 2 p (Y X, y, D) = ( w T X ) p (w y, D) dw w ( ) 1 = N σ X T A 1 Dy, X T A 1 X n 2 The multivariate normal distribution above can be used for predicting Y given a vector input X Gaussian Processes A Gaussian process is a collection of random variables, any nite subset of which has a joint Gaussian distribution. Gaussian processes extend multivariate Gaussian distributions to innite dimensionality. A regression technique starts with a set of data points, {(x 1, y 1 ),..., (x n, y n )}, consisting of inputoutput pairs. The task is then to predict or interpolate the output value y given an input vector x. As we observe the output, the new input-output pair

11 Inferential Statistics and Predictive Analytics 85 is added to the observation data set. Thus the data set grows in size over time. Any number of observations y 1,..., y n in an arbitrary data set can be viewed as a single point sampled from some multivariate Gaussian distribution. Hence, a regression data set can be partnered with a Gaussian process where the prediction always takes into account the latest observations. We consider a more general form of regression function for interpolation Y = f (X) + N ( 0, σn 2 ) where each observation X can be thought of as related to an underlying function f through some Gaussian noise model. We solve the above for the function f. In fact, given n data points and new input X, our objective is to predict Y and not the actual f since their expected values are identical (according to the above regression function). We can obtain a Gaussian process from the Bayesian linear regression model: f (X) = w T X with w N (0, Σ w ) where the mean is given by E [f (X)] = E [ w T ] X = 0 and the covariance is given by [ ] E f (x i ) T f (x j ) = x T i E [ ww T ] x j = x T i Σ w x j It is often assumed that the mean of this Gaussian process is zero everywhere, but one observation is related to another observation via the covariance function k (x i, x j ) = σ 2 f e x i x j 2 2l 2 + σ 2 n δ (x i, x j ) where the maximum allowable covariance is dened as σf 2, which should be high (and hence not zero) for functions covering a broad range on the Y axis. The value of the kernel function approaches its maximum if x i x j. In this case f (x i ) and f (x j ) are perfectly correlated. This means the neighboring points yield very close functional values, making the function smooth, and distant observations will have a negligible eect during interpolation of f at a new x value. The length parameterl determines the eect of this separation. δ (x i, x j ) is known as the Kronecker delta function (δ (x i, x j ) = 0 if x i x j else 1). For Gaussian process regression, suppose the observation set is {(x 1, y 1 ),..., (x n, y n )} and a new input observation is x We capture the covariance functions k (x i, x j ) for all possible x i, x j, and x in the following three matrices: K = k (x 1, x 1 ) k (x 1, x 2 )... k (x 1, x n ) k (x 2, x 1 ) k (x 2, x 2 )... k (x 2, x n ) k (x n, x 1 ) k (x n, x 2 )... k (x n, x n )

12 86 Computational Business Analytics K = [ k (x, x 1 ) k (x, x 2 )... k (x, x n ) ] K = k (x, x ) Note that k (x i, x i ) = σf 2 + σ2 n, for all i. As per the assumption of a Gaussian process, the data set can be represented as a multivariate Gaussian distribution as follows: [ ] ( [ ]) y K K T N 0, y K K We are interested in the conditional distribution p (y y) which is given below: y y N ( K K 1 y, K K K 1 K T ) Therefore the best estimate for y is the mean K K 1 y of the above distribution. Example To illustrate the Gaussian process, consider the sample data set of seven points in TABLE 5.3, a plot of which was shown earlier in FIGURE 5.3. Considering the covariance function: TABLE 5.3: : Sample data set X Y ? k (x i, x j ) = e x i x j 2 2l 2 With the value of l as 0.8 in the function k above, we calculate the covariance matrix K as shown in TABLE 5.4. TABLE 5.4: : Matrix of covariance functions E E E E E E E E

13 Inferential Statistics and Predictive Analytics 87 TABLE 5.4: : Matrix of covariance functions 3.29E E E E E E It is clear from the above table that the closer the X values are to each other, the higher the values of the covariance function are. We also have K as shown in TABLE 5.5. TABLE 5.5: : Vector of covariance functions 4.62E E E E The formula K K 1 y provides 3.23 as the mean of the predicted y-value for x = PRINCIPAL COMPONENT AND FACTOR ANALYSES Principal component analysis (PCA) converts a set of measurements of possibly correlated variables into a set of values of linearly uncorrelated variables called principal components. PCA can be done by eigenvalue decomposition or SVD as introduced earlier in the background chapter. Example Consider the data set in FIGURE 5.6 with 6 variables and 51 observations of the US Electoral College votes, population, and area by state. The full data set is given in Appendix B. FIGURE 5.6 : United States Electoral College votes, population, and area by state The correlation matrix in FIGURE 5.7 clearly indicates two groups of correlated variables. The fact that the number of electoral votes is proportional to the population gives rise to the rst set of correlated variables. The second set of correlated variables is the set of all areas.

14 88 Computational Business Analytics FIGURE 5.7 : Correlation matrix for the data in FIGURE 5.6 All six eigenvalues and eigenvectors are shown in FIGURE 5.8, of which the rst three are dominating as expected, given the two groups of correlated variables as shown in FIGURE 5.7 and the only remaining variable for density. The rst principal component PRIN1 shows the domination of the coecients corresponding to the three variables related to the areas. The second principal component PRIN2 shows the domination of the coecients corresponding to Electoral Votes and Population. FIGURE 5.8 : Eigenvalues and eigenvectors of the correlation matrix in FIGURE 5.7 FIGURE 5.9 shows the principal component plot of the data set in FIG- URE 5.6 with the rst two components. It is clear from the plot that the component PRIN1 is about the area and PRIN2 is about the population. This is the reason why the state of Alaska has a large PRIN1 value but very little PRIN2, and DC is just opposite. The state of California has large values for both PRIN1 and PRIN2. Factor analysis (Anderson, 2003; Gorsuch, 1983) helps to obtain a small set of independent variables, called factors or latent variables, from a large set of correlated observed variables. Factor analysis describes the variability among observed variables in order to gain better insight into categories or to provide a simpler prediction structure. For example, factor analysis can reduce a large number of nancial ratios into categories of nancial ratios on

16 90 Computational Business Analytics the common factors while the residual variables are often called the unique or specic factors. The number of factors m should be substantially smaller than n. If the original variables X 1,..., X n are at least moderately correlated, the basic dimensionality of the system is less than n. The goal of factor analysis is to reduce the redundancy among the variables by using a smaller number of factors. To start an EFA, we rst extract initial factors, using principal components to decide on the number of factors. Eigenvalue is the amount of variance in the data described by the factor, and eigenvalues help to choose the number of factors. In principal components, the rst factor describes most of the variability. We then choose the number of factors to retain, and rotate axes to spread variability more evenly among factors. Redening factors that loadings tend to make very high (-1 or 1) or very low (0) makes sharper distinctions in the interpretations of the factors. Example We apply the principal component-based factoring method on the data in FIG- URE 5.6. The eigenvalues and the factor patterns are shown in FIGURE FIGURE 5.10 URE 5.6 : Eigenvalues and factor patterns for the data in FIG- Now we apply the orthogonal Varimax rotation (maximizes the sum of the variances of the squared loadings) to obtain rotated factor patterns, as shown in FIGURE 5.11, and the revised distribution of variance explained by each factor, as shown in FIGURE The total variance explained remains the same and gets evenly distributed between the major two factors. Example Here is an articial example to check the validity and robustness of factor analysis. The data from the Thurstone box problem (Thurstone, 1947), as shown in FIGURE 5.13, measures 20 dierent characteristics of boxes, such as individual surface areas and box inter-diagonals. If these measurements are only linear combinations of the height, width, and depth of the box, then the

17 Inferential Statistics and Predictive Analytics 91 FIGURE 5.11 : Rotated factor patterns from factors in FIGURE 5.10 FIGURE 5.12 : Variance explained by each factor in FIGURE 5.11 data set could be reproduced by knowing only these dimensions and by giving them appropriate weights. These three dimensions are considered as factors. FIGURE 5.13 : 20 variable box problem data set (Thurstone, 1947) As shown in FIGURE 5.14, the three dimensions of space are approximately discovered by the factor analysis, despite the fact that the box characteristics are not linear combinations of underlying factors but are instead multiplicative functions. Initial loadings and components are extracted using PCA. The question is how many factors to extract in a given data set. Kaiser's criterion suggests that it is only worthwhile to extract factors which account for large variance. Therefore, we retain those factors with eigenvalues equal to or greater than 1.

18 92 Computational Business Analytics There are 20 observations, each a function of x, y or z or one of their combinations. In FIGURE 5.14, Proportion indicates the relative weight of each factor in the total variance. For example, /20 = So the rst factor explains about 63% of the total variance. Cumulative shows the total amount of variance explained, and the rst six eigenvalues explain almost 99.6% of the total variance. From a factor analysis perspective the rst three eigenvalues suggest a factor model with three common factors. This is because the rst two eigenvalues are greater than unity and the third one is closer to unity and together they explain over 98% of the total variance. FIGURE 5.14 : Factor analysis of the data in FIGURE 5.13 shows the eigenvalues for variance explained by each factor and three retained factors Rotating the components towards independence, rather than rotating the loadings towards simplicity, allows one to accurately recover the dimensions of each box and also to produce simple loadings. FIGURE 5.15 shows the factors of FIGURE 5.14 after an orthogonal Varimax rotation. The total of eigenvalues for the factors remains the same, but variability among factors is evenly distributed. There are some dierences between EFA and PCA and they will provide somewhat dierent results when applied to the same data. EFA assumes that the observations are based on the underlying factors, whereas in PCA the principal components are based on observations. The rotation of components is part of EFA but not PCA. 5.5 SURVIVAL ANALYSIS Survival analysis (Kleinbaum and Klein, 2005; Hosmer et al., 2008) is a timeto-event analysis that measures the time from the beginning of a study to a terminal event, conclusion of the observation period, or loss of contact/with-

19 Inferential Statistics and Predictive Analytics 93 FIGURE 5.15 rotation : Factors of FIGURE 5.14 after an orthogonal Varimax drawal from the study. Survival data consist of a response variable that measures the duration of time (event time, failure time, or survival time) until a specied event occurs. Optionally, the data may contain a set of independent variables that are possibly associated with the failure time variable. Examples of survival analysis include determining the lifetime of a device (the time after installation until the device breaks down), the time until a company declares bankruptcy after its inception, the length of time an auto driver stayed accident-free since becoming insured, the length of time a person stayed on a job, the retention time of customers, and the survival time (or time until death) for organ transplant patients since transplant surgery. The censoring problem in survival analysis arises due to incomplete observations of survival time during a period of study. Some subjects of study have censored survival times because they may not be observed for the full study period due to drop-out, loss to followup, or early termination of the study. A censored subject may or may not have an event of interest if it occurs before the end of the study but their data is incomplete. Example FIGURE 5.16 illustrates the survival histories of six subjects in an example of a study that could be measuring implanted device lifetimes or post-organ transplant outcomes. In the gure, the terminal event of interest is breakdown or death which motivates a study of survival time. Not all devices will cease to work during the 325 days of the study period, but all will break down eventually. In the gure, the solid line represents an observed period at risk, while the broken line represents an unobserved period at risk. The letter X represents an

20 94 Computational Business Analytics FIGURE 5.16 : Survival histories of subjects for analysis observed terminal event, the open circle represents the censoring time, and the letter N represents an unobserved event. An observation that is right-censored means the relevant event has not yet occurred at the time of observation. An observation that is left-censored means the relevant event has occurred before the time of observation but the exact time is not known. An observation is interval-censored if the event occurs at an unknown point in a time interval. Right-censored observations are the most common kind. Example In FIGURE 5.16, the observation of subject 5 is right-censored. Subject 4 joined the study late. Subject 6 is lost to observation for a while. Subject 2 joined the study on time but was lost to observation after some time, and died before the study period ended, but it is not known exactly when. Consider the random variable T representing the survival time with density f (t). The cumulative distribution function is F (t) = p (T t), which represents the probability that a subject survives no longer than time t. S (t) is the survival function or the probability that a subject survives longer than

### Inferential Statistics

Inferential Statistics Sampling and the normal distribution Z-scores Confidence levels and intervals Hypothesis testing Commonly used statistical methods Inferential Statistics Descriptive statistics are

### Simple Linear Regression Inference

Simple Linear Regression Inference 1 Inference requirements The Normality assumption of the stochastic term e is needed for inference even if it is not a OLS requirement. Therefore we have: Interpretation

### CHAPTER 13 SIMPLE LINEAR REGRESSION. Opening Example. Simple Regression. Linear Regression

Opening Example CHAPTER 13 SIMPLE LINEAR REGREION SIMPLE LINEAR REGREION! Simple Regression! Linear Regression Simple Regression Definition A regression model is a mathematical equation that descries the

: Table of Contents... 1 Overview of Model... 1 Dispersion... 2 Parameterization... 3 Sigma-Restricted Model... 3 Overparameterized Model... 4 Reference Coding... 4 Model Summary (Summary Tab)... 5 Summary

### Gamma Distribution Fitting

Chapter 552 Gamma Distribution Fitting Introduction This module fits the gamma probability distributions to a complete or censored set of individual or grouped data values. It outputs various statistics

### Multivariate Normal Distribution

Multivariate Normal Distribution Lecture 4 July 21, 2011 Advanced Multivariate Statistical Methods ICPSR Summer Session #2 Lecture #4-7/21/2011 Slide 1 of 41 Last Time Matrices and vectors Eigenvalues

### NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

Chapter 340 Principal Components Regression Introduction is a technique for analyzing multiple regression data that suffer from multicollinearity. When multicollinearity occurs, least squares estimates

### Statistics in Retail Finance. Chapter 6: Behavioural models

Statistics in Retail Finance 1 Overview > So far we have focussed mainly on application scorecards. In this chapter we shall look at behavioural models. We shall cover the following topics:- Behavioural

### Introduction to Logistic Regression

OpenStax-CNX module: m42090 1 Introduction to Logistic Regression Dan Calderon This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 3.0 Abstract Gives introduction

### Survey, Statistics and Psychometrics Core Research Facility University of Nebraska-Lincoln. Log-Rank Test for More Than Two Groups

Survey, Statistics and Psychometrics Core Research Facility University of Nebraska-Lincoln Log-Rank Test for More Than Two Groups Prepared by Harlan Sayles (SRAM) Revised by Julia Soulakova (Statistics)

### Statistics for Business Decision Making

Statistics for Business Decision Making Faculty of Economics University of Siena 1 / 62 You should be able to: ˆ Summarize and uncover any patterns in a set of multivariate data using the (FM) ˆ Apply

### 11. Analysis of Case-control Studies Logistic Regression

Research methods II 113 11. Analysis of Case-control Studies Logistic Regression This chapter builds upon and further develops the concepts and strategies described in Ch.6 of Mother and Child Health:

### Survival Analysis Using SPSS. By Hui Bian Office for Faculty Excellence

Survival Analysis Using SPSS By Hui Bian Office for Faculty Excellence Survival analysis What is survival analysis Event history analysis Time series analysis When use survival analysis Research interest

### Introduction to Regression and Data Analysis

Statlab Workshop Introduction to Regression and Data Analysis with Dan Campbell and Sherlock Campbell October 28, 2008 I. The basics A. Types of variables Your variables may take several forms, and it

### SPSS TRAINING SESSION 3 ADVANCED TOPICS (PASW STATISTICS 17.0) Sun Li Centre for Academic Computing lsun@smu.edu.sg

SPSS TRAINING SESSION 3 ADVANCED TOPICS (PASW STATISTICS 17.0) Sun Li Centre for Academic Computing lsun@smu.edu.sg IN SPSS SESSION 2, WE HAVE LEARNT: Elementary Data Analysis Group Comparison & One-way

### Review Jeopardy. Blue vs. Orange. Review Jeopardy

Review Jeopardy Blue vs. Orange Review Jeopardy Jeopardy Round Lectures 0-3 Jeopardy Round \$200 How could I measure how far apart (i.e. how different) two observations, y 1 and y 2, are from each other?

### Example: Credit card default, we may be more interested in predicting the probabilty of a default than classifying individuals as default or not.

Statistical Learning: Chapter 4 Classification 4.1 Introduction Supervised learning with a categorical (Qualitative) response Notation: - Feature vector X, - qualitative response Y, taking values in C

### Regression Analysis: A Complete Example

Regression Analysis: A Complete Example This section works out an example that includes all the topics we have discussed so far in this chapter. A complete example of regression analysis. PhotoDisc, Inc./Getty

Statistics Graduate Courses STAT 7002--Topics in Statistics-Biological/Physical/Mathematics (cr.arr.).organized study of selected topics. Subjects and earnable credit may vary from semester to semester.

### Simple Predictive Analytics Curtis Seare

Using Excel to Solve Business Problems: Simple Predictive Analytics Curtis Seare Copyright: Vault Analytics July 2010 Contents Section I: Background Information Why use Predictive Analytics? How to use

### Common factor analysis

Common factor analysis This is what people generally mean when they say "factor analysis" This family of techniques uses an estimate of common variance among the original variables to generate the factor

### Notes for STA 437/1005 Methods for Multivariate Data

Notes for STA 437/1005 Methods for Multivariate Data Radford M. Neal, 26 November 2010 Random Vectors Notation: Let X be a random vector with p elements, so that X = [X 1,..., X p ], where denotes transpose.

### SUMAN DUVVURU STAT 567 PROJECT REPORT

SUMAN DUVVURU STAT 567 PROJECT REPORT SURVIVAL ANALYSIS OF HEROIN ADDICTS Background and introduction: Current illicit drug use among teens is continuing to increase in many countries around the world.

### STA 4273H: Statistical Machine Learning

STA 4273H: Statistical Machine Learning Russ Salakhutdinov Department of Statistics! rsalakhu@utstat.toronto.edu! http://www.cs.toronto.edu/~rsalakhu/ Lecture 6 Three Approaches to Classification Construct

### Factor Analysis. Principal components factor analysis. Use of extracted factors in multivariate dependency models

Factor Analysis Principal components factor analysis Use of extracted factors in multivariate dependency models 2 KEY CONCEPTS ***** Factor Analysis Interdependency technique Assumptions of factor analysis

### Principal Components Analysis (PCA)

Principal Components Analysis (PCA) Janette Walde janette.walde@uibk.ac.at Department of Statistics University of Innsbruck Outline I Introduction Idea of PCA Principle of the Method Decomposing an Association

### Factors affecting online sales

Factors affecting online sales Table of contents Summary... 1 Research questions... 1 The dataset... 2 Descriptive statistics: The exploratory stage... 3 Confidence intervals... 4 Hypothesis tests... 4

### Auxiliary Variables in Mixture Modeling: 3-Step Approaches Using Mplus

Auxiliary Variables in Mixture Modeling: 3-Step Approaches Using Mplus Tihomir Asparouhov and Bengt Muthén Mplus Web Notes: No. 15 Version 8, August 5, 2014 1 Abstract This paper discusses alternatives

### Penalized regression: Introduction

Penalized regression: Introduction Patrick Breheny August 30 Patrick Breheny BST 764: Applied Statistical Modeling 1/19 Maximum likelihood Much of 20th-century statistics dealt with maximum likelihood

### Chapter 7: Simple linear regression Learning Objectives

Chapter 7: Simple linear regression Learning Objectives Reading: Section 7.1 of OpenIntro Statistics Video: Correlation vs. causation, YouTube (2:19) Video: Intro to Linear Regression, YouTube (5:18) -

### Introduction to Principal Components and FactorAnalysis

Introduction to Principal Components and FactorAnalysis Multivariate Analysis often starts out with data involving a substantial number of correlated variables. Principal Component Analysis (PCA) is a

### 7. Tests of association and Linear Regression

7. Tests of association and Linear Regression In this chapter we consider 1. Tests of Association for 2 qualitative variables. 2. Measures of the strength of linear association between 2 quantitative variables.

### Dimensionality Reduction: Principal Components Analysis

Dimensionality Reduction: Principal Components Analysis In data mining one often encounters situations where there are a large number of variables in the database. In such situations it is very likely

### E205 Final: Version B

Name: Class: Date: E205 Final: Version B Multiple Choice Identify the choice that best completes the statement or answers the question. 1. The owner of a local nightclub has recently surveyed a random

### Least Squares Estimation

Least Squares Estimation SARA A VAN DE GEER Volume 2, pp 1041 1045 in Encyclopedia of Statistics in Behavioral Science ISBN-13: 978-0-470-86080-9 ISBN-10: 0-470-86080-4 Editors Brian S Everitt & David

### 5. Linear Regression

5. Linear Regression Outline.................................................................... 2 Simple linear regression 3 Linear model............................................................. 4

### , then the form of the model is given by: which comprises a deterministic component involving the three regression coefficients (

Multiple regression Introduction Multiple regression is a logical extension of the principles of simple linear regression to situations in which there are several predictor variables. For instance if we

### 2. Simple Linear Regression

Research methods - II 3 2. Simple Linear Regression Simple linear regression is a technique in parametric statistics that is commonly used for analyzing mean response of a variable Y which changes according

### Gaussian Processes in Machine Learning

Gaussian Processes in Machine Learning Carl Edward Rasmussen Max Planck Institute for Biological Cybernetics, 72076 Tübingen, Germany carl@tuebingen.mpg.de WWW home page: http://www.tuebingen.mpg.de/ carl

### Tips for surviving the analysis of survival data. Philip Twumasi-Ankrah, PhD

Tips for surviving the analysis of survival data Philip Twumasi-Ankrah, PhD Big picture In medical research and many other areas of research, we often confront continuous, ordinal or dichotomous outcomes

### **BEGINNING OF EXAMINATION** The annual number of claims for an insured has probability function: , 0 < q < 1.

**BEGINNING OF EXAMINATION** 1. You are given: (i) The annual number of claims for an insured has probability function: 3 p x q q x x ( ) = ( 1 ) 3 x, x = 0,1,, 3 (ii) The prior density is π ( q) = q,

### Social Media Mining. Data Mining Essentials

Introduction Data production rate has been increased dramatically (Big Data) and we are able store much more data than before E.g., purchase data, social media data, mobile phone data Businesses and customers

### Lecture - 32 Regression Modelling Using SPSS

Applied Multivariate Statistical Modelling Prof. J. Maiti Department of Industrial Engineering and Management Indian Institute of Technology, Kharagpur Lecture - 32 Regression Modelling Using SPSS (Refer

### Part 2: Analysis of Relationship Between Two Variables

Part 2: Analysis of Relationship Between Two Variables Linear Regression Linear correlation Significance Tests Multiple regression Linear Regression Y = a X + b Dependent Variable Independent Variable

### How to report the percentage of explained common variance in exploratory factor analysis

UNIVERSITAT ROVIRA I VIRGILI How to report the percentage of explained common variance in exploratory factor analysis Tarragona 2013 Please reference this document as: Lorenzo-Seva, U. (2013). How to report

### Overview of Factor Analysis

Overview of Factor Analysis Jamie DeCoster Department of Psychology University of Alabama 348 Gordon Palmer Hall Box 870348 Tuscaloosa, AL 35487-0348 Phone: (205) 348-4431 Fax: (205) 348-8648 August 1,

### C: LEVEL 800 {MASTERS OF ECONOMICS( ECONOMETRICS)}

C: LEVEL 800 {MASTERS OF ECONOMICS( ECONOMETRICS)} 1. EES 800: Econometrics I Simple linear regression and correlation analysis. Specification and estimation of a regression model. Interpretation of regression

### Linear Threshold Units

Linear Threshold Units w x hx (... w n x n w We assume that each feature x j and each weight w j is a real number (we will relax this later) We will study three different algorithms for learning linear

### Survival Analysis of Dental Implants. Abstracts

Survival Analysis of Dental Implants Andrew Kai-Ming Kwan 1,4, Dr. Fu Lee Wang 2, and Dr. Tak-Kun Chow 3 1 Census and Statistics Department, Hong Kong, China 2 Caritas Institute of Higher Education, Hong

### Simple Linear Regression Chapter 11

Simple Linear Regression Chapter 11 Rationale Frequently decision-making situations require modeling of relationships among business variables. For instance, the amount of sale of a product may be related

### Factor analysis. Angela Montanari

Factor analysis Angela Montanari 1 Introduction Factor analysis is a statistical model that allows to explain the correlations between a large number of observed correlated variables through a small number

### GLM I An Introduction to Generalized Linear Models

GLM I An Introduction to Generalized Linear Models CAS Ratemaking and Product Management Seminar March 2009 Presented by: Tanya D. Havlicek, Actuarial Assistant 0 ANTITRUST Notice The Casualty Actuarial

### SAS Software to Fit the Generalized Linear Model

SAS Software to Fit the Generalized Linear Model Gordon Johnston, SAS Institute Inc., Cary, NC Abstract In recent years, the class of generalized linear models has gained popularity as a statistical modeling

### Lecture 3: Linear methods for classification

Lecture 3: Linear methods for classification Rafael A. Irizarry and Hector Corrada Bravo February, 2010 Today we describe four specific algorithms useful for classification problems: linear regression,

### INTRODUCTORY STATISTICS

INTRODUCTORY STATISTICS FIFTH EDITION Thomas H. Wonnacott University of Western Ontario Ronald J. Wonnacott University of Western Ontario WILEY JOHN WILEY & SONS New York Chichester Brisbane Toronto Singapore

### Univariate and Multivariate Methods PEARSON. Addison Wesley

Time Series Analysis Univariate and Multivariate Methods SECOND EDITION William W. S. Wei Department of Statistics The Fox School of Business and Management Temple University PEARSON Addison Wesley Boston

### Poisson Models for Count Data

Chapter 4 Poisson Models for Count Data In this chapter we study log-linear models for count data under the assumption of a Poisson error structure. These models have many applications, not only to the

### Simple Linear Regression

Inference for Regression Simple Linear Regression IPS Chapter 10.1 2009 W.H. Freeman and Company Objectives (IPS Chapter 10.1) Simple linear regression Statistical model for linear regression Estimating

### Simple Regression Theory II 2010 Samuel L. Baker

SIMPLE REGRESSION THEORY II 1 Simple Regression Theory II 2010 Samuel L. Baker Assessing how good the regression equation is likely to be Assignment 1A gets into drawing inferences about how close the

### Multivariate Analysis (Slides 13)

Multivariate Analysis (Slides 13) The final topic we consider is Factor Analysis. A Factor Analysis is a mathematical approach for attempting to explain the correlation between a large set of variables

### Principle Component Analysis and Partial Least Squares: Two Dimension Reduction Techniques for Regression

Principle Component Analysis and Partial Least Squares: Two Dimension Reduction Techniques for Regression Saikat Maitra and Jun Yan Abstract: Dimension reduction is one of the major tasks for multivariate

### Basic Statistics and Data Analysis for Health Researchers from Foreign Countries

Basic Statistics and Data Analysis for Health Researchers from Foreign Countries Volkert Siersma siersma@sund.ku.dk The Research Unit for General Practice in Copenhagen Dias 1 Content Quantifying association

### X X X a) perfect linear correlation b) no correlation c) positive correlation (r = 1) (r = 0) (0 < r < 1)

CORRELATION AND REGRESSION / 47 CHAPTER EIGHT CORRELATION AND REGRESSION Correlation and regression are statistical methods that are commonly used in the medical literature to compare two or more variables.

Better Hedge Ratios for Spread Trading Paul Teetor November 2011 1 Summary This note discusses the calculation of hedge ratios for spread trading. It suggests that using total least squares (TLS) is superior

### where b is the slope of the line and a is the intercept i.e. where the line cuts the y axis.

Least Squares Introduction We have mentioned that one should not always conclude that because two variables are correlated that one variable is causing the other to behave a certain way. However, sometimes

### PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 4: LINEAR MODELS FOR CLASSIFICATION

PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 4: LINEAR MODELS FOR CLASSIFICATION Introduction In the previous chapter, we explored a class of regression models having particularly simple analytical

### Factor Analysis. Chapter 420. Introduction

Chapter 420 Introduction (FA) is an exploratory technique applied to a set of observed variables that seeks to find underlying factors (subsets of variables) from which the observed variables were generated.

### Introduction to Matrix Algebra

Psychology 7291: Multivariate Statistics (Carey) 8/27/98 Matrix Algebra - 1 Introduction to Matrix Algebra Definitions: A matrix is a collection of numbers ordered by rows and columns. It is customary

### AUTOMATION OF ENERGY DEMAND FORECASTING. Sanzad Siddique, B.S.

AUTOMATION OF ENERGY DEMAND FORECASTING by Sanzad Siddique, B.S. A Thesis submitted to the Faculty of the Graduate School, Marquette University, in Partial Fulfillment of the Requirements for the Degree

### Design and Analysis of Ecological Data Conceptual Foundations: Ec o lo g ic al Data

Design and Analysis of Ecological Data Conceptual Foundations: Ec o lo g ic al Data 1. Purpose of data collection...................................................... 2 2. Samples and populations.......................................................

### Institute of Actuaries of India Subject CT3 Probability and Mathematical Statistics

Institute of Actuaries of India Subject CT3 Probability and Mathematical Statistics For 2015 Examinations Aim The aim of the Probability and Mathematical Statistics subject is to provide a grounding in

### Business Statistics. Successful completion of Introductory and/or Intermediate Algebra courses is recommended before taking Business Statistics.

Business Course Text Bowerman, Bruce L., Richard T. O'Connell, J. B. Orris, and Dawn C. Porter. Essentials of Business, 2nd edition, McGraw-Hill/Irwin, 2008, ISBN: 978-0-07-331988-9. Required Computing

### LOGISTIC REGRESSION ANALYSIS

LOGISTIC REGRESSION ANALYSIS C. Mitchell Dayton Department of Measurement, Statistics & Evaluation Room 1230D Benjamin Building University of Maryland September 1992 1. Introduction and Model Logistic

### Statistical Machine Learning

Statistical Machine Learning UoC Stats 37700, Winter quarter Lecture 4: classical linear and quadratic discriminants. 1 / 25 Linear separation For two classes in R d : simple idea: separate the classes

### An analysis method for a quantitative outcome and two categorical explanatory variables.

Chapter 11 Two-Way ANOVA An analysis method for a quantitative outcome and two categorical explanatory variables. If an experiment has a quantitative outcome and two categorical explanatory variables that

### Analysis of Financial Time Series with EViews

Analysis of Financial Time Series with EViews Enrico Foscolo Contents 1 Asset Returns 2 1.1 Empirical Properties of Returns................. 2 2 Heteroskedasticity and Autocorrelation 4 2.1 Testing for

### 11/20/2014. Correlational research is used to describe the relationship between two or more naturally occurring variables.

Correlational research is used to describe the relationship between two or more naturally occurring variables. Is age related to political conservativism? Are highly extraverted people less afraid of rejection

Lecture 16: Generalized Additive Models Regression III: Advanced Methods Bill Jacoby Michigan State University http://polisci.msu.edu/jacoby/icpsr/regress3 Goals of the Lecture Introduce Additive Models

### BayesX - Software for Bayesian Inference in Structured Additive Regression

BayesX - Software for Bayesian Inference in Structured Additive Regression Thomas Kneib Faculty of Mathematics and Economics, University of Ulm Department of Statistics, Ludwig-Maximilians-University Munich

### CHAPTER 8 FACTOR EXTRACTION BY MATRIX FACTORING TECHNIQUES. From Exploratory Factor Analysis Ledyard R Tucker and Robert C.

CHAPTER 8 FACTOR EXTRACTION BY MATRIX FACTORING TECHNIQUES From Exploratory Factor Analysis Ledyard R Tucker and Robert C MacCallum 1997 180 CHAPTER 8 FACTOR EXTRACTION BY MATRIX FACTORING TECHNIQUES In

### CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA

We Can Early Learning Curriculum PreK Grades 8 12 INSIDE ALGEBRA, GRADES 8 12 CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA April 2016 www.voyagersopris.com Mathematical

### Interpretation of Somers D under four simple models

Interpretation of Somers D under four simple models Roger B. Newson 03 September, 04 Introduction Somers D is an ordinal measure of association introduced by Somers (96)[9]. It can be defined in terms

### Chapter 6: Multivariate Cointegration Analysis

Chapter 6: Multivariate Cointegration Analysis 1 Contents: Lehrstuhl für Department Empirische of Wirtschaftsforschung Empirical Research and und Econometrics Ökonometrie VI. Multivariate Cointegration

### Survival Analysis of Left Truncated Income Protection Insurance Data. [March 29, 2012]

Survival Analysis of Left Truncated Income Protection Insurance Data [March 29, 2012] 1 Qing Liu 2 David Pitt 3 Yan Wang 4 Xueyuan Wu Abstract One of the main characteristics of Income Protection Insurance

### Multivariate Logistic Regression

1 Multivariate Logistic Regression As in univariate logistic regression, let π(x) represent the probability of an event that depends on p covariates or independent variables. Then, using an inv.logit formulation

### CHAPTER 12 EXAMPLES: MONTE CARLO SIMULATION STUDIES

Examples: Monte Carlo Simulation Studies CHAPTER 12 EXAMPLES: MONTE CARLO SIMULATION STUDIES Monte Carlo simulation studies are often used for methodological investigations of the performance of statistical

### 1 Example of Time Series Analysis by SSA 1

1 Example of Time Series Analysis by SSA 1 Let us illustrate the 'Caterpillar'-SSA technique [1] by the example of time series analysis. Consider the time series FORT (monthly volumes of fortied wine sales

### Cheng Soon Ong & Christfried Webers. Canberra February June 2016

c Cheng Soon Ong & Christfried Webers Research Group and College of Engineering and Computer Science Canberra February June (Many figures from C. M. Bishop, "Pattern Recognition and ") 1of 31 c Part I

### Normality Testing in Excel

Normality Testing in Excel By Mark Harmon Copyright 2011 Mark Harmon No part of this publication may be reproduced or distributed without the express permission of the author. mark@excelmasterseries.com

Ronald Christensen Advanced Linear Modeling Multivariate, Time Series, and Spatial Data; Nonparametric Regression and Response Surface Maximization Second Edition Springer Preface to the Second Edition

### Recall this chart that showed how most of our course would be organized:

Chapter 4 One-Way ANOVA Recall this chart that showed how most of our course would be organized: Explanatory Variable(s) Response Variable Methods Categorical Categorical Contingency Tables Categorical

### Statistical Models in R

Statistical Models in R Some Examples Steven Buechler Department of Mathematics 276B Hurley Hall; 1-6233 Fall, 2007 Outline Statistical Models Structure of models in R Model Assessment (Part IA) Anova

### Sales forecasting # 2

Sales forecasting # 2 Arthur Charpentier arthur.charpentier@univ-rennes1.fr 1 Agenda Qualitative and quantitative methods, a very general introduction Series decomposition Short versus long term forecasting

### DEPARTMENT OF PSYCHOLOGY UNIVERSITY OF LANCASTER MSC IN PSYCHOLOGICAL RESEARCH METHODS ANALYSING AND INTERPRETING DATA 2 PART 1 WEEK 9

DEPARTMENT OF PSYCHOLOGY UNIVERSITY OF LANCASTER MSC IN PSYCHOLOGICAL RESEARCH METHODS ANALYSING AND INTERPRETING DATA 2 PART 1 WEEK 9 Analysis of covariance and multiple regression So far in this course,

T O P I C 1 2 Techniques and tools for data analysis Preview Introduction In chapter 3 of Statistics In A Day different combinations of numbers and types of variables are presented. We go through these

### Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model

Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model 1 September 004 A. Introduction and assumptions The classical normal linear regression model can be written

### Exercise 1.12 (Pg. 22-23)

Individuals: The objects that are described by a set of data. They may be people, animals, things, etc. (Also referred to as Cases or Records) Variables: The characteristics recorded about each individual.