Hi guys I have an input file with multiple columns and and rows. Is it possible to calculate correlation of certain value of certain No (For example x of S1 = 112) with all other values (for example start with x 112 corr a 3 of S1 = x-a 0.2 ) INPUT ******* No S1 S2 S3 S4 Sn a 3 4 45 34 23 x 112 0 12 23 0 b 0 1 23 12 1 n 0 1 0 1 1 OUTPUT *********** No S1 S2 S3 S4 Sn x-a 0.2 0.3 ............... x-x 1 1 ................ x-b 0.......................... x-n 0.9 ....................... [[alternative HTML version deleted]]
Hi there, I'm not sure I understand your question. What are the two vectors you wish to check their correlation? Are they the two rows x and a? Because from your example it seems you are trying to do a correlation between two singular numbers (so probably I didn't get something straight). Tal ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Tue, Nov 23, 2010 at 8:57 AM, gireesh bogu <girishbogu@gmail.com> wrote:> Hi guys > > I have an input file with multiple columns and and rows. > Is it possible to calculate correlation of certain value of certain No (For > example x of S1 = 112) with all other values (for example start with x 112 > corr a 3 of S1 = x-a 0.2 ) > > INPUT > ******* > > No S1 S2 S3 S4 Sn > a 3 4 45 34 23 > x 112 0 12 23 0 > b 0 1 23 12 1 > n 0 1 0 1 1 > > OUTPUT > *********** > > No S1 S2 S3 S4 Sn > x-a 0.2 0.3 ............... > x-x 1 1 ................ > x-b 0.......................... > x-n 0.9 ....................... > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Hello On Tue, Nov 23, 2010 at 7:57 AM, gireesh bogu <girishbogu at gmail.com> wrote:> Hi guys > > I have an input file with multiple columns and and rows. > Is it possible to calculate correlation of certain value of certain No (For > example x of S1 = 112) with all other values (for example start with x 112 > corr a 3 of S1 = x-a 0.2 ) >Yes, R can readily compute correlations. See ?cor. But for absolute beginners, you may want to try consulting Quick-R [0], or doing this via a GUI (Rcmdr, JGR/Deducer). Additionally, make sure to read 'Some Hints for the R Beginner' [1] and the posting guide (link at teh bottom of this message). Regards Liviu [0] http://www.statmethods.net/ [1] http://www.burns-stat.com/pages/Tutor/hints_R_begin.html> INPUT > ******* > > No ?S1 ?S2 ?S3 ?S4 ?Sn > a ? ?3 ? ? 4 ? ? 45 ?34 ? 23 > x ? 112 ? 0 ? ?12 ? 23 ? 0 > b ? ?0 ? ? 1 ? ? 23 ? 12 ? 1 > n ? ?0 ? ? 1 ? ? 0 ? ? ?1 ? ?1 > > OUTPUT > *********** > > No ?S1 ?S2 ?S3 ?S4 ?Sn > x-a ?0.2 ? 0.3 ............... > x-x ?1 ? ? 1 ?................ > x-b ?0.......................... > x-n ?0.9 ....................... > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail