Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread laro
Thank you again! But somehow the which(function) didn't work... The problem is, that the columns I want to drop in further calculations will not have the same name, that's why I'm looking for a solution to make a vector of the columns that should be omitted, like omit<-c("Restriction 1","Restricti

[R] Add function to each row excluding certain columns

2013-10-09 Thread laro
Hello I've got a matrix of the following form BARNBCGEBCVNBEANRestriction 1 Restriction 2 Restriction 3 Restriction 4 Restriction 5 alpha.1 0.000172449 7.87E-05-0.0032710440.000921609 9.28E-192.00E-05 -0.000608211NA NA alpha.2 0

Re: [R] Add function to each row excluding certain columns

2013-10-09 Thread laro
Thank you for the fast answer! Is there any way to use the first solution way, but work with the column names instead of the number of the column. Because in further calculation I need to drop more columns than just the restriction ones and the real dataset has to many columns to work with the pos

[R] Time lag Regression and Standard Error

2013-09-01 Thread laro
Hi R Team I've got the following problem I'd like to run a time series regression of the following form Regression1: At = α + β1 * Bt + β2 * Bt-1 + β3 [(Bt-2 + Bt-3 + Bt-4)/3] + εt The B's are the input values and the A's are the output values, the subscript stands for the lag. The real Beta o

Re: [R] calculate with different columns from different datasets

2013-09-01 Thread laro
Thank you, it worked! -- View this message in context: http://r.789695.n4.nabble.com/calculate-with-different-columns-from-different-datasets-tp4674918p4675116.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mail

Re: [R] calculate with different columns from different datasets

2013-08-30 Thread laro
Thank you a lot A.K.! One more question: I'd like to compute the Spearman's rank correlation coefficients for V1 (from dat1) and V1 (from dat2) and so on... Do you know how to do that? I managed to write the Pearson's correlation product moment coefficient with your sapply-approach, but I have no

Re: [R] calculate with different columns from different datasets

2013-08-29 Thread laro
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 somethi

[R] calculate with different columns from different datasets

2013-08-29 Thread laro
Hi thereI've got two datasets of the following form (just an example, the real dataset got a lot more columns)dataset1V1 V2 V32 6 84 3 41 9 8and dataset 2V1 V2 V36 8 42 0 78 1 3First, I'd like to calculate the followin