Mutilevel Models: Pooled and Clustered Data

Size: px
Start display at page:

Download "Mutilevel Models: Pooled and Clustered Data"

Transcription

1 Mutilevel Models: Pooled and Clustered Data ICPSR, June 1-5, 2015 Tom Carsey

2 In the Beginning... We start with a simple linear model Where i subscripts individual observations. Y i = β 0 + β 1X 1i + β 2X 2i ε i (1) We assume that observations Y i (conditional on the X s) are independently and identically distributed (iid). In other words,ε i are assumed to be iid. Independent means that each ε i is unrelated/uncorrelated to: other ε i s anything else - most importantly, the X s Identically means that they can be considered drawn from a common probability distribution 2 / 96

3 What Does iid Look Like? If we have iid, we can write: ε i N(0, σ 2 ) Which means distributed normally with a mean=0 and a constant variance = σ 2 Another way to write this is with a variance-covariance matrix for the residuals, as follows: σ εε = 0 σ σ 2 0 (2) σ 2 The main diagonal shows a constant variance. The off diagonals show no correlation among residuals. if we extract σ 2 from the matrix, we are left with σ 2 times an Identity Matrix. 3 / 96

4 If All is Well... If this is a normal model, then we can estimate the parameters via OLS as follows: β = (X X) 1 X Y (3) And we can estimate proper standard errors as follows: VCV (β) = σ 2 (X X) 1 (4) Where ˆσ 2 = ε 2 i (n p) = ε ε (n p) with n=sample size and p=# of parameters in the regression model. Estimates of the parameters will be unbiased and efficient. Estimates of the standard errors will also be correct.... and Life is Good! (5) 4 / 96

5 What if We Violate iid? Violation of the Independently distributed part of iid due to correlation among residuals takes the form of serial, spatial, or cluster correlation. If that is our only problem, it will leave coefficient estimates unbiased, but our standard errors will be wrong. Violation of the Identically distributed part of iid usually takes the form of non-constant variance. If that is our only problem, it will leave coefficient estimates unbiased, but our standard errors will be wrong. Let s look at the math. 5 / 96

6 Violation of iid I presented the formula for the standard errors of a normal regression model as: VCV (β) = σ 2 (X X) 1 (6) However, the formula really is: VAR(β) = (X X ) 1 X εε X (X X ) 1 (7) Assume that εε equals σ 2 times some n n matrix called V. We can write: VAR(β) = (X X ) 1 X σ 2 VX (X X ) 1 = σ 2 (X X ) 1 X VX (X X ) 1 6 / 96

7 Violation of iid (cont.) Carried forward from the previous slide VAR(β) = (X X ) 1 X σ 2 VX (X X ) 1 = σ 2 (X X ) 1 X VX (X X ) 1 If V is an Identity matrix, then the whole thing simplifies down to what we have seen before because X X(X X) 1 = I if V is an Identity matrix. However, if we violate iid, then V will not be an identity matrix. Thus, when we violate iid in the ways shown here, our default formula for estimating standard errors will not be correct. Pooled or clustered data almost certainly violates iid. 7 / 96

8 Standard Heteroscedasticity Standard heteroscedasticity violates identically distributed part of iid, and looks like this: σi εε = 0 σi σi 2 0 (8) σi 2 The major difference now is that σ 2 is subscripted by i because it is no longer a single constant value. 8 / 96

9 Standard Serial Correlation (AR1) Standard first-order serial correlation violates the independently distributed part of iid, and looks like this: 1 ρ ρ 2 ρ 3 εε = σ2 ν ρ 1 ρ ρ 2 1 ρ 2 ρ 2 ρ 1 ρ (9) ρ 3 ρ 2 ρ 1 Note that σ 2 is back to being constant here so no heteroscedasticity to worry about. 9 / 96

10 Pooled/Clustered Data and iid Pooled or clustered data can violate one or both i s of iid simply because of the clustered structure of the data. Remember, regression models (LMs and GLMs alike), assume no structure to the residuals they are supposed to be iid. The clustered nature of the data can leave such structure in the residuals if we do not account for it intentionally. The model changes from: To something like: Y i = β 0 + β 1X 1i + β 2X 2i ε i (10) Y ij = X ij β + e ij (11) with i and j subscripting individuals and clusters, respectively, or Level 1 and Level 2. And where (if nested) e ij = α j + ε ij (12) 10 / 96

11 The Basic Multi-Level Model Multi-level models are written in many ways. For example, we can write Level 1 as follows: Y ij = β 0j + β 1j X 1ij + ε ij (13) And then two Level 2 equations like this: And β 0j = γ 00 + γ 01Z j + µ 0j (14) β 1j = γ 10 + γ 11Z j + µ 1j (15) In multi-level models, we are generally concerned with the potential for a Level-2 variable to affect Y through affecting either the intercept or slope of the Level-1 equation. Note that we could put Z in the first equation directly if we wanted. 11 / 96

12 Expressing the Multi-level model If we do some substitutions from the previous slide, we get: Y ij = γ 00 + γ 10X ij + γ 01Z j + γ 11X ij Z j + µ 1j X ij + µ 0j + ε ij (16) This is just one X and one Z, showing that multi-level models get complex quickly. Notice that the basic form of the multi-level model implies an interaction between X and Z if the slopes operating on X are allowed to vary (either randomly across Z or directly as a function of Z). This does NOT preclude the explicit inclusion of interaction terms, however. What does clustered data mean for iid? 12 / 96

13 The Matrix Reloaded Remember again the formula for standard errors VAR(β) = (X X ) 1 X σ 2 VX (X X ) 1 = σ 2 (X X ) 1 X VX (X X ) 1 Pooled or clustered data can be thought of as sets of Level 1 observations stacked on top if each other by clusters (e.g. Level 2). There there are N observations per cluster and M clusters, then V will be an M M matrix: P V = 0 P P 0 (17) P where each 0 and P is itself an N N submatrix for each cluster. If each P matrix can be written as the same σ 2 times an Identity matrix, we re fine. 13 / 96

14 The Matrix Reloaded (cont.) If each P submatrix does not have the same σ 2 for each cluster (even if it is constant within clusters), then we violate the Identically distributed i again. If each cluster shares something in common about the average level of Y (conditional on X), then each cluster of residuals in each P matrix will be correlated with each other (even if not across clusters). That violates the Independently distributed i. Cluster correlation might look like this 1 ρ ρ ρ P j = ρ 1 ρ ρ ρ ρ 1 ρ (18) ρ ρ ρ 1 Where there is constant correlation within clusters. That correlation could be the same for each cluster, or we could subscript ρ by j to let it vary across clusters. 14 / 96

15 Multilevel Data Classical Multilevel data: observations (i) in groups (j). Can have covariates at the individual or group level. Students in classes Voters in states Events in countries Repeated measures: repeated measures on units leads to clustering within units. Predictors can be available at the measurement (i.e. how you feel today) or unit (i.e. your gender) level. Time series cross sectional data (TSCS): e.g., state-year data (clustered within states and also within years) Inter-cluster correlation, often labeled ρ, measures the degree of clustering: s 2 within s 2 between + s2 within (19) Where sbetween 2 = variance between cluster Where swithin 2 = variance within clusters 15 / 96

16 Some Options for Dealing with Multilevel Data Complete Pooling: a single regression completely ignoring the group information No Pooling: Run a single regression that includes group indicators (e.g. a set of dummy variables) but no group level predictors (what TSCS often calls fixed effects ) Run a different regression for every group Measure context with replicated values artificially deflates standard errors by failing to acknowledge proper sample size at Level 2. Multilevel Models: A flexible compromise between no pooling and complete pooling (equivalent to what TSCS often calls random effects ) Example of shrinkage models Outlying groups contribute some information to parameter estimation, but are shrunk toward the overall mean 16 / 96

17 Another Look at the Model 17 / 96

18 Another Look at the Model (cont.) 18 / 96

19 What is Fixed and What is Random? From the previous slide, all of those gamma parameters are called fixed because they do not vary. They may have uncertainty about them, but they do not vary. From the previous slide, the mu s are random because they represent the stochastic components of the intercept and the slopes on the X s. This is NOT the same as estimating a standard error for those parameters. Most attention for the random components part is devoted to their variances (and possible co-variances). 19 / 96

20 Linear Model Visually 20 / 96

21 Multi-Level, Random Slopes 21 / 96

22 Multi-Level, Random Slopes and Intercepts 22 / 96

23 Reasons to Use Multilevel Models Accounting for individual and group level variation in estimating group level coefficients. Interest may lie in group independent variables, but a regression can t have group level independent variables AND a set of group level dummies. Modeling variation among individual level coefficients. Convenient when we want to model the variation in coefficients across groups Letting coefficients vary randomly across levels is NOT the same as modeling an interaction between two independent variables. However, you can include multiplicative interaction terms (at the same level or across levels) in the model if you want. Estimating coefficients for particular groups. Can get reasonable estimates even for group s with small sample sizes because those estimates borrow strength from the estimates for other groups in the analysis, which would be hard with standard regression 23 / 96

24 Limits of Multilevel Models All the assumptions of a single level model are still there. Plus, each level must meet the basic assumptions of the model at that level. Plus, nothing at one level confounds the model at another level. Importantly, it assumes: That mean unit effects are uncorrelated with the means of Level-1 independent variables or to the actual values of Level-2 variables (bias) The variance of unit effects is constant across units (efficiency) Reduces to complete pooling or no pooling in extreme cases. Generally requires more than 5 groups to make it worth moving beyond no pooling (e.g. just use group dummies if number of groups is less than 5). 24 / 96

25 Basic Concepts: Varying Intercept Models (G&H notation) y i = α j[i] + βx i + ε i All groups have same slope Each group has different intercept Notation: i observations and j groups Common to see the i dropped and the model written α j Y X 25 / 96

26 Basic Concepts: Varying Slope Models y i = α + β j[i] x i + ε i All groups have the same intercept Each group has different slope Usually a very poor model to estimate Y X 26 / 96

27 Basic Concepts: Varying Intercept, Varying Slope Models y i = α j[i] + β j[i] x i + ε i All groups have different slopes Each group has different intercept Provides interactions between X and the group designations Also, easy to extend to group level variables (later) Y X 27 / 96

28 The Core of Multilevel Models The main point of multilevel models is to provide a statistical model for the group level. At minimum, group intercepts are given a common distribution. Additional, group slopes could be given a common distribution. Or slopes and intercepts are both estimated for each group. Or group-level parameters can be modeled as functions of group-level predictors. Again, the point is to give a model to these group-level parameters. 28 / 96

29 Terminology Problems Multilevel varying coefficients (α j or β j ) are often called random effects in reference to the randomness in the probability model of group level coefficients (details to come) Fixed effects are usually defined as varying coefficients that are not themselves modeled (i.e. J 1 group level indicators) However, fixed effects sometimes refer to models where the coefficients do not vary by group (so they are fixed, not random) In other words, sometimes fixed effects refers to models that include a set of dummy variables, but other times fixed effects refer to parameters (βs) that are estimated, but there is only one parameter operating on a given variable. For example, just a single β1 operating on X 1 rather than β1 j for X 1 that varies across j groups. 29 / 96

30 Simulation in Action Simulations are valuable in statistics because they let you define a DGP and then evaluate whether a particular statistical method is good at accurately recovering that DGP from a sample of data. The researcher defines Truth and uses a computer as a laboratory to evaluate how well sample estimates and the methods on which they are based map to that Truth. We ll start with a simple OLS regression Y i = β 0 + β 1X 1i + ε i (20) The DGP has an exogenous X, a deterministic model linking X to Y, and a random stochastic component. How can we represent this in R? 30 / 96

31 DGP in R for OLS set.seed(74392) N < B0 <-.3 B1 <-.5 X <- rnorm(n,0,1) error <- rnorm(n,0,1) Y <- B0 + B1*X + error M1 <- lm(y~x) summary(m1) 31 / 96

32 Produces these results Call: lm(formula = Y ~ X) Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) <2e-16 *** X <2e-16 *** --- Signif. codes: 0?***? 0.001?**? 0.01?*? 0.05?.? 0.1?? 1 Residual standard error: on 998 degrees of freedom Multiple R-squared: , Adjusted R-squared: F-statistic: on 1 and 998 DF, p-value: < 2.2e / 96

33 Results (cont.) The intercept is close to, but not exactly 0.3. The slope s close to, but not exactly 0.5. The following shows that a 95% confidence interval round each does include the True values. > Results <- cbind(confint(m1),c(b0,b1)) > Results 2.5 % 97.5 % (Intercept) X But this is just one cut. Simulations should include lots (often thousands) of repetitions. Let s Look 33 / 96

34 Setting the Parameters for the OLS Simulation reps < Sim.Slopes <- matrix(na,nrow=reps, ncol=1) set.seed(74392) N < B0 <-.3 B1 <-.5 X <- rnorm(n,0,1) 34 / 96

35 Code for the for() loop for(i in 1:reps){ error <- rnorm(n,0,1) Y <- B0 + B1*X + error m1 <- lm(y~x) Sim.Slopes[i] <- coef(m1)[2] } 35 / 96

36 Density Plot for β 1 from Prior Simulation 36 / 96

37 How does OLS Compare When Data is Clustered? Run a simulation several times, each time estimating three models Simple OLS Unit dummy variables Multi-level with random intercepts. Each time will include hundreds of repetitions. (Look at Rcode for illustration) 37 / 96

38 No Clustering; Densities of β 1 38 / 96

39 No Clustering; Coverage Probability fo β 1 39 / 96

40 Results with No Clustering All three, including OLS, appear to be unbiased and efficient. OLS with Fixed Effects (e.g. No Pooling) appears to be less efficient. RCSE fall short on the coverage probability (with a CI of 85 to 91). In short, plain OLS works as well as the other two models; and robust cluster standard error do not perform well. Now, let s add a random unit effect 40 / 96

41 Now let s generate clustered data We ll look at the code in more detail later. Still generates Y as a function of a single X measured at Level 1 True β 0 = 0.3 True β 1 = 0.5 We estimate three models Simple OLS Unit dummy variables Multi-level with random intercepts. We use three scenarios: No clustering, Clustering only, and Clustering correlated with the mean of X. 41 / 96

42 No Clustering, OLS lm(formula = Y ~ X) coef.est coef.se (Intercept) X n = 400, k = 2 residual sd = 0.96, R-Squared = / 96

43 No Clustering, Unit Dummies lm(formula = Y ~ X + factor(c.label) - 1) coef.est coef.se X factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) n = 400, k = 11 residual sd = 0.96, R-Squared = / 96

44 No Clustering, MLM with Random Intercepts lmer(formula = Y ~ X + (1 c.label)) coef.est coef.se (Intercept) X Error terms: Groups Name Std.Dev. c.label (Intercept) 0.00 Residual number of obs: 400, groups: c.label, 10 AIC = , DIC = deviance = / 96

45 Unit-level Coefficients from MLM (Intercept) X / 96

46 Simulation Study, No Unit Effects Simulation study with 500 repetitions True β 0 = 0.3 True β 1 = 0.5 Intercluster correlation (ρ) = 0 Correlation between units and X j = 0 46 / 96

47 Density Plots for β 1, No Unit Effects 47 / 96

48 Coverage Probs for β 1, No Unit Effects 48 / 96

