Re: [R] t.test() on a list

2008-10-02 Thread Gang Chen
I appreciate your suggestion. The example I provided was fabricated because I was only focusing on the programming perspective on how to deal with such a data structure, not real statistical issues. Do you mind elaborating a little more why that would not be appreciate? I know I can do it with a co

[R] aggregate empty row for pretty appearance also subtotal if possible

2008-10-02 Thread Sharma, Dhruv
Hi, To pretty print aggregates by various dimensions I needed to add a empty row in output of aggregate. For example. d<-(aggregate(data[,cbind("x")], by=list(data$group1,data$group2), sum)) Group.1 Group.2 x 1 A N 3 2 A Y

[R] In the OPTIM message....

2008-10-02 Thread kathie
Dear all When I used the method, L-BFGS-B, in OPTIM, I've got the following message. - $par [1] 0.176166426835580 $value [1] 1322.17600079332 $counts function gradient 88 $convergence [1] 0 $message [1] "CON

Re: [R] pvals.fnc in lme4 and languageR

2008-10-02 Thread Daniela Reicheneder
Hi! Yes, the example in the help of pvals.fnc is working. Is something wrong with my lmer-object? It´s created with m<-lmer(file2[,11] ~ file2[, 1] + file2[, 2] + file2[, 3]+ file2[, 4] + file2[, 5] + file2[, 6]+ file2[, 7]+ file2[, 8] + file2[, 9] + file2[, 10] + (file2[, 5] | file2[, 2]), fi

Re: [R] In the OPTIM message....

2008-10-02 Thread Ravi Varadhan
Yes, the estimates are reliable when you get that messsage. If you want a more rigorous convergence, you can decrease "factr", whose default is 1e07. However, I am not sure why you need this. Read the help for `optim' ?optim Ravi. ---

Re: [R] time segments intersection

2008-10-02 Thread [Ricardo Rodriguez] Your XEN ICT Team
Hi John, John Kane wrote: help("%in%") may be of use. However I don't see any overlap in your example. You are right! I've choosen an example where the intersection is 0. But we could consider this other case... endPeriod<-as.POSIXlt("2008-09-30") startPeriod<-as.POSIXlt("2007-10-01") endP

Re: [R] time segments intersection

2008-10-02 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks Gabor, I am afraid I have some problems installing zoo package. Please, could you take a look at this? > install.packages("packagename",repos="http://R-Forge.R-project.org";) Warning message: package 'packagename' is not available > install.packages("zoo",repos="http://R-Forge.R-project

Re: [R] time segments intersection

2008-10-02 Thread Gabor Grothendieck
Try this: install.packages("zoo", dep = TRUE) On Thu, Oct 2, 2008 at 7:15 PM, [Ricardo Rodriguez] Your XEN ICT Team <[EMAIL PROTECTED]> wrote: > Thanks Gabor, > > I am afraid I have some problems installing zoo package. Please, could you > take a look at this? > >> install.packages("packagename"

Re: [R] time segments intersection

2008-10-02 Thread [Ricardo Rodriguez] Your XEN ICT Team
Hi Mark, [EMAIL PROTECTED] wrote: hi: I don't know if it's the best way but one way is to use an POSIXct object. ( you can convert using as.POSIXct( strptime(datestring)) because then each unit of digit is a second and you can proceed from there. if you explain what you want to do exactly,

Re: [R] time segments intersection

2008-10-02 Thread [Ricardo Rodriguez] Your XEN ICT Team
Hi, Gabor Grothendieck wrote: Try this: install.packages("zoo", dep = TRUE) Here the result. I've tried with a couple of mirrors (Bristol and Spain): > install.packages("zoo", dep = TRUE) --- Please select a CRAN mirror for use in this session --- Warning: unable to access index for reposit

Re: [R] time segments intersection

2008-10-02 Thread Gabor Grothendieck
Select a different mirror until you find one that works for you. On Thu, Oct 2, 2008 at 7:38 PM, [Ricardo Rodriguez] Your XEN ICT Team <[EMAIL PROTECTED]> wrote: > Hi, > > Gabor Grothendieck wrote: >> >> Try this: >> >> install.packages("zoo", dep = TRUE) > > Here the result. I've tried with a cou

Re: [R] time segments intersection

2008-10-02 Thread [Ricardo Rodriguez] Your XEN ICT Team
OK. Please, how do I force the select directory window to pop-up after selecting a given repos and without restarting R? When I submit install.packages("zoo", dep = TRUE) for the first time after R starts, I am required to select a mirror. But this doesn't happen in the next install command at

Re: [R] time segments intersection

2008-10-02 Thread [Ricardo Rodriguez] Your XEN ICT Team
Not yet. I'll keep trying. Please, what format string must I pass to strptime to get the date as a number? Thanks. Cheers, Ricardo [EMAIL PROTECTED] wrote: did you get zoo to work and try gabor's solution because i wasn't really following what you wanted. On Thu, Oct 2, 2008 at 7:25 P

Re: [R] time segments intersection

2008-10-02 Thread Gabor Grothendieck
Try: chooseCRANmirror() On Thu, Oct 2, 2008 at 7:47 PM, [Ricardo Rodriguez] Your XEN ICT Team <[EMAIL PROTECTED]> wrote: > OK. Please, how do I force the select directory window to pop-up after > selecting a given repos and without restarting R? > > When I submit install.packages("zoo", dep = TRU

[R] RBloomberg to get dividend

2008-10-02 Thread dhzdhz
I try to use RBloomberg to get the dividend for IBM. However, blpGetData(conn, "IBM EQUITY", field="EQY_DVD_HIST_ALL", start=as.chron("1980-01-01")) doesn't work. It returns EQY_DVD_HIST_ALL (10/02/08 14:46:36) NA I have to used blpGetData(conn, "IBM EQUITY",

[R] When to set small values to 0?

2008-10-02 Thread Hesen Peng
My dear R buddies, I've run into a problem when doing numerical computation recently. In a program that I've been working on, I usually get a vector of real values which are theoretically (and it's correct) supposed to decrease until reaching zero after a given value. However, most of the value ju

[R] Error message in ifthen else

2008-10-02 Thread Jason Lee
Hi, I came across the below error when I try to do ifelse condition:- Error in "[<-"(`*tmp*`, test, value = rep(yes, length = length(ans))[test]) : incompatible types What I am trying to accomplish is :- for(x in 1:ncol(filterpred)){ sumno<-sum(filterpred[no,x]) sumyes<-sum(filterpred[

Re: [R] aggregate empty row for pretty appearance also subtotal if possible

2008-10-02 Thread jim holtman
Here is one way of doing it: > dat <- read.table(textConnection("Group1 Group2 x + AY1 + BN1 + AY1 + BN 420164904 + AN 3"), header=TRUE, as.is=TRUE) > closeAllConnections() > d <- a

Re: [R] aggregate empty row for pretty appearance also subtotal if possible

2008-10-02 Thread jim holtman
You can also use the 'reshape' package: > d.m <- melt(dat, measure.var='x') > d.m Group1 Group2 variable value 1 A Yx 1 2 B Nx 1 3 A Yx 1 4 B Nx 420164904 5 A Nx 3 > cas

[R] Point of intersection

2008-10-02 Thread Lavan
Hi, Let say I have a normal density X~n(0,1) and I have a line y=0.01x+0.07. the following code generate the plots. x=seq(-10,10,length=100) plot(x,p1,type='n',ylab="Density",main="Overlap Measure",xaxt="n",yaxt="n") pi=dnorm(x,0,1) points(x,p1,type='l') abline(0.07,0.01) you can see that the

Re: [R] Error message in ifthen else

2008-10-02 Thread Duncan Murdoch
On 02/10/2008 10:07 PM, Jason Lee wrote: Hi, I came across the below error when I try to do ifelse condition:- Error in "[<-"(`*tmp*`, test, value = rep(yes, length = length(ans))[test]) : incompatible types What I am trying to accomplish is :- for(x in 1:ncol(filterpred)){ sumno<-su

Re: [R] Error message in ifthen else

2008-10-02 Thread Jason Lee
Hi Duncan, Mark and all, Thanks for the suggestion. I ve tried the below suggestion. I got this error now Error in `[<-.data.frame`(`*tmp*`, , x, value = NULL) : new columns would leave holes after existing columns Its weird as I try to assign NULL manually and its not complaining anything. W

Re: [R] Multiple hist(ograms) - One plot

2008-10-02 Thread Michael Just
Dieter and Thierry: Per you suggestions I have tried: ggplot2 from Thierry: > p <- ggplot(dat, aes(x=bbContag, y=..density..)) + geom_histogram() > p + facet_grid(. ~ sc_recov %in% c(21,31,41)) But get the followinng error: Error in check_formula(formula, varnames) : Formula contains variables

[R] formula form of coxph

2008-10-02 Thread Xing Yuan
Dear R user, I got a question when using the coxph function. I have 5 covariates x1, x2, x3, x4, x5 and I want to write a function so that when given an indicator, e.g., c(1,3,5), I can fit the model as model=coxph(Surv(time, status)~x1+x3+x5). Any idea to play around the form of formula? Thank y

Re: [R] formula form of coxph

2008-10-02 Thread Yihui Xie
> idx = c(1,3,5) > as.formula(paste("Surv(time, status)~", paste("x", idx, sep = "", collapse = > "+"))) Surv(time, status) ~ x1 + x3 + x5 Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name Scho

Re: [R] Multiple hist(ograms) - One plot

2008-10-02 Thread Deepayan Sarkar
On 10/2/08, Michael Just <[EMAIL PROTECTED]> wrote: > Dieter and Thierry: > > Per you suggestions I have tried: > > ggplot2 from Thierry: > > > p <- ggplot(dat, aes(x=bbContag, y=..density..)) + geom_histogram() > > > p + facet_grid(. ~ sc_recov %in% c(21,31,41)) > > But get the followinng error

Re: [R] time segments intersection

2008-10-02 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks Gabor, Gabor Grothendieck wrote: Try: chooseCRANmirror() It works the call to the pop-up window, but it fails now whatever mirror I use with the following message: > install.packages("zoo",repos=chooseCRANmirror()) /bin/sh: tar: command not found Error in sprintf(gettext(fmt, domain

<    1   2