[R] Cointegration no constant

2008-03-19 Thread Ralph S.
Hi, I am trying to estimate a VECM without constant using the following code: data(finland) sjf - finland sjf.reg-ca.jo(sjf, type = c(eigen), ecdet = c(none), K = 2,spec=c(transitory), season = NULL, dumvar = NULL) cajools(sjf.reg) While the cointegration test does not use a constant, it is

Re: [R] subsetting matrix according to columns with character index

2008-08-13 Thread Ralph S.
then either of the following should work: DFsub-DF[DF$z == 1 DF$z == 2,] or DFsub-subset(DF, z == 1 z == 2 ) On Wed, Aug 13, 2008 at 2:00 PM, Ralph S. wrote: Hi, I have a long matrix of the following form which I would like to subset according to the third column: [x y z

[R] algorithm to create unique identifiers

2008-09-04 Thread Ralph S.
Hi all, I am trying to create a unique identifier for each row, combining numbers from three columns. Do you know if there is a general formula to do this (or some manual where I can read about this)? I figure I can use the numeric entries of the columns as coordinates and multiply them

[R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
Hi, I am trying to replicate blocks of a matrix (defined by factors) into another matrix, but an unequal, consecutive number of times for each factor. I need to find an elegant and fast way to do this, so loops will not work. An example of what I am trying to do is the following: # the data

Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
] To: [EMAIL PROTECTED] CC: r-help@r-project.org Subject: Re: [R] replicate matrix blocks different numbers of times into new matrix Ralph S. wrote: Hi, I am trying to replicate blocks of a matrix (defined by factors) into another matrix, but an unequal, consecutive number of times for each

Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
1 [2,]13 [3,]11 [4,]13 [5,]24 [6,]24 On Sat, Jul 19, 2008 at 7:17 PM, Ralph S. wrote: Actually not quite - my mistake, since I oversimplified the problem I have. Here is a more realistic x matrix (plus some additional information

[R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
Hi, I am trying to calculate the sum for each occurrence of the level of a factor in a very large matrix. In addition, I want to save that sum together with the information of the level of the factor and the level of a second factor. My matrix looks like this:

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-20 Thread Ralph S.
- lapply(split(seq(nrow(x)), dataBreaks), function(.sect){ + c(x[.sect[1], 1:2], sum(x[.sect, 3])) + }) do.call(rbind, result) [,1] [,2] [,3] 0173 1242 2323 317 10 On Sun, Jul 20, 2008 at 7:57 PM, Ralph S. wrote: The first

Re: [R] Cannot re-start R after bus error

2008-07-22 Thread Ralph S.
that deleted your temporary R directories but did you delete that .RData file. It's trying to load it during startup and it can't so it's probably there somewhere I would think ? Hopefully someone more knowledgable than me on these things will reply. On Tue, Jul 22, 2008 at 4:22 PM, Ralph S

[R] Eaxct position of specific elements in array

2008-08-01 Thread Ralph S.
Hi, I am trying to get the positions in array coordinates (needed later) of certain elements in an array but I am not sure how to get them. My array is Q and the condition is dtdV, where dt and dV are arrays of exactly the same dimensions as Q. I know that I can extract the elements of Q by