49 Unit Effects, OLS lm(formula = Y ~ X) coef.est coef.se (Intercept) X n = 400, k = 2 residual sd = 0.97, R-Squared = / 96

50 Unit Effects, Unit Dummies lm(formula = Y ~ X + factor(c.label) - 1) coef.est coef.se X factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) n = 400, k = 11 residual sd = 0.68, R-Squared = / 96

51 Unit Effects, MLM lmer(formula = Y ~ X + (1 c.label)) coef.est coef.se (Intercept) X Error terms: Groups Name Std.Dev. c.label (Intercept) 0.74 Residual number of obs: 400, groups: c.label, 10 AIC = 874.3, DIC = 854 deviance = / 96

52 Unit-level Coefficients from MLM (Intercept) X / 96

53 Comparison of FE and MLM Intercepts FE MLM [1,] [2,] [3,] [4,] [5,] [6,] [7,] [8,] [9,] [10,] > var(fe.mlm.intercepts[,1]) [1] > var(fe.mlm.intercepts[,2]) [1] / 96

54 Simulation Study, Unit Effects Simulation study with 500 repetitions True β 0 = 0.3 True β 1 = 0.5 Intercluster correlation (ρ) = 0.5 Correlation between units and X j = 0 54 / 96

55 Density Plots for β 1, Unit Effects 55 / 96

56 Coverage Probs for β 1, Unit Effects 56 / 96

57 Unit Effects Correlated with Mean of X, OLS lm(formula = Y ~ X) coef.est coef.se (Intercept) X n = 400, k = 2 residual sd = 0.93, R-Squared = / 96

58 Unit Effects Correlated with Mean of X, FE lm(formula = Y ~ X + factor(c.label) - 1) coef.est coef.se X factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) factor(c.label) n = 400, k = 11 residual sd = 0.65, R-Squared = / 96

59 Unit Effects Correlated with Mean of X, MLM lmer(formula = Y ~ X + (1 c.label)) coef.est coef.se (Intercept) X Error terms: Groups Name Std.Dev. c.label (Intercept) 0.71 Residual number of obs: 400, groups: c.label, 10 AIC = 835.7, DIC = deviance = / 96

60 Simulation Study, Unit Effects Corr. with X j Simulation study with 500 repetitions True β 0 = 0.3 True β 1 = 0.5 Intercluster correlation (ρ) = 0.5 Correlation between units and X j = / 96

61 Density Plots for β 1, Unit Effects Corr With X 61 / 96

62 Challengers in State Legislative Races (Hogan 2008, AJPS) Dependent variables: challenged = challenger emerged or not (0,1) challe a = challenger spending (in thousands of dollars I believe) Main IV: partisan. Measure of extremity of incumbent s voting record Level 2 IV: legislat. Legislative Professionalism Observations clustered in states 62 / 96

63 Complete Pooling Complete pooling: y i = α + βx i + ε i m1 <- lm(challe_a ~ partisan, data = hogan) display(m1) # Could also do summary(m1) lm(formula = challe_a ~ partisan, data = hogan) coef.est coef.se (Intercept) partisan n = 1280, k = 2 residual sd = 64.66, R-Squared = / 96

64 No pooling: y i = α j[i] + βx i + ε i No Pooling m2 <- lm(challe_a ~ -1 + partisan + factor(state), data = hogan) display(m2) lm(formula = challe_a ~ -1 + partisan + factor(state), data = hogan) coef.est coef.se partisan factor(state)ak factor(state)ca factor(state)fl factor(state)id factor(state)il factor(state)ky factor(state)me factor(state)mi factor(state)mn factor(state)oh factor(state)or factor(state)ut n = 1280, k = 13 residual sd = 60.36, R-Squared = / 96

65 Separate Models states <- unique(hogan$state) results <- list() coef.sm <- numeric(length(states)) se.sm <- numeric(length(states)) for(i in 1:length(states)){ results[[i]] <- lm(challe_a ~ partisan, data = subset(hogan, state == paste(states[i]))) coef.sm[i] <- results[[i]]$coef[2] se.sm[i] <- sqrt(vcov(results[[i]])[2, 2]) } 65 / 96

66 Complete Pooling/No Pooling/Separate Models The coefficient on partisan: Complete Pooling No Pooling Separate Models β partisan ^ ME AK UT ID MN KY OR MI IL OH FL CA State 66 / 96

67 Basic Multilevel Analysis y i N (α j[i] + βx i, σ 2 y ), for i = 1,..., n This looks kind of like the no pooling model In no pooling, α j s are set to the standard OLS estimates, which correspond to the fitted intercept shifts for each state Estimates of intercept shifts could be way off if sample size in a state is small Also looks kind of like the complete pooling model In complete pooling, α j s are given a hard constraint (all fixed at common α) Probably not a realistic constraint if we think there is a group effect in the data 67 / 96

68 Basic Multilevel Analysis Multilevel models have a soft constraint applied to the α j s: they are assigned a probability distribution α j N (µ α, σ 2 α), for j = 1,..., J with their mean µ α and the standard deviation σ α estimated from the data Result: a weighted average between the complete and no pooling models This has the effect of pulling estimates of α j towards the mean µ α, but not all the way Thus, we have partial pooling As σ α, the soft constraint does nothing and there is no pooling As σ α 0, they pull the estimates all the way to a single common mean: complete pooling 68 / 96

69 Varying Intercept Model m4 <- lmer(challe_a ~ partisan + (1 state), data = hogan) display(m4) lmer(formula = challe_a ~ partisan + (1 state), data = hogan) coef.est coef.se (Intercept) partisan Error terms: Groups Name Std.Dev. state (Intercept) Residual number of obs: 1280, groups: state, 12 AIC = 14158, DIC = deviance = The number 1 in the parentheses tells the lmer() function that you want the intercept to vary by state. 69 / 96

70 Estimated Coefficients To see the estimated model within each state > round(coef(m4)$state, digits = 3) (Intercept) partisan AK CA FL ID IL KY ME MI MN OH OR UT In Alaska the estimated line is y = (partisan) Slopes are all identical because only the intercepts were allowed to vary 70 / 96

71 [,1] [,2] factor(state)ak factor(state)ca factor(state)fl factor(state)id factor(state)il factor(state)ky factor(state)me factor(state)mi factor(state)mn factor(state)oh factor(state)or factor(state)ut > var(np.mlm.intercepts[,1]) [1] > var(np.mlm.intercepts[,2]) [1] Compare Unit Effects Estimates 71 / 96

72 Fixed and Random Effects Alternatively, we can look separately at the estimated model averaging over the states (fixed effects) and the state-level errors (random effects) > round(fixef(m4), digits = 3) (Intercept) partisan In an average state the estimated line is y = (partisan) 72 / 96

73 Fixed and Random Effects The state-level errors > round(ranef(m4)$state, digits = 3) (Intercept) AK CA FL ID IL KY ME MI MN OH OR UT These tell us how much the intercept shifts up or down in particular states. Example: For Alaska, the intercept is above average 73 / 96

