5 n23 mno2 8 mno28 25 138 n13 314 n10 0 0 100 200 300

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: arge” and speed=“high” 43 Statistics 503, Spring 2013, ISU 43 5:%'G&'9%H(&C&Chloride size: small 1 size: medium size: large 4 speed: low 3 2 1 0 4 speed: medium a1 3 2 1 0 4 speed: high 3 2 1 0 1 2 3 4 1 2 3 Chloride 4 1 Statistics 503, Spring 2013, ISU 2 3 4 44 44 5:%'G&'9%H(&C&orthoPhosphate small medium large 4 2 1 0 1 2 3 4 51 2 3 4 orthoPhosphate 51 2 3 Statistics 503, Spring 2013, ISU 4 5 45 45 5:%'G&'9%H(&C&Chlorophyll 4 3 a1 a1 3 2 1 0 1.0 1.5 2.0 Chlorophyll 2.5 3.0 Statistics 503, Spring 2013, ISU 46 46 7.%+/')/92( b/*$2E"*2$*'"42%'*#(4*$-""4*2$*'"42%'3* =.h?@P:HX3*+JLPhMB3*=7.#h?X:B S&#($/+&'*)7"*=.3*+JLP3*=7.#*0#.%"$ =.VDW:MXF*hB:HP3*+JLPVDW:MXF*hM:?@3************ =7.#VDW:MXFh?:@G J&"42<)"4*0#.%"*h*P:PM>?:GW>W:Pf> D;?:M?>W:@B;W:?@FiB:HP>DW:BM;?:BGF iM:?@;W:XMi?:@G*h*?:XH J&"42<)"4*<+%()*h*"C-D?:XHF;?*h*B:G? Statistics 503, Spring 2013, ISU 47 47 ["I&"$$2+(*S&""$*)+*=.#$$2d<#)2+(*S&""$ =7#-)"&*@:B*bE"('#(3*Z#$)*-#&)*+/*#.I#"*<#$"*$)%46 48 !IFAJK&!LI&M4%2& =%22/(N&/2&):%&2%8(& bj!*N(#.6)2<$*$#24*Tb/*A^+\+02<*,+(*HGg*+/* )7"*BW;BW*+&*4"%<"*I#'"$*7"*7#4*#*@Bg* <7#(<"*+/*,2((2(I*)7"*$")`U* Huh? 49 <%#.%((/92&).%%( R+&)*0#.%"$*+(*"0"&6*-&"42<)+&*DkF R-.2)*4#)#*2()+*),+*I&+%-$*D'#(6*)2'"$F* 5"),""(*"#<7*-#2&*+/*0#.%"$*Dk"3*k#F 1C#'2("*)7"*42Q"&"(<"*5"),""(*)7"* #0"&#I"*&"$-+($"*0#.%"*+/*)7"*),+*I&+%-$* mm Dl"3*l#F J2<\*)7"*$-.2)*,7"&"*)72$*42Q"&"(<"*2$*)7"* .#&I"$)3*<+()2(%"*$-.2))2(I::: 50 JO$34"% 3 y > x=runif(100) > y=4*x+rnorm(100)*0.3 > rt.data<-data.frame(x=x, y=y) > rt.data.fit <- rpart(y~x, data=rt.data) > rt.data.fit n= 100 4 2 1 0 0.00 0.25 0.50 x 0.75 1.00 node), split, n, deviance, yval * denotes terminal node 1) root 100 127.1093000 1.9266990 2) x< 0.4995135 53 20.9997900 1.0405210 4) x< 0.2005921 17 1.9163250 0.3024598 * 5) x>=0.2005921 36 5.4499790 1.3890500 10) x< 0.3262407 17 1.1069270 1.0731720 11) x>=0.3262407 19 1.1291300 1.6716770 3) x>=0.4995135 47 17.5531000 2.9260060 6) x< 0.7642353 29 4.5213850 2.5507690 12) x< 0.6515195 14 1.4059720 2.2516340 13) x>=0.6515195 15 0.6934332 2.8299620 7) x>=0.7642353 18 2.3698110 3.5305550 * * * * * 51 4 y 3 2 1 0 0.00 0.25 0.50 x 0.75 1.00 52 4 y 3 2 1 0 0.00 0.25 0.50 x 0.75 1.00 52 4 y 3 2 1 0 0.00 0.25 0.50 x 0.75 1.00 52 4 y 3 2 1 0 0.00 0.25 0.50 x 0.75 1.00 52 4 y 3 2 1 0 0.00 0.25 0.50 x 0.75 1.00 52 4 y 3 2 1 0 0.00 0.25 0.50 x 0.75 1.00 52 Predicted values 4 y 3 2 1 0 0.00 0.25 0.50 x 0.75 1.00 52 69+%"&D) b/*CnW:M*)7"(*6hW:B 1.$"*2/*Coh*W:M*p*n*W:BB*)7"(*6h?:WH 1.$"*2/*CohW:BB*p*nW:X*)7"(*6h?:fH 1.$"*2/*CohW:X*p*nW:fX*)7"(*6hM:MX 1.$"*2/*CohW:fX*p*nW:Hf*)7"(*6hM:GB 1.$"*2/*CohW:Hf*)7"(*6hB:XB 53 !"#$%&'(()&*#&#+"&*',*"&-*#* q$"*+&2I2(#.*&#,*4#)#3*"C<"-)*/+&*),+*<#$"$* ,2)7*.+)$*+/*'2$$2(I$ > library(rpart) > data(algae) > algae <- algae[-manyNAs(algae), ] > rt.a1 <- rpart(a1 ~ .,data=algae[,1:12]) > rt.a1 n= 198 node), split, n, deviance, yval * denotes terminal node ... > # Draw tree > plot(rt.a1) > text(rt.a1) > prettyTree(rt.a1) > # Draw splits > qplot(PO4, a1, data=algae) + geom_vline(xintercept=43.82) > qplot(Cl, a1, data=subset(algae, PO4>=43.818)) + geom_vline (xintercept=7.81) ... 54 17 | n=198 PO4>=43.82 PO4< 43.82 8.98 n=147 40.1 n=51 Cl>=7.806 7.49 n=140 oPO4>=51.12 mxPH< 7.87 Cl< 7.806 38.7 n=7 13 n=56 mnO2>=10.05 33.4 n=28 48.2 n=23 mxPH>=7.045 mxPH< 7.045 oPO4< 51.12 3.85 n=84 mxPH>=7.87 PO4>=15.18 PO4< 15.18 26.4 n=18 46.2 n=10 38.2 n=12 59.1 n=11 mnO2< 10.05 6.72 n=24 17.6 n=32 NO3>=3.188 NO3< 3.188 7.87 n=9 21.5 n=23 mnO2< 8 mnO2>=8 13.8 n=13 31.4 n=10 55 1) root 198 90401.290 16.996460 2) PO4>=43.818 147 31279.120 8.979592 ... 3) PO4< 43.818 51 22442.760 40.103920 ... 17 | n=198 PO4>=43.82 PO4< 43.82 8.98 n=147 40.1 n=51 Cl>=7.806 7.49 n=140 oPO4>=51.12 38.7 n=7 13 n=56 mnO2>=10.05 mxPH>=7.87 33.4 n=28 48.2 n=23 mxPH>=7.045 mxPH< 7.045 oPO4< 51.12 3.85 n=84 mxPH< 7.87 Cl< 7.806 PO4>=15.18 PO4< 15.18 26.4 n=18 46.2 n=10 38.2 n=12 59.1 n=11 mnO2< 10.05 6.72 n=24 17.6 n=32 NO3>=3.188 NO3< 3.188 7.87 n=9 21.5 n=23 mnO2< 8 mnO2>=8 13.8 n=13 31.4 n=10 55 1) root 198 90401.290 16.996460 2) PO4>=43.818 147 31279.120 8.979592 ... 3) PO4< 43.818 51 2...
View Full Document

This note was uploaded on 02/06/2014 for the course STAT 503 taught by Professor Staff during the Fall '08 term at Iowa State.

Ask a homework question - tutors are online