[R-SIG-Finance] Compute jump test statistic

G See gsee000 at gmail.com
Mon Jun 18 23:38:41 CEST 2012


What do you want to do with all of the NAs in your data.  You can't
apply functions like max to data with NA

> max(0, 1)
[1] 1
> max(NA, 1)
[1] NA

Maybe you want to use na.omit?

> max(na.omit(c(NA, 0)), 1)
[1] 1

HTH,
Garrett

On Mon, Jun 18, 2012 at 4:29 PM, G See <gsee000 at gmail.com> wrote:
> A csv does not contain R objects.  How did you read the csv into R?
>
>
> On Mon, Jun 18, 2012 at 3:24 PM, cursethiscure
> <caolan.harvey6 at mail.dcu.ie> wrote:
>> Sorry please find the outads data attached as a csv file.
>>
>>  For the max(1, MedRQ/MedRV^2))
>>
>>  where MedRQ/MedRV is: `outads$medrq/(outads$medrv^2) -> outads$denom2`
>>  in the csv file.
>>
>>  I am trying to return the maximum of either 1 or MedRQ/MedRV^2 (i'm
>>  aware all values are greater than 1, but this needs to be applied to
>>  other data sets) but I do not know how to maximise a constant against
>>  time-series sequence. Everything else is ok. I just dont know how to
>>  return this argument http://r.789695.n4.nabble.com/file/n4633741/outads.csv
>> outads.csv
>>
>> --
>> View this message in context: http://r.789695.n4.nabble.com/Compute-jump-test-statistic-tp4633731p4633741.html
>> Sent from the Rmetrics mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> R-SIG-Finance at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list