74 Uncertainties in the Estimated Coefficients The arm package has functions to compute the standard errors from a lmer() object > round(se.fixef(m4), digits = 3) (Intercept) partisan > data.frame(se.ranef = round(se.ranef(m4)$state, digits = 3), state.n = as.vector( X.Intercept. state.n AK CA FL ID IL KY ME MI MN OH OR UT State intercept standard errors differ according to the sample size in each state 74 / 96

75 Complete Pooling, No Pooling, and Multilevel Model 75 / 96

76 Complete Pooling, No Pooling, and Multilevel Model What do we see in the previous figure? The intercept and slopes are identical for every state with complete pooling The intercepts vary for no pooling (dummy variables) but the slopes are the same. The intercepts vary for the multi-level model, but the black lines are all a bit closer to the red one than are the blue lines. Still, the slopes are identical. NOTE: the figure set the limits on the Y and X axes to be the same to facilitate comparison, but some actual data points don t appear for a few states as a result. 76 / 96

77 Comparing the Intercepts 77 / 96

78 Formulating/Reformulating the Varying Intercept Model We have just seen the varying intercept model can be written as y i = α j[i] + β 1X i1 + ε i Or, in matrix notation y i = α j[i] + X i β + ε i where X includes all independent variables but not the constant X can even include group-level variables 78 / 96

79 Formulating/Reformulating the Varying Intercept Model The second level of the model is α j N (µ α, σα) 2 Which can also be written as α j = µ α + η j, with η j N (0, σα) 2 where the η j are group level errors 79 / 96

80 Group-Level Predictors Let s add a state-level predictor, legislative professionalism We use the formulation y i N (α j[i] + βx i, σ 2 y ), α j N (γ 0 + γ 1u j, σ 2 α), for i = 1,..., n for j = 1,..., J where x i is the variable partisan and u j is legislative professionalism (legislat) 80 / 96

81 Group-Level Predictors m5 <- lmer(challe_a ~ partisan + legislat + (1 state), data = hogan) display(m5) lmer(formula = challe_a ~ partisan + legislat + (1 state), data = hogan) coef.est coef.se (Intercept) partisan legislat Error terms: Groups Name Std.Dev. state (Intercept) Residual number of obs: 1280, groups: state, 12 AIC = , DIC = deviance = / 96

82 Coefficient Results > round(coef(m5)$state, digits = 3) (Intercept) partisan legislat AK CA FL ID IL KY ME MI MN OH OR UT / 96

83 Intercepts as a Function of Leg. Prof. m5 Estimated state intercepts plotted against legislative professionalism and the state-level regression line α j = γ 0 + γ 1u j 83 / 96

84 Varying Intercepts and Varying Slopes Next step: allow more than one coefficient to vary by group Let s start simple by (temporarily) dropping the state-level predictor The model is y i N (α j[i] + β j[i] x i, σ 2 y ), for i = 1,..., n ( ) (( ) ( ) ) α j µ α σ 2 N, α ρσ ασ β, for j = 1,..., J β j µ b ρσ ασ β which allows variation in both the α j s and the β j s, as well as a between-group correlation parameter ρ σ 2 β 84 / 96

85 Fitting in R > m6 <- lmer(challe_a ~ partisan + (1 + partisan state), data = hogan) > display(m6) lmer(formula = challe_a ~ partisan + (1 + partisan state), data = hogan) coef.est coef.se (Intercept) partisan Error terms: Groups Name Std.Dev. Corr state (Intercept) partisan Residual number of obs: 1280, groups: state, 12 AIC = 14161, DIC = deviance = The unexplained within-state variation has an estimated SD of ˆσ y = The estimated SD of the state intercepts is ˆσ α = The estimated SD of the state slopes is 2.69 The intercepts and slopes correlate at AIC increased 85 / 96

86 Intercepts and Slopes by State > round(coef(m6)$state, digits = 3) (Intercept) partisan AK CA FL ID IL KY ME MI MN OH OR UT / 96

87 Including Group Level Predictors We can expand the basic model by including group level predictors ( ) (( ) α j γ α 0 + γ α ( ) 1 u ) j σ 2 N β j γ β 0 + γβ 1 u, α ρσ ασ β j ρσ ασ β σβ 2, for j = 1,..., J 87 / 96

88 Fitting in R m7 <- lmer(challe_a ~ partisan + legislat + (1 + partisan state), data = hogan) display(m7) lmer(formula = challe_a ~ partisan + legislat + (1 + partisan state), data = hogan) coef.est coef.se (Intercept) partisan legislat Error terms: Groups Name Std.Dev. Corr state (Intercept) partisan Residual number of obs: 1280, groups: state, 12 AIC = , DIC = deviance = / 96

89 Slope and Intercept Estimates by State > round(coef(m7)$state, digits = 3) (Intercept) partisan legislat AK CA FL ID IL KY ME MI MN OH OR UT / 96

90 Slopes and Intercepts, Deviated from State Means > round(ranef(m7)$state, digits = 3) (Intercept) partisan AK CA FL ID IL KY ME MI MN OH OR UT / 96

91 Intercepts as a Function of Leg. Prof. m7 91 / 96

92 Slopes on X as a Function of Leg. Prof. m7 92 / 96

93 State intercepts and state slopes 93 / 96

94 Some Practical Questions How many groups? When J is small (e.g. less than 5), it is difficult to estimate between-group variation Result is that multilevel models add little beyond standard no pooling models Basic problem: when σ α can t be estimated well, it tends to be overestimated, and so the partially pooled estimates are close to no pooling However, multilevel should not do worse than no pooling 94 / 96

95 Some Practical Questions One or two groups With only one or two groups, MLM reduces to standard regression Typically, in this situation you would would run a standard regression with an indicator (i.e. an indicator for gender rather than a multilevel model with male and female groups) 95 / 96

96 Some Practical Questions How many observations per group? Even two observations per group is enough to fit a MLM Technically, acceptable to have only one observation in a group Groups with small n will have imprecisely estimated coefficients, but may still contain useful information 96 / 96

Introduction and Background to Multilevel Analysis

Introduction and Background to Multilevel Analysis Introduction and Background to Multilevel Analysis Dr. J. Kyle Roberts Southern Methodist University Simmons School of Education and Human Development Department of Teaching and Learning Background and

More information

36-463/663: Hierarchical Linear Models

36-463/663: Hierarchical Linear Models 36-463/663: Hierarchical Linear Models Lmer model selection and residuals Brian Junker 132E Baker Hall brian@stat.cmu.edu 1 Outline The London Schools Data (again!) A nice random-intercepts, random-slopes

More information

22s:152 Applied Linear Regression

22s:152 Applied Linear Regression 22s:152 Applied Linear Regression Chapter 7: Dummy Variable Regression So far, we ve only considered quantitative variables in our models. We can integrate categorical predictors by constructing artificial

More information

Multilevel linear models: the basics

Multilevel linear models: the basics CHAPTER 12 Multilevel linear models: the basics Multilevel modeling can be thought of in two equivalent ways: We can think of a generalization of linear regression, where intercepts, and possibly slopes,

More information

Introduction to Within-Person Analysis and RM ANOVA

Introduction to Within-Person Analysis and RM ANOVA Introduction to Within-Person Analysis and RM ANOVA Today s Class: From between-person to within-person ANOVAs for longitudinal data Variance model comparisons using 2 LL CLP 944: Lecture 3 1 The Two Sides

More information

36-309/749 Experimental Design for Behavioral and Social Sciences. Dec 1, 2015 Lecture 11: Mixed Models (HLMs)

36-309/749 Experimental Design for Behavioral and Social Sciences. Dec 1, 2015 Lecture 11: Mixed Models (HLMs) 36-309/749 Experimental Design for Behavioral and Social Sciences Dec 1, 2015 Lecture 11: Mixed Models (HLMs) Independent Errors Assumption An error is the deviation of an individual observed outcome (DV)

More information

Regression, Part I. - In correlation, it would be irrelevant if we changed the axes on our graph.

Regression, Part I. - In correlation, it would be irrelevant if we changed the axes on our graph. Regression, Part I I. Difference from correlation. II. Basic idea: A) Correlation describes the relationship between two variables, where neither is independent or a predictor. - In correlation, it would

More information

Statistical Methods III Statistics 212. Problem Set 2 - Answer Key

Statistical Methods III Statistics 212. Problem Set 2 - Answer Key Statistical Methods III Statistics 212 Problem Set 2 - Answer Key 1. (Analysis to be turned in and discussed on Tuesday, April 24th) The data for this problem are taken from long-term followup of 1423

More information

STAT 3022 Spring 2007

STAT 3022 Spring 2007 Simple Linear Regression Example These commands reproduce what we did in class. You should enter these in R and see what they do. Start by typing > set.seed(42) to reset the random number generator so

More information

An Introduction to Multilevel Models. PSYC 943 (930): Fundamentals of Multivariate Modeling Lecture 25: December 7, 2012

An Introduction to Multilevel Models. PSYC 943 (930): Fundamentals of Multivariate Modeling Lecture 25: December 7, 2012 An Introduction to Multilevel Models PSYC 943 (930): Fundamentals of Multivariate Modeling Lecture 25: December 7, 2012 Today s Class Concepts in Longitudinal Modeling Between-Person vs. +Within-Person

More information

GOV 2001/ 1002/ E-200 Section 7 Zero-Inflated models and Intro to Multilevel Modeling 1

GOV 2001/ 1002/ E-200 Section 7 Zero-Inflated models and Intro to Multilevel Modeling 1 GOV 2001/ 1002/ E-200 Section 7 Zero-Inflated models and Intro to Multilevel Modeling 1 Anton Strezhnev Harvard University March 23, 2016 1 These section notes are heavily indebted to past Gov 2001 TFs

More information

A Re-Introduction to General Linear Models (GLM)

A Re-Introduction to General Linear Models (GLM) A Re-Introduction to General Linear Models (GLM) Today s Class: You do know the GLM Estimation (where the numbers in the output come from): From least squares to restricted maximum likelihood (REML) Reviewing

More information

Lecture 1 Intro to Spatial and Temporal Data

Lecture 1 Intro to Spatial and Temporal Data Lecture 1 Intro to Spatial and Temporal Data Dennis Sun Stanford University Stats 253 June 22, 2015 1 What is Spatial and Temporal Data? 2 Trend Modeling 3 Omitted Variables 4 Overview of this Class 1

More information

MS&E 226: Small Data

MS&E 226: Small Data MS&E 226: Small Data Lecture 15: Examples of hypothesis tests (v5) Ramesh Johari ramesh.johari@stanford.edu 1 / 32 The recipe 2 / 32 The hypothesis testing recipe In this lecture we repeatedly apply the

More information

Statistics and Quantitative Analysis U4320. Segment 10 Prof. Sharyn O Halloran

Statistics and Quantitative Analysis U4320. Segment 10 Prof. Sharyn O Halloran Statistics and Quantitative Analysis U4320 Segment 10 Prof. Sharyn O Halloran Key Points 1. Review Univariate Regression Model 2. Introduce Multivariate Regression Model Assumptions Estimation Hypothesis

More information

Categorical Predictor Variables

Categorical Predictor Variables Categorical Predictor Variables We often wish to use categorical (or qualitative) variables as covariates in a regression model. For binary variables (taking on only 2 values, e.g. sex), it is relatively

More information

Regression and the 2-Sample t

Regression and the 2-Sample t Regression and the 2-Sample t James H. Steiger Department of Psychology and Human Development Vanderbilt University James H. Steiger (Vanderbilt University) Regression and the 2-Sample t 1 / 44 Regression

More information

Ron Heck, Fall Week 3: Notes Building a Two-Level Model

Ron Heck, Fall Week 3: Notes Building a Two-Level Model Ron Heck, Fall 2011 1 EDEP 768E: Seminar on Multilevel Modeling rev. 9/6/2011@11:27pm Week 3: Notes Building a Two-Level Model We will build a model to explain student math achievement using student-level

More information

Linear Regression. In this lecture we will study a particular type of regression model: the linear regression model

Linear Regression. In this lecture we will study a particular type of regression model: the linear regression model 1 Linear Regression 2 Linear Regression In this lecture we will study a particular type of regression model: the linear regression model We will first consider the case of the model with one predictor

More information

Coping with Additional Sources of Variation: ANCOVA and Random Effects

Coping with Additional Sources of Variation: ANCOVA and Random Effects Coping with Additional Sources of Variation: ANCOVA and Random Effects 1/49 More Noise in Experiments & Observations Your fixed coefficients are not always so fixed Continuous variation between samples

More information

Additional Notes: Investigating a Random Slope. When we have fixed level-1 predictors at level 2 we show them like this:

Additional Notes: Investigating a Random Slope. When we have fixed level-1 predictors at level 2 we show them like this: Ron Heck, Summer 01 Seminars 1 Multilevel Regression Models and Their Applications Seminar Additional Notes: Investigating a Random Slope We can begin with Model 3 and add a Random slope parameter. If

More information

Final Exam. 1. Definitions: Briefly Define each of the following terms as they relate to the material covered in class.

Final Exam. 1. Definitions: Briefly Define each of the following terms as they relate to the material covered in class. Name Answer Key Economics 170 Spring 2003 Honor pledge: I have neither given nor received aid on this exam including the preparation of my one page formula list and the preparation of the Stata assignment

More information

For more information about how to cite these materials visit

For more information about how to cite these materials visit Author(s): Kerby Shedden, Ph.D., 2010 License: Unless otherwise noted, this material is made available under the terms of the Creative Commons Attribution Share Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/

More information

Variance. Standard deviation VAR = = value. Unbiased SD = SD = 10/23/2011. Functional Connectivity Correlation and Regression.

Variance. Standard deviation VAR = = value. Unbiased SD = SD = 10/23/2011. Functional Connectivity Correlation and Regression. 10/3/011 Functional Connectivity Correlation and Regression Variance VAR = Standard deviation Standard deviation SD = Unbiased SD = 1 10/3/011 Standard error Confidence interval SE = CI = = t value for

More information

Simple, Marginal, and Interaction Effects in General Linear Models

Simple, Marginal, and Interaction Effects in General Linear Models Simple, Marginal, and Interaction Effects in General Linear Models PRE 905: Multivariate Analysis Lecture 3 Today s Class Centering and Coding Predictors Interpreting Parameters in the Model for the Means

More information

Regression: Main Ideas Setting: Quantitative outcome with a quantitative explanatory variable. Example, cont.

Regression: Main Ideas Setting: Quantitative outcome with a quantitative explanatory variable. Example, cont. TCELL 9/4/205 36-309/749 Experimental Design for Behavioral and Social Sciences Simple Regression Example Male black wheatear birds carry stones to the nest as a form of sexual display. Soler et al. wanted

More information

Introduction to Linear Regression

Introduction to Linear Regression Introduction to Linear Regression James H. Steiger Department of Psychology and Human Development Vanderbilt University James H. Steiger (Vanderbilt University) Introduction to Linear Regression 1 / 46

More information

MS&E 226: Small Data

MS&E 226: Small Data MS&E 226: Small Data Lecture 12: Frequentist properties of estimators (v4) Ramesh Johari ramesh.johari@stanford.edu 1 / 39 Frequentist inference 2 / 39 Thinking like a frequentist Suppose that for some

More information

Introduction and Single Predictor Regression. Correlation

Introduction and Single Predictor Regression. Correlation Introduction and Single Predictor Regression Dr. J. Kyle Roberts Southern Methodist University Simmons School of Education and Human Development Department of Teaching and Learning Correlation A correlation

More information

1 The Classic Bivariate Least Squares Model

1 The Classic Bivariate Least Squares Model Review of Bivariate Linear Regression Contents 1 The Classic Bivariate Least Squares Model 1 1.1 The Setup............................... 1 1.2 An Example Predicting Kids IQ................. 1 2 Evaluating

More information

General Linear Model (Chapter 4)

General Linear Model (Chapter 4) General Linear Model (Chapter 4) Outcome variable is considered continuous Simple linear regression Scatterplots OLS is BLUE under basic assumptions MSE estimates residual variance testing regression coefficients

More information

Lecture 4 Multiple linear regression

Lecture 4 Multiple linear regression Lecture 4 Multiple linear regression BIOST 515 January 15, 2004 Outline 1 Motivation for the multiple regression model Multiple regression in matrix notation Least squares estimation of model parameters

More information

An overview of applied econometrics

An overview of applied econometrics An overview of applied econometrics Jo Thori Lind September 4, 2011 1 Introduction This note is intended as a brief overview of what is necessary to read and understand journal articles with empirical

More information

Chapter 1 Statistical Inference

Chapter 1 Statistical Inference Chapter 1 Statistical Inference causal inference To infer causality, you need a randomized experiment (or a huge observational study and lots of outside information). inference to populations Generalizations

More information

36-309/749 Experimental Design for Behavioral and Social Sciences. Sep. 22, 2015 Lecture 4: Linear Regression

36-309/749 Experimental Design for Behavioral and Social Sciences. Sep. 22, 2015 Lecture 4: Linear Regression 36-309/749 Experimental Design for Behavioral and Social Sciences Sep. 22, 2015 Lecture 4: Linear Regression TCELL Simple Regression Example Male black wheatear birds carry stones to the nest as a form

More information

Gov 2000: 9. Regression with Two Independent Variables

Gov 2000: 9. Regression with Two Independent Variables Gov 2000: 9. Regression with Two Independent Variables Matthew Blackwell Harvard University mblackwell@gov.harvard.edu Where are we? Where are we going? Last week: we learned about how to calculate a simple

More information

MATH 644: Regression Analysis Methods

MATH 644: Regression Analysis Methods MATH 644: Regression Analysis Methods FINAL EXAM Fall, 2012 INSTRUCTIONS TO STUDENTS: 1. This test contains SIX questions. It comprises ELEVEN printed pages. 2. Answer ALL questions for a total of 100

More information

36-463/663: Multilevel & Hierarchical Models

36-463/663: Multilevel & Hierarchical Models 36-463/663: Multilevel & Hierarchical Models (P)review: in-class midterm Brian Junker 132E Baker Hall brian@stat.cmu.edu 1 In-class midterm Closed book, closed notes, closed electronics (otherwise I have

More information

Statistical Distribution Assumptions of General Linear Models

Statistical Distribution Assumptions of General Linear Models Statistical Distribution Assumptions of General Linear Models Applied Multilevel Models for Cross Sectional Data Lecture 4 ICPSR Summer Workshop University of Colorado Boulder Lecture 4: Statistical Distributions

More information

An Introduction to Mplus and Path Analysis

An Introduction to Mplus and Path Analysis An Introduction to Mplus and Path Analysis PSYC 943: Fundamentals of Multivariate Modeling Lecture 10: October 30, 2013 PSYC 943: Lecture 10 Today s Lecture Path analysis starting with multivariate regression

More information

Gov 2000: 13. Panel Data and Clustering

Gov 2000: 13. Panel Data and Clustering Gov 2000: 13. Panel Data and Clustering Matthew Blackwell Harvard University mblackwell@gov.harvard.edu November 28, 2016 Where are we? Where are we going? Up until now: the linear regression model, its

More information

An Introduction to Path Analysis

An Introduction to Path Analysis An Introduction to Path Analysis PRE 905: Multivariate Analysis Lecture 10: April 15, 2014 PRE 905: Lecture 10 Path Analysis Today s Lecture Path analysis starting with multivariate regression then arriving

More information

Review of CLDP 944: Multilevel Models for Longitudinal Data

Review of CLDP 944: Multilevel Models for Longitudinal Data Review of CLDP 944: Multilevel Models for Longitudinal Data Topics: Review of general MLM concepts and terminology Model comparisons and significance testing Fixed and random effects of time Significance

More information

Hypothesis testing I. - In particular, we are talking about statistical hypotheses. [get everyone s finger length!] n =

Hypothesis testing I. - In particular, we are talking about statistical hypotheses. [get everyone s finger length!] n = Hypothesis testing I I. What is hypothesis testing? [Note we re temporarily bouncing around in the book a lot! Things will settle down again in a week or so] - Exactly what it says. We develop a hypothesis,

More information

Business Statistics. Lecture 10: Course Review

Business Statistics. Lecture 10: Course Review Business Statistics Lecture 10: Course Review 1 Descriptive Statistics for Continuous Data Numerical Summaries Location: mean, median Spread or variability: variance, standard deviation, range, percentiles,

More information

Introducing Generalized Linear Models: Logistic Regression

Introducing Generalized Linear Models: Logistic Regression Ron Heck, Summer 2012 Seminars 1 Multilevel Regression Models and Their Applications Seminar Introducing Generalized Linear Models: Logistic Regression The generalized linear model (GLM) represents and

More information

UNIVERSITY OF TORONTO Faculty of Arts and Science

UNIVERSITY OF TORONTO Faculty of Arts and Science UNIVERSITY OF TORONTO Faculty of Arts and Science December 2013 Final Examination STA442H1F/2101HF Methods of Applied Statistics Jerry Brunner Duration - 3 hours Aids: Calculator Model(s): Any calculator

More information

Course Introduction and Overview Descriptive Statistics Conceptualizations of Variance Review of the General Linear Model

Course Introduction and Overview Descriptive Statistics Conceptualizations of Variance Review of the General Linear Model Course Introduction and Overview Descriptive Statistics Conceptualizations of Variance Review of the General Linear Model EPSY 905: Multivariate Analysis Lecture 1 20 January 2016 EPSY 905: Lecture 1 -

More information

Ron Heck, Fall Week 8: Introducing Generalized Linear Models: Logistic Regression 1 (Replaces prior revision dated October 20, 2011)

Ron Heck, Fall Week 8: Introducing Generalized Linear Models: Logistic Regression 1 (Replaces prior revision dated October 20, 2011) Ron Heck, Fall 2011 1 EDEP 768E: Seminar in Multilevel Modeling rev. January 3, 2012 (see footnote) Week 8: Introducing Generalized Linear Models: Logistic Regression 1 (Replaces prior revision dated October

More information

ISQS 5349 Spring 2013 Final Exam

ISQS 5349 Spring 2013 Final Exam ISQS 5349 Spring 2013 Final Exam Name: General Instructions: Closed books, notes, no electronic devices. Points (out of 200) are in parentheses. Put written answers on separate paper; multiple choices

More information

appstats8.notebook October 11, 2016

appstats8.notebook October 11, 2016 Chapter 8 Linear Regression Objective: Students will construct and analyze a linear model for a given set of data. Fat Versus Protein: An Example pg 168 The following is a scatterplot of total fat versus

More information

multilevel modeling: concepts, applications and interpretations

multilevel modeling: concepts, applications and interpretations multilevel modeling: concepts, applications and interpretations lynne c. messer 27 october 2010 warning social and reproductive / perinatal epidemiologist concepts why context matters multilevel models

More information

Applied Regression Analysis

Applied Regression Analysis Applied Regression Analysis Lecture 2 January 27, 2005 Lecture #2-1/27/2005 Slide 1 of 46 Today s Lecture Simple linear regression. Partitioning the sum of squares. Tests of significance.. Regression diagnostics

More information

Linear Regression. Furthermore, it is simple.

Linear Regression. Furthermore, it is simple. Linear Regression While linear regression has limited value in the classification problem, it is often very useful in predicting a numerical response, on a linear or ratio scale. Furthermore, it is simple.

More information

LECTURE 15: SIMPLE LINEAR REGRESSION I

LECTURE 15: SIMPLE LINEAR REGRESSION I David Youngberg BSAD 20 Montgomery College LECTURE 5: SIMPLE LINEAR REGRESSION I I. From Correlation to Regression a. Recall last class when we discussed two basic types of correlation (positive and negative).

More information

Panel Data. March 2, () Applied Economoetrics: Topic 6 March 2, / 43

Panel Data. March 2, () Applied Economoetrics: Topic 6 March 2, / 43 Panel Data March 2, 212 () Applied Economoetrics: Topic March 2, 212 1 / 43 Overview Many economic applications involve panel data. Panel data has both cross-sectional and time series aspects. Regression

More information

Simulating MLM. Paul E. Johnson 1 2. Descriptive 1 / Department of Political Science

Simulating MLM. Paul E. Johnson 1 2. Descriptive 1 / Department of Political Science Descriptive 1 / 76 Simulating MLM Paul E. Johnson 1 2 1 Department of Political Science 2 Center for Research Methods and Data Analysis, University of Kansas 2015 Descriptive 2 / 76 Outline 1 Orientation:

More information

36-463/663: Multilevel & Hierarchical Models

36-463/663: Multilevel & Hierarchical Models 36-463/663: Multilevel & Hierarchical Models Causal Inference Brian Junker 132E Baker Hall brian@stat.cmu.edu 1 Outline Causal Inference [G&H Ch 9] The Fundamental Problem Confounders, and how Controlled

More information

Recent Advances in the Field of Trade Theory and Policy Analysis Using Micro-Level Data

Recent Advances in the Field of Trade Theory and Policy Analysis Using Micro-Level Data Recent Advances in the Field of Trade Theory and Policy Analysis Using Micro-Level Data July 2012 Bangkok, Thailand Cosimo Beverelli (World Trade Organization) 1 Content a) Classical regression model b)

More information

De-mystifying random effects models

De-mystifying random effects models De-mystifying random effects models Peter J Diggle Lecture 4, Leahurst, October 2012 Linear regression input variable x factor, covariate, explanatory variable,... output variable y response, end-point,

More information

Multilevel Models in Matrix Form. Lecture 7 July 27, 2011 Advanced Multivariate Statistical Methods ICPSR Summer Session #2

Multilevel Models in Matrix Form. Lecture 7 July 27, 2011 Advanced Multivariate Statistical Methods ICPSR Summer Session #2 Multilevel Models in Matrix Form Lecture 7 July 27, 2011 Advanced Multivariate Statistical Methods ICPSR Summer Session #2 Today s Lecture Linear models from a matrix perspective An example of how to do

More information

Inference. ME104: Linear Regression Analysis Kenneth Benoit. August 15, August 15, 2012 Lecture 3 Multiple linear regression 1 1 / 58

Inference. ME104: Linear Regression Analysis Kenneth Benoit. August 15, August 15, 2012 Lecture 3 Multiple linear regression 1 1 / 58 Inference ME104: Linear Regression Analysis Kenneth Benoit August 15, 2012 August 15, 2012 Lecture 3 Multiple linear regression 1 1 / 58 Stata output resvisited. reg votes1st spend_total incumb minister

More information

Econometrics Summary Algebraic and Statistical Preliminaries

Econometrics Summary Algebraic and Statistical Preliminaries Econometrics Summary Algebraic and Statistical Preliminaries Elasticity: The point elasticity of Y with respect to L is given by α = ( Y/ L)/(Y/L). The arc elasticity is given by ( Y/ L)/(Y/L), when L

More information

R 2 and F -Tests and ANOVA

R 2 and F -Tests and ANOVA R 2 and F -Tests and ANOVA December 6, 2018 1 Partition of Sums of Squares The distance from any point y i in a collection of data, to the mean of the data ȳ, is the deviation, written as y i ȳ. Definition.

More information

ECNS 561 Multiple Regression Analysis

ECNS 561 Multiple Regression Analysis ECNS 561 Multiple Regression Analysis Model with Two Independent Variables Consider the following model Crime i = β 0 + β 1 Educ i + β 2 [what else would we like to control for?] + ε i Here, we are taking

More information

A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data

A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data Today s Class: Review of concepts in multivariate data Introduction to random intercepts Crossed random effects models

More information

A Course in Applied Econometrics Lecture 7: Cluster Sampling. Jeff Wooldridge IRP Lectures, UW Madison, August 2008

A Course in Applied Econometrics Lecture 7: Cluster Sampling. Jeff Wooldridge IRP Lectures, UW Madison, August 2008 A Course in Applied Econometrics Lecture 7: Cluster Sampling Jeff Wooldridge IRP Lectures, UW Madison, August 2008 1. The Linear Model with Cluster Effects 2. Estimation with a Small Number of roups and

More information

Section 3: Simple Linear Regression

Section 3: Simple Linear Regression Section 3: Simple Linear Regression Carlos M. Carvalho The University of Texas at Austin McCombs School of Business http://faculty.mccombs.utexas.edu/carlos.carvalho/teaching/ 1 Regression: General Introduction

More information

Correlated Data: Linear Mixed Models with Random Intercepts

Correlated Data: Linear Mixed Models with Random Intercepts 1 Correlated Data: Linear Mixed Models with Random Intercepts Mixed Effects Models This lecture introduces linear mixed effects models. Linear mixed models are a type of regression model, which generalise

More information

Lecture 4: Multivariate Regression, Part 2

Lecture 4: Multivariate Regression, Part 2 Lecture 4: Multivariate Regression, Part 2 Gauss-Markov Assumptions 1) Linear in Parameters: Y X X X i 0 1 1 2 2 k k 2) Random Sampling: we have a random sample from the population that follows the above

