Unformatted text preview:

at the a= .05:\\stat524\1:2],1:2]{%*%t(sigrnae$vectors)%*% R12solve(msqrt(Rll)0.0349187--) %*% R21 %*%Br(R22) )~~[1]0.1868654/correlations.P2 = .1869Therefore.PI~Test the hypothesis Ho: II2=O at the a=p-2~3n-70tt--(n-1-(p+q+1)/2)*log(prod(1chicrit-qchisq(O.95,p*q)> tt[1] 44.65657> chicrit[1] 12.59159= 12.5916. Since thehypothesisWith degree of freedom pq=6, at a=Ho:}:;12=O, and conclude that wecorrelations.Test for the significance of the firstk ..Ho :Pj *0,p2 =0k .H I :P2 * 0tt1--(n-1-(p+q+1)/2)*log(prod(1-0.tt1[1] 2.345834Chicrit1-qchisq(O.95, (p-1)*(q-1»Chicrit1[1] 5.9914651The chi-square critical value = 5.9915. Since the observed test statistics 2.3458 is less than thechi-square critical value, we don't reject the null hypothesis and we conclude that only firstcanonical correlation is significant.b) Using standardized variables, construct the canonical variates corresponding to the"significant" canonical correlation(s).1Canonical variatesarl-solve(msqrt(Rll))%*%(-Areigen$vectorsarl%*% (Breigen$vectors[,l])[1,[2,br]br][,1][1,] 0.04912716[2,] 0.89751138[3,] 0.19004109Suppose Z(l) = [ zi1) , zi1) ], and Z(2) = ! zi2) , zi2) , zj2) ] are standardized variables. Let Z = [ Z(l) , Z(2) ]',then 01 = a;z(l) = .7689 zi1) + .2721 zi1) , ~ = b;Z(2) = .0491 zi2) + :8975 zi2) + .1900 zj2) are the firstpair of canonical variates.c)Using the results in Parts a and b, prepare a table showing the canonical variate coefficientsand the sample correlations of the canonical variates with their component variablesRll%*%arlrhoulzl-rhoulzl..,./L,.I.J10.986585820.8872149rhov1z2-R22%*%br1rhov1z230.421115040.982202850.5144868] 0.] 0.--sol[,1]689274720729'e (msqrt (R22 )d) Given the infomlation in (c), interpret the canonical variatesAccording to canonical variate coefficients, 01 is primarily afrequency of dining at arestaurant variable while ~ represents annual family income. Sample correlations of thecanonical variates with their component variables also provide interpretations for 01 and ~ .Thetwo consumption variables have similar correlations with the first canonical variate 01 ' so01 may be interpreted as a consumption characteristics index. This differs from the interpretationbased upon canonical variate coefficients, where the frequency of attending movies variable isnot important.~ ' seems to represents primarily annual family income. It can be regarded as afamily incomeindex. This interpretation agrees with the preceding interpretation based upon the canonicalcoefficients of the 12) , s.e) Do the demographic variables have something to say about the consumption variables? Do theconsumption variables provide much information about the demographic variables?Yes, the demographic variables and consumption variables appear to provide informationabout each other. There appears to be overlap between the demographics and the consumption asthe sample correlation between 01 and ~ is p;= .6879, which suggests that the two sets ofvariables are relatively strongly associated.Problem 10.17.Determine the sample canonical variates and their coITelations. Interpret these quantities. Are thefirst canonical variates good summary measures of their respective sets of variables? Explain.R11-as.matrix(R11)R12-as.matrix(R12)R22-as.matrix(R22)msqrt-function(sigma){sigmae-eigen(sigma, symmetric=TRUE)+ temp-sigmae$vectors %*% sqrt(diag(sigmae$values)) %*% t(sigmae$vectors+ temp+ }R21-read.table("h:\\stat524\\Dataset\\R21smoke.dat")R21-as.matrix(R21)A-solve(msqrt(R11)) %*% R12 %*% solve(R22) %*% R21 %*% solve(msqrt(R11)Aeigen-eigen(A, symmetric=TRUE)Aeigen$values:[1] 0.27206040 0.14081689 0.05865159 0.018650/ 0Acorr-sqrt(Aeigen$values)Acorr[1] 0.52159410.3752558 0.24218090.1365679B-solve(msqrt(R22)) %*% R21 %*% solve(Rl1) %*% R12 %*% solve(msqrt(R22)Beigen-eigen(B,symmetric=TRUE)a1-so1ve{msqrt(Rll)) %*% (-Aeigen$vectors[,l])bl-so1ve{msqrt(R22)) %*% {Beigen$vectors[,l])a2-so1ve{msqrt(Rll))%*% (-Aeigen$vectors[,2])b2-so1ve{msqrt{R22)) %*% (Beigen$vectors[,2])a3-so1ve(msqrt{R11)) %*% (-Aeigen$vectors[,3])3~b3-so1ve(msqrt(R22) ) %*%a4-so1ve(msqrt(Rll))%*% (-b4-so1ve(msqrt(R22)) %*%A-cbind(al, a2, a3, a4)B-cbind(bl, b2, b3, b4)~~, and P: = .1366, Z~2) ] are standardized.04732 zi2) -are the first pair ofareforThe sample canonicalSuppose Z(I) = [ Z:I) , Z~I) Z~I)variables. Let Z = [ Z<1) , Z<2) ]',then 61= a;Z(I)= .0430z:1)-1..7806 Z~2) + .2567 Z~2) + .6919 Z~2) -canonical variates. The canonicalpresented in -"AU k .Columns of matrix BA.AI AI~ a2Bb' b'1 2[1,] 0.4732661 -0.8140517[2,] -0.7805809 -0.4510203[3,] 0.2567028 -0.6051824[4,] 0.6919168 0.3799525[5,] -0.1451489 -0.1839878[6,] -0.0703867 0.6255409 -[7,] 0.3127276 0.5898351[8,] 0.3364251 0.4868649~According to canonical ~while ~ represents annoyancevariable while V2 representsa smoking I, smoking 2 andcontentedness. rJ4 is primarilyannoyance, sleepiness, alertness,2 and smoking 3 variable1 and smoking 4.rJ3 is primarilyalertness andwhile V4 representsrespective sets ofthe canonical variates..3067 , and4[1,] 0.04295049 -1.0898244[2,] -1.16220375 -0.6987851[3,] 1.37533027 -0.2081487[4,] -0.89086250 1.6505748Whether the first canonicalvariables is reflected in "1Ls 2 1 2 2 1=- r. (2) =-[(,71986) +".+(.53232) ]=-(2.96362)=.3705. The first sample8 k=l Vl.'i 8 8canonical variate O 1 of the desire to smoke set accounts for 30.7% of the set's total samplevariance. The first sample canonical variate ~ and physical state setaccounts for 37.1 % of the set's total' -lowproportions of sample variances, " of their respectivesets of variables.> rhou1z1-R11%*%a1> rhov1z2-R22%*%b1> rhou1z1[ ,1]1 -0.44578042 -0.73048933 -0.29101694 -0.6402934>


View Full Document

Purdue STAT 52400 - Homework 7

Documents in this Course
Load more
Download Homework 7
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Homework 7 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Homework 7 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?