### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Linear Models MATH 6010

The U

GPA 3.95

### View Full Document

## 35

## 0

## Popular in Course

## Popular in Mathematics (M)

This 8 page Class Notes was uploaded by Miss Noel Mertz on Monday October 26, 2015. The Class Notes belongs to MATH 6010 at University of Utah taught by Staff in Fall. Since its upload, it has received 35 views. For similar materials see /class/229929/math-6010-university-of-utah in Mathematics (M) at University of Utah.

## Reviews for Linear Models

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/26/15

ASSESSING NORMALITY DAVAR KHOS HNEVISAN 1 HISTOGRAMS Consider the linear model Y X e The pressing question is is it true that e N Nn0 0217 To answer this consider the residuals77 E Y 7 X3 lf 5 N Nn0 021 then one would like to think that the histogram of the as should look like a normal pdf with mean 0 and variance 02 why How close is close It helps to think more generally Consider a sample U1 Un eg U We wish to know where the Ui s are coming from a normal distribution Again the rst thing to do is to plot the histogram In R you type histunclassn where u denotes the vector of the samples U1 Un and n denotes the number of bins in the histogram For instance consider the following exam data 168 92 00 176 152 00 00 104 104 140 112 136 124 148132176 92 76 92144148156144 44140144 00 00108168 00152128144140172 00144172 00 00 00140 56 00 00132 176160160 00120 00136160 84116 00104 00144 00184172148160160 00100 136120152 The command f1dathistncass15 produces Figure 1a1 Try this for different values of nclass to see what types of hitograms you can obtain You should always ask which one represents the truth the best ls there a unique answer Now the data U1 Un is probably not coming from a normal distribu tion if the histogram does not have the right77 shape Ideally it would be symmetric and the tails of the distribution taper off rapidly In Figure 1a there were many students who did not take the exam in question They received a 0 but this grade should probably not contribute to our knowledge of the distribution of all such grades Figure 1b shows Date September 1 2004 You can obtain this data freely from the website below httpwwwmathutaheduquotdavarmath60102004notesf1dat 1 Frequency Frequency DAVAR KHOSHNEVISAN Histogram of f1 o M a Grades Histogram of f1 censored f1 censored b Censored Grades ASSESSING NORMALITY 3 the histogram of the same data set when the zeroes are removed This histogram is closer to a normal density 2 QQ PLOTS QQ plots are a better way to assess how closely a sample follows a certain distribution To understand the basic idea note that if U17 WU is a sample from a normal distribution with mean u and variance 02 then about 683 of the sample points should fall in 1707 11 0 954 should fall in 7207 p2a etc Now let us be more careful still Let U0 Um denote the order statistics of U17 7 Un Then no matter how you make things precise7 the fraction of data below Um is ji So we make a continuity correction and de ne the fraction of date below Uj to be j 7 If the Uj s were approximately N 07 17 then we would expect the fraction of data below U to be qj This is de ned to be the quantile Iquot l 1 Iquot l PN01lt 2 ltIgt 2 77617 my 1861 n lf Uj N Nu7 727 then Ujilua N N017 so we would expect the fraction below Uj to be aqj 1 work this outl Therefore7 even if we do not know u and 02 then we would expect the scatterplot of qj7 Uj to follows closely a line The slope and intercept are a and u respectively QQ plots are simply the plots of the N01 quantiles q1 7qn versus the order statistics U1 7 To draw the qqplot of a vector u in R7 you simply type qqnormu Figure 1c contains the qq plot of the exam data we have been studying here 3 THE CORRELATION COEFFICIENT OF THE QQ PLOT In its complete form7 the R command qqnorm has the following syntax qqnormudatax FALSE7 plot TRUE The parameter u denotes the data datax is FALSE if the data values are drawn on the y axis default It is TRUE if you wish to plot U07 qj instead of the more traditional qj7 Um The option plotTRUE default tells R to plot the qq plot7 whereas plotFALSE produces a vector So for instance7 try V qqnormu7 plot FALSE SampIe OuantIIes SampIe OuantIIes DAVAR KHOSHNEVISAN Normal 0 Plot I I I I 2 1 0 I TheoretIcaI OuantIIeS C QQPlot of grades Normal 0 Plot o o no 00000 o 000 000 cocoon 0000 000 00 o oo o o o 000 o o o o o o o I I I I 2 1 0 I TheoretIcaI OuantIIeS d QQplot of censored grades ASSESSING NORMALITY 5 This creates two vectors Vm and Vy The rst contains the values of all qj s and the second all of the Uj s So now you can compute the correlation coefficient of the qq plot by typing V qqnormu plot FALSE corVm Vy If you do this for the qq plot of the grade data then you will nd a correlation of x 0910 After censoring out the no show exams we obtain a correlation of x 0971 This produces a noticeable difference and shows that the grades are indeed normal In fact one can analyse this procedure statistically as we shall do later on LEASTSQUARES ESTIMATORS IN LINEAR MODELS DAVAR KHOS HNEVISAN 1 THE GENERAL LINEAR MODEL Let Y be the response variable and X1 Xm be the explanatory vari ables The following is the linear model of interest to us 1 Y61X1 me where 31 m are unknown parameters and 6 is noise Now we take a sample Y1 Yn The linear model becomes 2 K51Xi1 lem6i i1n De ne X11 39 39 39 le 51 3 X s s 6 3 X 1 Xnm gm Note that Ban me 4 X E anl l l anm Therefore the linear model 2 can be written more neatly as 5 YX e wheree616n TobesureYisnx1Xisnxm6ismx1 and eisnxl The matrix X is treated as if it were non random it is called the design matrix77 or the regression matrix77 2 LEAST SQUARES Let 0 X and minimize over all 6 the following quantity 7L 6 HYi HZY70Y70e5ZE i1 Note that Date August 30 2004 2 DAVAR KHOSHNEVISAN ltDgt CX FIGURE 1 The projection 5 of Y onto the subspace where Xi denotes the ith column of the matrix X That is7 0 E 6 X7the column space of X So our problem has become Minimize HY 7 0 over all 0 E A look at Figure 1 will conVince you that the closest point 3 E is the projection of Y onto the subspace To nd a formula for this projection we rst work more generally 3 SOME GEOMETRY Let S be a subspace of R Recall that this means that 1 lfzy 6 Sand 043 6 R7 then az y E S and 2 0 e S Suppose 3901 vk forms a basis for S that is7 any x E S can be represented as a linear combination of the vi s De ne V to be the matrix whose ith column is m that is7 8 V39vl39vk Then any 1 E R is orthogonal to S if and only if 1 is orthogonal to every 3901 that is7 1111 O Equivalently7 1 is orthogonal to S if and only if 11 V 0 ln summary7 9 mlSltgt1VO Now the question is If 1 E R then how can we nd its projection u onto S Consider Figure 3 From this it follwos that u has two properties 1 First of all7 u is perpendicular S7 so that u 7 11 V O Equiva lently7 u V 13 V LEASTSQUARES ESTIMATORS IN LINEAR MODELS 3 CX 2 Secondly7 u 6 S7 so there exist 041704k E Rk such that u 04101 akvk Equivalently7 10 u Va Plug 2 into 1 to nd that a VV 13 V Therefore7 if VV is invertible7 then a m VVV 1 Equivalently7 11 u VV V 1V1 De ne 12 P5 VV V 1V Then7 u P511 is the projection of 1 onto the subspace S Note that P5 is idempotent ie7 Pg P5 and symmetric P5 4 APPLICATION TO LINEAR MODELS Let S be the subspace spanned by the columns of Xithis is the column space of X Then7 provided that X X is invertible7 13 wa XX X 1X Therefore7 the LSE E of 0 is given by 14 5 PXY XX X 1X Y This is equal to X E So X XE XY Equivalently7 15 B X X 1X Y

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.