More information

Introduction to the Analysis of Hierarchical and Longitudinal Data

Introduction to the Analysis of Hierarchical and Longitudinal Data Introduction to the Analysis of Hierarchical and Longitudinal Data Georges Monette, York University with Ye Sun SPIDA June 7, 2004 1 Graphical overview of selected concepts Nature of hierarchical models

More information

Econ 836 Final Exam. 2 w N 2 u N 2. 2 v N

Econ 836 Final Exam. 2 w N 2 u N 2. 2 v N 1) [4 points] Let Econ 836 Final Exam Y Xβ+ ε, X w+ u, w N w~ N(, σi ), u N u~ N(, σi ), ε N ε~ Nu ( γσ, I ), where X is a just one column. Let denote the OLS estimator, and define residuals e as e Y X.

More information

Linear Regression Measurement & Evaluation of HCC Systems

Linear Regression Measurement & Evaluation of HCC Systems Linear Regression Measurement & Evaluation of HCC Systems Linear Regression Today s goal: Evaluate the effect of multiple variables on an outcome variable (regression) Outline: - Basic theory - Simple

More information

Biostatistics and Design of Experiments Prof. Mukesh Doble Department of Biotechnology Indian Institute of Technology, Madras

Biostatistics and Design of Experiments Prof. Mukesh Doble Department of Biotechnology Indian Institute of Technology, Madras Biostatistics and Design of Experiments Prof. Mukesh Doble Department of Biotechnology Indian Institute of Technology, Madras Lecture - 39 Regression Analysis Hello and welcome to the course on Biostatistics

More information

Binary Logistic Regression

Binary Logistic Regression The coefficients of the multiple regression model are estimated using sample data with k independent variables Estimated (or predicted) value of Y Estimated intercept Estimated slope coefficients Ŷ = b

More information

The Simple Linear Regression Model

The Simple Linear Regression Model The Simple Linear Regression Model Lesson 3 Ryan Safner 1 1 Department of Economics Hood College ECON 480 - Econometrics Fall 2017 Ryan Safner (Hood College) ECON 480 - Lesson 3 Fall 2017 1 / 77 Bivariate

More information

Longitudinal Data Analysis

Longitudinal Data Analysis Longitudinal Data Analysis Mike Allerhand This document has been produced for the CCACE short course: Longitudinal Data Analysis. No part of this document may be reproduced, in any form or by any means,

More information

Volatility. Gerald P. Dwyer. February Clemson University

Volatility. Gerald P. Dwyer. February Clemson University Volatility Gerald P. Dwyer Clemson University February 2016 Outline 1 Volatility Characteristics of Time Series Heteroskedasticity Simpler Estimation Strategies Exponentially Weighted Moving Average Use

More information

Sociology Exam 2 Answer Key March 30, 2012

Sociology Exam 2 Answer Key March 30, 2012 Sociology 63993 Exam 2 Answer Key March 30, 2012 I. True-False. (20 points) Indicate whether the following statements are true or false. If false, briefly explain why. 1. A researcher has constructed scales

