R version 2.7.0 (2008-04-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > z <- c(4145,3796,3711,3949,3734,3243,4407,4814,3908,5225,3937,4004,5256,3922,3759,4138,4634,3996,4308,4142,4429,5219,4929,5754,5592,4163,4962,5208,4755,4491,5732,5273,5024,6056,4901,5353,5578,4618,4724,5011,5298,4143,4617,4736,4214,5112,4197,4119,5104,4194,4583,3179,5557,4304,3838,4277,4951,4479,4677,4274,4782) > y <- c(439399,443726,391256,408901,402161,348488,480492,481026,425566,552486,421285,437352,561274,407471,402222,413059,483492,397921,440406,435234,454587,543865,505741,634863,563227,446013,511023,538698,482674,458641,575341,646082,520987,597873,493881,558187,56905,473463,480354,514117,533534,426824,486037,472691,446893,509635,446079,429852,549667,435785,45748,393332,565671,444341,390432,454296,506998,456574,505953,451327,500655) > x <- c(2282,2266,1878,2267,2069,1746,2299,2336,2214,2825,2355,2333,3016,2155,2172,2315,2533,2058,2516,2259,2498,2695,2799,2945,2293,2318,2354,2257,2669,2245,2842,3439,2677,2979,2257,2842,2546,2455,2293,2379,2478,2054,2272,2351,2271,2542,2304,2194,2722,2395,2146,1894,2548,2087,2063,2481,2476,2212,2834,2148,2598) > (rho12 <- cor(x, y)) [1] 0.5602915 > (rho23 <- cor(y, z)) [1] 0.4743947 > (rho13 <- cor(x, z)) [1] 0.755459 > (rhoxy_z <- (rho12-(rho13*rho23))/(sqrt(1-(rho13*rho13)) * sqrt(1-(rho23*rho23)))) [1] 0.3500586 > (rhoxz_y <- (rho13-(rho12*rho23))/(sqrt(1-(rho12*rho12)) * sqrt(1-(rho23*rho23)))) [1] 0.6715407 > (rhoyz_x <- (rho23-(rho12*rho13))/(sqrt(1-(rho12*rho12)) * sqrt(1-(rho13*rho13)))) [1] 0.09419166 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Pearson Product Moment Partial Correlation - Ungrouped Data',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Statistic',1,TRUE) > a<-table.element(a,'Value',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Correlation r(xy)',header=TRUE) > a<-table.element(a,rho12) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/partial_correlation1.htm','Partial Correlation r(xy.z)',''),header=TRUE) > a<-table.element(a,rhoxy_z) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Correlation r(xz)',header=TRUE) > a<-table.element(a,rho13) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/partial_correlation1.htm','Partial Correlation r(xz.y)',''),header=TRUE) > a<-table.element(a,rhoxz_y) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Correlation r(yz)',header=TRUE) > a<-table.element(a,rho23) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/partial_correlation1.htm','Partial Correlation r(yz.x)',''),header=TRUE) > a<-table.element(a,rhoyz_x) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/1g9r21227558577.tab") > > > > proc.time() user system elapsed 0.809 0.039 0.844