Thank you for your answer. But further calculations will be much more difficult, like
(1-b)^2 * Var(V1) for all matching columns where b is the slope from a regression V1 (from datset 1) on V1 (dataset 2) and Var(V1) the variance from V1(from dataset2). So what I'm looking for is something like a loop function... -- View this message in context: http://r.789695.n4.nabble.com/calculate-with-different-columns-from-different-datasets-tp4674918p4674926.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.