More information

Ch 2: Simple Linear Regression

Ch 2: Simple Linear Regression Ch 2: Simple Linear Regression 1. Simple Linear Regression Model A simple regression model with a single regressor x is y = β 0 + β 1 x + ɛ, where we assume that the error ɛ is independent random component

More information

Lecture 2 Linear Regression: A Model for the Mean. Sharyn O Halloran

Lecture 2 Linear Regression: A Model for the Mean. Sharyn O Halloran Lecture 2 Linear Regression: A Model for the Mean Sharyn O Halloran Closer Look at: Linear Regression Model Least squares procedure Inferential tools Confidence and Prediction Intervals Assumptions Robustness

More information

Example: 1982 State SAT Scores (First year state by state data available)

Example: 1982 State SAT Scores (First year state by state data available) Lecture 11 Review Section 3.5 from last Monday (on board) Overview of today s example (on board) Section 3.6, Continued: Nested F tests, review on board first Section 3.4: Interaction for quantitative

More information

Introduction to Econometrics. Review of Probability & Statistics

Introduction to Econometrics. Review of Probability & Statistics 1 Introduction to Econometrics Review of Probability & Statistics Peerapat Wongchaiwat, Ph.D. wongchaiwat@hotmail.com Introduction 2 What is Econometrics? Econometrics consists of the application of mathematical

