Re: [R] number of individuals where X=0 during all periods (longitudinal data)

2014-12-23 Thread Barry Rowlingson
obligatory dplyr solution: library(dplyr) zeroes = Test %% group_by(ID) %% summarise(Zs=all(X==0)) - that gives you a data frame of unique ID and Zs==TRUE if that ID has all zeroes. With that you just sum(zeroes$Zs) to get the total number with all zeroes. Or add %% filter(Zs) %% nrow() to the

[R] Do NOT use ifelse() if you can use if(.) else . [was Checking ..]

2014-12-23 Thread Martin Maechler
Steven Yen sye...@gmail.com on Sun, 14 Dec 2014 09:30:56 -0500 writes: Steven Yen sye...@gmail.com on Sun, 14 Dec 2014 09:30:56 -0500 writes: Thanks. This worked!! :) Fisher - ifelse(!(Fisher %in% names(obj$spec)), FALSE, obj$spec$Fisher) worked, yes. But please --- for

Re: [R] Do NOT use ifelse() if you can use if(.) else . [was Checking ..]

2014-12-23 Thread peter dalgaard
On 23 Dec 2014, at 10:05 , Martin Maechler maech...@stat.math.ethz.ch wrote: In cases like this one when the condition 'Cond' is a simple TRUE or FALSE (i.e. of length 1), using if(Cond) A else B instead of ifelse(Cond, A, B) is 1. much more R - like [[

Re: [R] Do NOT use ifelse() if you can use if(.) else . [was Checking ..]

2014-12-23 Thread John Fox
Hi, Sorry to chime in late, but here's an alternative solution, without conditionals: obj - list(spec=list(Fisher=TRUE, Tukey=FALSE)) obj$spec$Fisher [1] TRUE !is.null(obj$spec$Fisher) obj$spec$Fisher [1] TRUE obj$spec$Pearson NULL !is.null(obj$spec$Pearson) obj$spec$Pearson [1]

Re: [R] Cox model with multiple events - PH assumption

2014-12-23 Thread Therneau, Terry M., Ph.D.
On 12/23/2014 05:00 AM, r-help-requ...@r-project.org wrote: Dear all, I'm using the package survival for adjusting the Cox model with multiple events (Prentice, Williams and Peterson Model). I have several covariates, some of them are time-dependent. I'm using the functioncox.zph to check

[R] Getting HR from Cox model in R

2014-12-23 Thread Ruzan Udumyan
Dear All, I am not familiar with R language well. Could you please help me interpret these commands?: TE = exp(sum(coef(cox)[c('aTRUE', 'bTRUE')])) - does it mean exp(coef(a variable) + coef(b variable)) ? DE = exp(unname(coef(cox)['aTRUE'])) - what is unname for ? Thank you very much

Re: [R] Getting HR from Cox model in R

2014-12-23 Thread Michael Dewey
Inline comments On 23/12/2014 09:42, Ruzan Udumyan wrote: Dear All, I am not familiar with R language well. Could you please help me interpret these commands?: TE = exp(sum(coef(cox)[c('aTRUE', 'bTRUE')])) - does it mean exp(coef(a variable) + coef(b variable)) ? You have not given us

Re: [R] Do NOT use ifelse() if you can use if(.) else . [was Checking ..]

2014-12-23 Thread Ben Tupper
On Dec 23, 2014, at 4:05 AM, Martin Maechler maech...@stat.math.ethz.ch wrote: Steven Yen sye...@gmail.com on Sun, 14 Dec 2014 09:30:56 -0500 writes: Steven Yen sye...@gmail.com on Sun, 14 Dec 2014 09:30:56 -0500 writes: Thanks. This worked!! :) Fisher - ifelse(!(Fisher %in%

Re: [R] R2WinBUGS

2014-12-23 Thread Uwe Ligges
On 23.12.2014 08:46, thanoon younis wrote: Dear all R-members I have a problem with R when i wanted to call WinBUGS from R as following: #Call WinBUGS model-bugs(data,inits,parameters,model.file=D:/Run/model.txt, n.chains=2,n.iter=5000,n.burnin=1000,n.thin=1,'DIC=True', ??? You

[R] Unable to install ggplot2; using R 3.1.2 and RStudio 0.98.1091 in Linux Mint 17.1

2014-12-23 Thread rewyllys
My attempts to install and then load ggplot2 have repeatedly failed. Here is the pertinent set of commands and responses: - install.packages(ggplot2) Installing package into

Re: [R] Unable to install ggplot2; using R 3.1.2 and RStudio 0.98.1091 in Linux Mint 17.1

2014-12-23 Thread Sarah Goslee
Hi, It's not an R problem: you don't have the necessary tools installed in linux, specifically g++ You'll need to install the development tools for your version of linux, as it states in the Rcpp FAQ. Google should help you figure out what you need, if you don't already know how to find and

[R] issue on installation of RCurl on Debian Wheezy

2014-12-23 Thread maxbre
I must say I'm pretty new to Linux Debian and R so I might miss here reporting some relevant information (just in case, sorry for that!); I've been looking around the web and also onto this mailing list - and indeed this topic has been already covered-, but still I can't find any useful solution

[R] nlme package: changing reference for varIdent parameter estimates in summary.gls

2014-12-23 Thread Kornak, John
Dear R experts, I am running gls models with heterogeneous group variances using the glm function in the nlme package with varIdent weights. I am interested in controlling the baseline level for the group variance function standard deviation estimates by applying the relevel function to the

Re: [R] issue on installation of RCurl on Debian Wheezy

2014-12-23 Thread Rolf Turner
The error message is quite clear: It says that you are missing curl-config on your system: checking for curl-config... no Cannot find curl-config On my Fedora system I would do: yum whatprovides curl-config and I would get: libcurl-devel-7.24.0-2.fc17.x86_64 : Files needed for building

[R] Carrying a value down a data.frame conditionally

2014-12-23 Thread Pooya Lalehzari
Hello, I have a data.frame (below) containing the two fields of Value and Signal and I would need to create the third field of To_Be_Produced. The condition for producing the third field is to carry the 1 in the Signal field down until Value is below 40. Do I have to create a for-loop to do

Re: [R] Bca confidence intervals for Pearson coefficient, thanks.

2014-12-23 Thread varin sacha
Dear Professor Fox, Once more I really thank you lots for your response. I will try it. Best regards, and Merry Christmas to you. SV De : John Fox j...@mcmaster.ca À : 'varin sacha' varinsa...@yahoo.fr Cc : 'r-help help' r-help@r-project.org Envoyé le : Dimanche 21 décembre 2014 22h22

Re: [R] issue on installation of RCurl on Debian Wheezy

2014-12-23 Thread Jeff Newmiller
Do you have curl installed? RCurl just uses your external-to-R system installation of the curl software to do its real work. --- Jeff NewmillerThe . . Go Live...

Re: [R] issue on installation of RCurl on Debian Wheezy

2014-12-23 Thread Michael Hannon
I think you need to have curl-config installed. I had a similar problem on Ubuntu and found the program in various packages:. $ apt-file search curl-config | grep bin libcurl4-gnutls-dev: /usr/bin/curl-config libcurl4-nss-dev: /usr/bin/curl-config libcurl4-openssl-dev:

Re: [R] nlme package: changing reference for varIdent parameter estimates in summary.gls

2014-12-23 Thread ONKELINX, Thierry
Dear John, R-sig-mixed-models is more suited for this kind of questions. All follow-up mail should be posted only to that mailing list. It seems like varIdent() by default relevels the grouping factor and that the user cannot control this. Best regards, ir. Thierry Onkelinx Instituut voor