More information

Lecture 4: Multivariate Regression, Part 2

Lecture 4: Multivariate Regression, Part 2 Lecture 4: Multivariate Regression, Part 2 Gauss-Markov Assumptions 1) Linear in Parameters: Y X X X i 0 1 1 2 2 k k 2) Random Sampling: we have a random sample from the population that follows the above

More information

Exam Applied Statistical Regression. Good Luck!

Exam Applied Statistical Regression. Good Luck! Dr. M. Dettling Summer 2011 Exam Applied Statistical Regression Approved: Tables: Note: Any written material, calculator (without communication facility). Attached. All tests have to be done at the 5%-level.

More information

Lecture 4: Regression Analysis

Lecture 4: Regression Analysis Lecture 4: Regression Analysis 1 Regression Regression is a multivariate analysis, i.e., we are interested in relationship between several variables. For corporate audience, it is sufficient to show correlation.

More information

We d like to know the equation of the line shown (the so called best fit or regression line).

We d like to know the equation of the line shown (the so called best fit or regression line). Linear Regression in R. Example. Let s create a data frame. > exam1 = c(100,90,90,85,80,75,60) > exam2 = c(95,100,90,80,95,60,40) > students = c("asuka", "Rei", "Shinji", "Mari", "Hikari", "Toji", "Kensuke")

More information

CHAPTER 6: SPECIFICATION VARIABLES

CHAPTER 6: SPECIFICATION VARIABLES Recall, we had the following six assumptions required for the Gauss-Markov Theorem: 1. The regression model is linear, correctly specified, and has an additive error term. 2. The error term has a zero

More information

Measurement Error. Often a data set will contain imperfect measures of the data we would ideally like.

Measurement Error. Often a data set will contain imperfect measures of the data we would ideally like. Measurement Error Often a data set will contain imperfect measures of the data we would ideally like. Aggregate Data: (GDP, Consumption, Investment are only best guesses of theoretical counterparts and

More information

Econometrics Review questions for exam

Econometrics Review questions for exam Econometrics Review questions for exam Nathaniel Higgins nhiggins@jhu.edu, 1. Suppose you have a model: y = β 0 x 1 + u You propose the model above and then estimate the model using OLS to obtain: ŷ =

More information

Simple Linear Regression

Simple Linear Regression Simple Linear Regression ST 430/514 Recall: A regression model describes how a dependent variable (or response) Y is affected, on average, by one or more independent variables (or factors, or covariates)

More information

Chapter 12: Linear regression II

Chapter 12: Linear regression II Chapter 12: Linear regression II Timothy Hanson Department of Statistics, University of South Carolina Stat 205: Elementary Statistics for the Biological and Life Sciences 1 / 14 12.4 The regression model

More information

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI Introduction of Data Analytics Prof. Nandan Sudarsanam and Prof. B Ravindran Department of Management Studies and Department of Computer Science and Engineering Indian Institute of Technology, Madras Module

More information

SMA 6304 / MIT / MIT Manufacturing Systems. Lecture 10: Data and Regression Analysis. Lecturer: Prof. Duane S. Boning

SMA 6304 / MIT / MIT Manufacturing Systems. Lecture 10: Data and Regression Analysis. Lecturer: Prof. Duane S. Boning SMA 6304 / MIT 2.853 / MIT 2.854 Manufacturing Systems Lecture 10: Data and Regression Analysis Lecturer: Prof. Duane S. Boning 1 Agenda 1. Comparison of Treatments (One Variable) Analysis of Variance

More information

Ordinary Least Squares Regression Explained: Vartanian

Ordinary Least Squares Regression Explained: Vartanian Ordinary Least Squares Regression Explained: Vartanian When to Use Ordinary Least Squares Regression Analysis A. Variable types. When you have an interval/ratio scale dependent variable.. When your independent

More information

Econometrics 1. Lecture 8: Linear Regression (2) 黄嘉平

Econometrics 1. Lecture 8: Linear Regression (2) 黄嘉平 Econometrics 1 Lecture 8: Linear Regression (2) 黄嘉平 中国经济特区研究中 心讲师 办公室 : 文科楼 1726 E-mail: huangjp@szu.edu.cn Tel: (0755) 2695 0548 Office hour: Mon./Tue. 13:00-14:00 The linear regression model The linear

More information

POLI 8501 Introduction to Maximum Likelihood Estimation

POLI 8501 Introduction to Maximum Likelihood Estimation POLI 8501 Introduction to Maximum Likelihood Estimation Maximum Likelihood Intuition Consider a model that looks like this: Y i N(µ, σ 2 ) So: E(Y ) = µ V ar(y ) = σ 2 Suppose you have some data on Y,

More information

Regression, part II. I. What does it all mean? A) Notice that so far all we ve done is math.

Regression, part II. I. What does it all mean? A) Notice that so far all we ve done is math. Regression, part II I. What does it all mean? A) Notice that so far all we ve done is math. 1) One can calculate the Least Squares Regression Line for anything, regardless of any assumptions. 2) But, if

More information

Generalised linear models. Response variable can take a number of different formats

Generalised linear models. Response variable can take a number of different formats Generalised linear models Response variable can take a number of different formats Structure Limitations of linear models and GLM theory GLM for count data GLM for presence \ absence data GLM for proportion

More information

1. How can you tell if there is serial correlation? 2. AR to model serial correlation. 3. Ignoring serial correlation. 4. GLS. 5. Projects.

1. How can you tell if there is serial correlation? 2. AR to model serial correlation. 3. Ignoring serial correlation. 4. GLS. 5. Projects. 1. How can you tell if there is serial correlation? 2. AR to model serial correlation. 3. Ignoring serial correlation. 4. GLS. 5. Projects. 1) Identifying serial correlation. Plot Y t versus Y t 1. See

More information