Re: [R] bootstrap function

2011-09-06 Thread Daniel Malter
install.packages("bootstrap") library(bootstrap) ? -- View this message in context: http://r.789695.n4.nabble.com/bootstrap-function-tp3794224p3795264.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Weight in Function RM

2011-09-06 Thread Suphajak Ngamlak
Dear all, I am trying to do weighted regression using lm function in R. However, I have a question why the results from 1) lm(formula = Y~aX, weight = w) 2) lm(formula = wY~waX) are different. Aren't they supposed to have the exactly same result? Below are the R code to see differ

Re: [R] sample within groups-slight problem

2011-09-06 Thread Jean-Christophe BOUËTTÉ
2011/9/6 Jean-Christophe BOUËTTÉ : you could tapply function(x) if(length(x)==1) x else sample(x) or something like this > > 2011/9/6 Jean-Christophe BOUËTTÉ : >> Hi there, >> in the third case you get sample(5) which is exactly what you asked for. >> >> from ?sample: >> "If x has length 1, is nu

Re: [R] sample within groups-slight problem

2011-09-06 Thread Jean-Christophe BOUËTTÉ
Hi there, in the third case you get sample(5) which is exactly what you asked for. from ?sample: "If x has length 1, is numeric (in the sense of is.numeric) and x >= 1, sampling via sample takes place from 1:x. Note that this convenience feature may lead to undesired behaviour when x is of varying

Re: [R] Possible to access a USB volume by name in windows

2011-09-06 Thread Joshua Wiley
Hi, This comes with absolutely no guarantees (and a good recommendation to be cautious), but you could try it: myset <- function(name = "", path = "") { res <- vector("character", length(LETTERS)) for(i in LETTERS) { res[i] <- shell(shQuote(paste("VOL ", i, ":", sep = '')), intern = TRUE,

Re: [R] Question about Natural Splines (ns function)

2011-09-06 Thread David Winsemius
On Sep 6, 2011, at 5:08 PM, Axel Urbiz wrote: Hi - How can I 'manually' reproduce the results in 'pred1' below? Well, not by constructing the prediction function from a different data basis that the glm function gets. My attempt is pred_manual, but is not correct. Any help is much apprec

Re: [R] Alternatives to integrate?

2011-09-06 Thread R. Michael Weylandt
I'm not sure what your worry about "individuals" is, but running the code as given above hits another more fundamental problem: your use of the "..." argument. Since integrate passes a vector of arguments**, your code interprets most of those as "..." arguments and tries to pass them along to dDIST

Re: [R] Update packages problem

2011-09-06 Thread David Winsemius
On Sep 6, 2011, at 5:10 PM, B Jessop wrote: R-help, I recently updated R from 2.13.0 to 2.13.1 (32-bit Windows version) and now have a problem updating packages. I am running Windows 7 as operating system. As the FAQ suggests, I uninstalled 2.13.0 before installing 2.13.1. On first

Re: [R] check availability of a file in R

2011-09-06 Thread David Winsemius
On Sep 6, 2011, at 8:07 PM, Farhad Shokoohi wrote: I need to use a loop and each time go to folder i and check availability of .RData file. If it exist load it and if not submit a command in linux. Something like this for (i in 1:10){ setwd(~/i/) # Perhaps: if (target %in%

Re: [R] Possible to access a USB volume by name in windows

2011-09-06 Thread Jeff Newmiller
AFAIK the answer is "no". There are ways to look up the volume label given the drive letter, with which you can search for the drive letter by trial and error, but in most cases that is more trouble than it is worth. --- Jeff

Re: [R] htmlParse hangs or crashes

2011-09-06 Thread Duncan Temple Lang
Hi Simon Unfortunately, it works for me on my OS X machine. So I can't reproduce the problem. I'd be curious to know which version of libxml2 you are using. That might be the cause of the problem. You can find this with library(XML) libxmlVersion() You might install a more recent versi

Re: [R] sample within groups-slight problem

2011-09-06 Thread Duncan Murdoch
On 11-09-06 8:13 PM, Jack Siegrist wrote: I want to sample within groups, and when a group has only one associated number to just return that number. If I use this code: groups<- c(1, 2, 2, 2, 3) numbers<- 1:5 tapply(numbers, groups, FUN = sample) I get the following output: groups<- c(1,

Re: [R] sample within groups-slight problem

2011-09-06 Thread David Winsemius
On Sep 6, 2011, at 8:13 PM, Jack Siegrist wrote: I want to sample within groups, and when a group has only one associated number to just return that number. And what we supposed to do when it has more than one value? If I use this code: groups <- c(1, 2, 2, 2, 3) numbers <- 1:5 tapp

Re: [R] Histogram messed up

2011-09-06 Thread Duncan Murdoch
On 11-09-06 6:29 PM, Berry Boessenkool wrote: Hey all, I encountered a problem drawing a histogram. You can view the picture here: http://dl.dropbox.com/u/4836866/Bad_Histogramm.png This has been fixed in R-patched: see https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14628. Duncan

[R] sample within groups-slight problem

2011-09-06 Thread Jack Siegrist
I want to sample within groups, and when a group has only one associated number to just return that number. If I use this code: groups <- c(1, 2, 2, 2, 3) numbers <- 1:5 tapply(numbers, groups, FUN = sample) I get the following output: > groups <- c(1, 2, 2, 2, 3) > numbers <- 1:5 > tapply(

[R] check availability of a file in R

2011-09-06 Thread Farhad Shokoohi
I need to use a loop and each time go to folder i and check availability of .RData file. If it exist load it and if not submit a command in linux. Something like this for (i in 1:10){ setwd(~/i/) if .Rdata (?) load (.RData else } Any idea how to do

[R] Histogram messed up

2011-09-06 Thread Berry Boessenkool
Hey all, I encountered a problem drawing a histogram. You can view the picture here: http://dl.dropbox.com/u/4836866/Bad_Histogramm.png What happens: the bars are drawn with different starting points, thus no straight zero-line is there. And bars are overlapping. (or sometimes apart from each

Re: [R] Add elements to a global list

2011-09-06 Thread Rolf Turner
On 07/09/11 08:47, Khanvilkar, Shashank wrote: > Hello All, > Thanks in advance for all help. > > In my prog, I have a global list object that is used as a container for > storing some data frames. > Here is an example code. > --SNIP-- > temp1<- function(X){ > statName = c("Mean", "stdDev", "

Re: [R] heatmap

2011-09-06 Thread Gene Leynes
I wrote this function (borrowing heavily from an example from Longhow Lam) heatplot = function(x,y,z,bgcol="#777044",coltype='heat', ccex = 1.5, circles=TRUE, ...){ #browser() layout(matrix(c(1, 2, 3), nc=3), widths=c(7, 1, .5)) ## create the scatterplot withdifferent color

[R] Add elements to a global list

2011-09-06 Thread Khanvilkar, Shashank
Hello All, Thanks in advance for all help. In my prog, I have a global list object that is used as a container for storing some data frames. Here is an example code. --SNIP-- temp1 <- function(X){ statName = c("Mean", "stdDev", "NumSamples") statVal = c("0.5", "0.51", "5") r = data

Re: [R] calibrate.cph plots

2011-09-06 Thread David Winsemius
On Sep 6, 2011, at 5:16 PM, Salvo Mac wrote: Hi! How can I exclude the legends from calibration plots generated by calibrate.cph You may be confused. `calibrate.cph` does not do plotting. There is a `plot.calibrate` function and a `plot.calibrate.default` function. Looking at the code y

[R] Rweb and setting up R on a server

2011-09-06 Thread Erin Hodgess
Dear R People: At one time, Rweb existed, which had R on a server. I looked for it, but can't find it. Has anyone used that recently, or is there a new equivalent, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston

Re: [R] Q and R mode in Principal Component Analysis

2011-09-06 Thread William Revelle
At 4:10 PM +0100 9/6/11, Lívio Cipriano wrote: Hi, Can anyone explain me the differences in Q and R mode in Principal Component Analysis, as performed by prcomp and princom respectively. Dear Livio, The help file of prcomp says it pretty well: "The calculation is done by a singular value

[R] Possible to access a USB volume by name in windows

2011-09-06 Thread Gene Leynes
On the Mac it's pretty easy to get to a USB drive by name. For example the following command works if you have a USB drive named "MYUSB" setwd('/Volumes/MYUSB') Is there a way to do the same thing in Windows (without knowing the drive letter)? Thanks! [[alternative HTML version deleted

Re: [R] Ubuntu Upgrading to R 1.13.0

2011-09-06 Thread Steve Lianoglou
Hi, On Tue, Sep 6, 2011 at 5:47 PM, Antonio Paredes wrote: > Hello everyone, > > I'll like to know if there is an easy way to upgrade R in Ubuntu. I'd use > google to search for information, but nothing seems to work. Googling for "install r ubuntu" gives you a good first hit: http://cran.r-pro

[R] Ubuntu Upgrading to R 1.13.0

2011-09-06 Thread Antonio Paredes
Hello everyone, I'll like to know if there is an easy way to upgrade R in Ubuntu. I'd use google to search for information, but nothing seems to work. Thank you -- -Tony [[alternative HTML version deleted]] __ R-help@r-project.org mailing li

[R] calibrate.cph plots

2011-09-06 Thread Salvo Mac
Hi! How can I exclude the legends from calibration plots  generated by calibrate.cph regards, Salvo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the post

[R] Update packages problem

2011-09-06 Thread B Jessop
R-help, I recently updated R from 2.13.0 to 2.13.1 (32-bit Windows version) and now have a problem updating packages. I am running Windows 7 as operating system. As the FAQ suggests, I uninstalled 2.13.0 before installing 2.13.1. On first opening R, I ran "update.packages(checkBuilt=TRUE,

[R] Question about Natural Splines (ns function)

2011-09-06 Thread Axel Urbiz
Hi - How can I 'manually' reproduce the results in 'pred1' below? My attempt is pred_manual, but is not correct. Any help is much appreciated. library(splines) set.seed(12345) y <- rgamma(1000, shape =0.5) age <- rnorm(1000, 45, 10) glm1 <- glm(y ~ ns(age, 4), family=Gamma(link=log)) dd <- data.fr

Re: [R] subsetting tables

2011-09-06 Thread netzwerkerin
Hi Eik, greetings to Hamburg! :-) Thanks for the fast and helpful answer Eik Vettorazzi-2 wrote: > > #compare > str(red[,2]) > str(red[2,]) > I understand that the first is a real vector of nums in R and the second is a ?? matrix/list/data.frame ?? of single ? entries? Can I transpose/transfo

Re: [R] subsetting tables

2011-09-06 Thread netzwerkerin
Hi Jannis, and thanks for the quick answer jannis-2 wrote: > > > which(red > 0.5) > > this works but what are the actual numbers that are spit out? Because the next step: jannis-2 wrote: > > > red[which(red > 0.5)] > does not work. It gives an Error in `[.data.frame`(tableReduced,

Re: [R] How to speed up regressions (related to data.frame)

2011-09-06 Thread Jean-Christophe BOUËTTÉ
I just tried library(MASS) rlm(1:12+rnorm(12),1:12) it seems it works on vectors too, but maybe I miss something. 2011/9/6 Bos, Roger : > All, > > I have a function that runs a set of regressions (using the rlm > function) and I notice that it run much slower on my 64-bit R than it > does on my 3

[R] How to speed up regressions (related to data.frame)

2011-09-06 Thread Bos, Roger
All, I have a function that runs a set of regressions (using the rlm function) and I notice that it run much slower on my 64-bit R than it does on my 32-bit R. I guess the bigger bit size slows it down. Anyway, I looked into Rprof to see how I can speed it up. I saw that 78% of the total time is

Re: [R] Weights using Survreg

2011-09-06 Thread Terry Therneau
I agree with David that poisson regression would be the simplest thing. It's a consequence of the poison formulation and an exponential "trick" E(#breaks) = breaks per meter * length in meters = exp(Xb) * exp(log(length)) = exp(Xb + log(length)) X = covariates that affe

Re: [R] xtable with conditional formatting using \textcolor

2011-09-06 Thread Brian Diggs
On 9/6/2011 4:01 AM, eldor ado wrote: I have a related question: dataframe df contains values like df .. "\\textbf{ 0.644 }" .. and the line print( xtable(df , sanitize.text.function = function(x){x})) sanitize.text.function is an argument of print.xtable, not xtable. Try print( xta

Re: [R] heatmap

2011-09-06 Thread Jinrui Xu
Hi Sarah, To me, the heatmap function calculates "density value" for each grid of the heatmap automatically from the input matrix. In my case, I already got the "density value" as a vector, say Z. I want to plot a heat map with x and y as is axsis and z values as the "density" of grid. I

Re: [R] heatmap

2011-09-06 Thread Sarah Goslee
You mean like the examples in help("heatmap") ? On Tue, Sep 6, 2011 at 1:20 PM, Jinrui Xu wrote: > Hi everyone, > > I have three numerica vectors: x, y, z. I want to plot a heatmap or surface > plot of z against x and y. Is there any package for this? If possible, > please drop me several lines o

Re: [R] help with glmm.admb

2011-09-06 Thread eeadie
Hi Ben, Thanks you were right. I was using R-studio and needed to close and reopen this after downloading the lastest glmmADMB version in R. Then the new version was on there. Now I have a new problem with the same model that I've been working on. Here is the model and the error message: > mode

[R] bootstrap function

2011-09-06 Thread shu chen
Hi, all, When I ran the following code, library (Design) reri <- function(datsam) { fitlr <- glm(PTSDpy ~ toxo*PTE, family=binomial, data=datsam) reri <- exp(fitlr$coef[2]+fitlr$coef[3]+fitlr$coef[4])-exp(fitlr$coef[2]) - exp(fitlr$coef[3]) + 1 } summary.bootstrap(bootstrap(PTE.work, reri(PTE

Re: [R] Selecting and multiplying

2011-09-06 Thread mdvaan
Anyone any idea on how to tackle this problem? Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/Selecting-and-multiplying-tp3784901p3793908.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.or

[R] Help on the multivariate interpolation with R

2011-09-06 Thread Rachida El Mehdi
Hello, I work on the Stochastic Frontier Analysis (SFA) and I am looking for a function in a R package which done the multivariate interpolation. My problem is: For all i=1, ..., n, I have values of (xi1, xi2, ..., xi7)in IR^7 and f(xi1, xi2, ..., xi7)in R and I have also values of (x'i1, x'i2,

[R] heatmap

2011-09-06 Thread Jinrui Xu
Hi everyone, I have three numerica vectors: x, y, z. I want to plot a heatmap or surface plot of z against x and y. Is there any package for this? If possible, please drop me several lines of example code. Thanks! jinrui, __ R-help@r-project.org

Re: [R] MuMIn Problem getting adjusted Confidence intervals

2011-09-06 Thread Ben Bolker
Kamil Bartoń uni-wuerzburg.de> writes: > > Hi Marcos, > > The 'adjusted CI' (based on the 'adjusted se estimator' > as in section 4.3.3 of Burnham & Anderson > 2002) cannot be calculated for 'lmer' model because it > does not give df's for the coefficients. > > kamil If you're willing to

Re: [R] p values greater than 1 from lme4

2011-09-06 Thread Ben Bolker
On 09/06/2011 02:29 PM, Bogaso Christofer wrote: > Hello Bolker, Hope you will make available at least the problem and > reasoning to this list. I am also very much interested to see the > problem From an earlier off-list e-mail: The problem (which was not at all trivial) is that one of the s

Re: [R] p values greater than 1 from lme4

2011-09-06 Thread Bogaso Christofer
Hello Bolker, Hope you will make available at least the problem and reasoning to this list. I am also very much interested to see the problem -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ben Bolker Sent: 06 September 2011 02:58 To

Re: [R] Weights using Survreg

2011-09-06 Thread David Winsemius
I think you are replying to Dr Therneau without including this context: --- begin Survreg produces MLE estimates. For your second question, don't know what you are asking. Can you be more specific and detailed? ---begin included message -- Do you know if the parameters estimators are MLE

Re: [R] mclust: modelName="E" vs modelName="V"

2011-09-06 Thread Christian Hennig
I probably don't understand problem. I'd assume that variance$sigmasq are the three estimated component variances (probably estimated by maximum a posteriori, but consult the mclust documentation). What's wrong with that? (The values you submit as scale in "prior" are not fixed variances, but

Re: [R] capturing a figure to PDF or Image

2011-09-06 Thread Eran Eidinger
Thank you. On Sep 6, 2011 4:45 PM, "Sarah Goslee" wrote: > Eran, > >> On Tue, Sep 6, 2011 at 8:53 AM, Eran Eidinger wrote: >>> >>> Thank you Sarah and David, >>> I only used a simple plot, and remembered to dev.off(). >>> attached is the session: >>> >>> > plot(c(1,2,3),c(3,2,4)) >>> > jpeg("test

Re: [R] Q and R mode in Principal Component Analysis

2011-09-06 Thread Steve Lianoglou
Hi, 2011/9/6 Lívio Cipriano : > Hi, > > Can anyone explain me the differences in Q and R mode in Principal Component > Analysis, as performed by prcomp and princom respectively. Perhaps this tutorial will help? http://www.uga.edu/strata/software/pdf/pcaTutorial.pdf Search that pdf for "q-mode"

Re: [R] Receive "unable to load shared object RNetCDF.o" during R INSTALL of RNetCDF

2011-09-06 Thread Prof Brian Ripley
The problem appears to be udunits2, which RNetCDF uses and ncdf does not. Specifically --with-udunits-lib='/soft/local/udunits-2.1.23/lib'" is that path in the ld.so cache or in LD_LIBRARY_PATH? If not, it will not be found by dlload. On Tue, 6 Sep 2011, Paul Hiemstra wrote: Hi, You c

[R] [R-pkgs] saemix: SAEM algorithm for parameter estimation in non-linear mixed-effect models (version 0.96)

2011-09-06 Thread Emmanuelle Comets
saemix implements the SAEM (stochastic approximation EM) algorithm for parameter estimation in non-linear mixed effect models, used to model longitudinal data. Longitudinal data are particularly prominent in pharmacokinetics (study of drug concentrations versus time) and pharmacodynamics (st

Re: [R] mclust: modelName="E" vs modelName="V"

2011-09-06 Thread Nico902
Hi, Thanks a lot for your answer. I effectively was able to get rid of this message by doing: > resClust <- > Mclust(data,G=3,modelName="V",prior=priorControl(scale=c(1.44,0.81,0.49))); However, I would like to be able to retrieve the variances I defined in the result. I found: > resClust$para

Re: [R] How to understand the plotting of the cox.zph function

2011-09-06 Thread Jim Trabas
Thank you very much for your answer. I would like to construct for presentation purposes the HR(t), not the beta(t). How can I perform this? I obtained the x-y values of the cox.zph plot time= as.numeric(as.character(rownames(cox.zph.object$y))) HR=exp(cox.zph.object$y[,1]) However when I plo

Re: [R] subsetting tables

2011-09-06 Thread Eik Vettorazzi
Hi Netzwerkerin, subset is a generic function and behaves different for different object classes. txt<-" Allstar hsa.let.7a hsa.let.7a.1 hsa.let.7a.2 20.87 0.79-0.57 1.07 30.67 -1.14-0.78-0.95 4 -0.46 -0.30-0.36 1.14" red<-

Re: [R] write.matrix row names vs sink vs capture.output

2011-09-06 Thread Mark Ebbert
Thank you for your help. The data is meant to be processed by a separate program that expects a simple matrix with row and column names in ascii format. "write.matrix" does exactly what I want except for the row names. It baffles me that this is not an option… On Sep 6, 2011, at 8:22 AM, Paul

[R] Q and R mode in Principal Component Analysis

2011-09-06 Thread Lívio Cipriano
Hi, Can anyone explain me the differences in Q and R mode in Principal Component Analysis, as performed by prcomp and princom respectively. Regards Lívio Cipriano __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] Q and R mode

2011-09-06 Thread Lívio Cipriano
Hi, Can anyone explain me the differences in Q and R mode in Principal Component Analysis, as performed by prcomp and princom respectively. Regards Lívio Cipriano __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] several functions in one *.R file in a R package

2011-09-06 Thread Duncan Murdoch
On 11-09-06 10:26 AM, Jannis wrote: Dear list members, i have build a package which contains a collection of my frequently used functions. To keep the code organized I have broken down some rather extensive and long functions into individual steps and bundled these steps in sub-functions tha

Re: [R] object.size() not recognized within .First()

2011-09-06 Thread Duncan Murdoch
On 11-09-06 10:24 AM, Geof Givens wrote: I have a function called within .First(), as in .First=function() { ...blah... BIG(partofblah) #BIG is my function, n=partofblah when called ...foo... } The partofblah component of blah is a number obtained from readline(), which is then an argument

[R] object.size() not recognized within .First()

2011-09-06 Thread Geof Givens
I have a function called within .First(), as in .First=function() { ...blah... BIG(partofblah) #BIG is my function, n=partofblah when called ...foo... } The partofblah component of blah is a number obtained from readline(), which is then an argument to BIG() BIG=function(n=10,removeask=T)

Re: [R] subsetting tables

2011-09-06 Thread Jannis
Sorry If I miss the point you want to achieve, but why not just: which(red > 0.5) or red[which(red > 0.5)] if you want to use this col/row wise you could do: apply(red, 1, function(x)x[x>0.5]) and apply(red, 1, function(x)x[x>0.5]) ? --- netzwerkerin schrieb am Di, 6.9.2011: > Von: netz

[R] several functions in one *.R file in a R package

2011-09-06 Thread Jannis
Dear list members, i have build a package which contains a collection of my frequently used functions. To keep the code organized I have broken down some rather extensive and long functions into individual steps and bundled these steps in sub-functions that are called inside the main function.

Re: [R] write.matrix row names vs sink vs capture.output

2011-09-06 Thread Paul Hiemstra
On 09/06/2011 06:24 AM, Mark Ebbert wrote: > Dear R gurus, > > I am trying to write several large matrices (~ 1GB) to separate files. I have > learned that write.table is simply too slow for this task and was attempting > to use write.matrix, but write.matrix does not have the ability to include

Re: [R] Hessian matrix issue

2011-09-06 Thread Giovanni Petris
About the numerical calculation of the Hessian matrix, I have found numDeriv:::hessian to be often more accurate than the Hessian returned by optim. Best, Giovanni Petris On Sat, 2011-09-03 at 13:39 -0400, John C Nash wrote: > Unless you are supplying analytic hessian code, you are almost certai

Re: [R] Weights using Survreg

2011-09-06 Thread Boris Beranger
Sorry when we talk about about MLE estimates does that mean WLE?I am trying to understand if the survreg function is allowing a weight for each density function when calculating the likelihood. In my second question I was trying to explain that my problem is that I have pipes of different length a

[R] subsetting tables

2011-09-06 Thread netzwerkerin
Hi guys, one of the questions where you need a real human instead of a search engine, so it would be great if you could help. I have a matrix of z-scores which I would like to filter, sometimes columnwise, sometimes rowwise. Data looks like this: Allstar hsa.let.7a hsa.let.7a.1 hsa.let.7a.2 2

Re: [R] capturing a figure to PDF or Image

2011-09-06 Thread Sarah Goslee
Eran, > On Tue, Sep 6, 2011 at 8:53 AM, Eran Eidinger wrote: >> >> Thank you Sarah and David, >> I only used a simple plot, and remembered to dev.off(). >> attached is the session: >> >> > plot(c(1,2,3),c(3,2,4)) >> > jpeg("test.jpg") >> > dev.off() So you plotted something to your default devic

Re: [R] MuMIn Problem getting adjusted Confidence intervals

2011-09-06 Thread Kamil Bartoń
Hi Marcos, The 'adjusted CI' (based on the 'adjusted se estimator' as in section 4.3.3 of Burnham & Anderson 2002) cannot be calculated for 'lmer' model because it does not give df's for the coefficients. kamil Dnia 2011-08-30 12:00, r-help-requ...@r-project.org pisze: Message: 42 Date: Mon

[R] SAS code in R

2011-09-06 Thread Terry Therneau
-- Begin included message /* Combinations of Risk Factors */ data test2; input sex treat; DATALINES; 0 0 1 0 0 1 1 1 ; run; /* Survival estimates for the above combinations */ proc phreg data = pudat2; model withtime*wcens(0) = sex treat /ties = efron; baseline out = surv2 survival = survival l

Re: [R] list of all methods winthin an S4 class

2011-09-06 Thread Martin Morgan
On 09/06/2011 05:50 AM, Albert-Jan Roskam wrote: Hello, How can I generate an overview/vector of all the methods winthin an S4 class? Similar to dir() in this Python code: class SomeClass(): def some_method_1(self): pass def some_method_2(self): pass dir(SomeClass) ['__doc__', '_

Re: [R] excluding models during dredge and model averaging in MuMIn

2011-09-06 Thread Kamil Bartoń
> dredge(x, subset = !(X1 & (X2 | X3)) & !(X2 & X3) & !(X1 & X3)) see > help("Logic", "base") Dnia 2011-08-26 12:00, r-help-requ...@r-project.org pisze: -- Message: 157 Date: Fri, 26 Aug 2011 14:53:00 +0900 From: Andrew MacIntosh To:R-help@r-project.org Subject: [R]

Re: [R] How to understand the plotting of the cox.zph function

2011-09-06 Thread Terry Therneau
Under the assumption of PH, the graph would be a horizontal line at y= log(2.9) = coefficient of the model. That is, a constant hazard ratio. Your plot shows that there is no effect early (HR of 1) but there is an impact later. Terry T __ R-help@r-pro

Re: [R] Weights using Survreg

2011-09-06 Thread Terry Therneau
Survreg produces MLE estimates. For your second question, don't know what you are asking. Can you be more specific and detailed? ---begin included message -- Do you know if the parameters estimators are MLE estimators? One more question: In my case study I have failures that occured on differ

Re: [R] Parameters in Gamma Frailty model

2011-09-06 Thread Terry Therneau
I don't know how you got the output you did -- I cannot get a printout that says "gamma:1". Please provide the information specified in the posting guide, e.g., version of R, platform, loaded packages, the statements you typed to get this output, etc, Terry Therneau (author of survival)

[R] Generalizing call to function

2011-09-06 Thread . .
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.30

[R] list of all methods winthin an S4 class

2011-09-06 Thread Albert-Jan Roskam
Hello,   How can I generate an overview/vector of all the methods winthin an S4 class? Similar to dir() in this Python code: >>> class SomeClass():  def some_method_1(self):   pass  def some_method_2(self):   pass   >>> dir(SomeClass) ['__doc__', '__module__', 'some_method_1', 'some_method_2'] >>>

Re: [R] confusion matrix

2011-09-06 Thread Jean V Adams
Try the table() function. ?table For example, df <- data.frame(real=sample(0:1, 20, replace=T), pred=sample(0:1, 20, replace=T)) table(df) pred real 0 1 0 3 7 1 4 6 Jean Doussa wrote on 09/02/2011 08:46:42 PM: > > hi users > I have a data frame in with there are two colomns real

Re: [R] r-help volcano plot

2011-09-06 Thread Ben Bolker
Duny gmail.com> writes: > > Use the ggplot2 package in order to make a volcano plot! Check out the > following book for more information about the package: ggplot2: Elegant > Graphics for Data Analysis (Use R) by Hadley Wickham. ggplot2 is great for > creating professional graphics in no time.

Re: [R] ggplot2-grid/viewport and PNG

2011-09-06 Thread Paul Hiemstra
On 09/05/2011 09:59 AM, ashz wrote: > Dear All, > > The following code save my graphs as pdf: > pdf("j:/mix.pdf", width = 18, height = 16) > grid.newpage() > pushViewport(viewport(layout = grid.layout(3,1))) > vplayout <- function(x, y) > viewport(layout.pos.row = x, layout.pos.col = y) >

Re: [R] How do I define moving window fequency

2011-09-06 Thread Paul Hiemstra
On 09/06/2011 08:44 AM, azam jaafari wrote: > Hi list > > I want to define a moving window based on ferquency in a grid file. > is there a package for this? I found packages for moving window mean, median > or quantile. > > thanks > [[alternative HTML version deleted]] > > > > __

Re: [R] Re : Need more information about VGLM

2011-09-06 Thread Steve Lianoglou
Hi, On Tue, Sep 6, 2011 at 3:34 AM, privat NDOUTOUME wrote: > Hi Steven > > Thank you for taking the time to answer my question. > I want to reproduce the same function VGLM on C + +. That's why I wanted to > know where to find the algorithm in code VGLM R. > Opening the package GAMT CRAN, I foun

Re: [R] Receive "unable to load shared object RNetCDF.o" during R INSTALL of RNetCDF

2011-09-06 Thread Paul Hiemstra
Hi, You could try installing the ncdf package. This installed for my without any problems when RNetCDF failed. I suspect ncdf has very similar functionality, but i've only worked with ncdf. install.packages("ncdf") should do the trick... cheers, Paul On 09/05/2011 08:56 PM, David Brown wrote:

Re: [R] Hessian Matrix Issue

2011-09-06 Thread Paul Hiemstra
On 09/03/2011 08:22 PM, dave fournier wrote: > > I wonder if your code is correct? > > I ran your script until an error was reported. the data set > of 30 obs was > > > [1] 0 0 1 3 3 3 4 4 4 4 5 5 5 5 5 7 7 7 7 7 7 8 > 9 10 11 > [26] 12 12 12 15 16 > > I created a tiny AD Mo

Re: [R] Coloring Dirichlet Tiles

2011-09-06 Thread Felix Andrews
On 5 September 2011 06:59, baptiste auguie wrote: > Hi, > > Try this, > > d <- data.frame(x=runif(1e3, 0, 30), y=runif(1e3, 0, 30)) > d$z = (d$x - 15)^2 + (d$y - 15)^2 > > library(spatstat) > library(maptools) > > W <- ripras(df, shape="rectangle") > W <- owin(c(0, 30), c(0, 30)) > X <- as.ppp(d,

Re: [R] read.xls (gdata) problem

2011-09-06 Thread Gabor Grothendieck
On Tue, Sep 6, 2011 at 3:44 AM, Peter Engelbrecht wrote: > I've suddenly started seeing a consistent problem with read.xls. > > No matter what xls file I try I always get an error message of this type: > > Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method,  : >  Intermediate fil

Re: [R] Sweave : some comments disappear

2011-09-06 Thread Remko Duursma
Sorry about that - I did give an example that I thought was reproducible (it is here), but apparently wasn't. I suspect my problem might have to do with the 'highlight' package I am using - which I should have mentioned. I am using the latest version of R. remko

Re: [R] xtable with conditional formatting using \textcolor

2011-09-06 Thread eldor ado
I have a related question: dataframe df contains values like >df .. "\\textbf{ 0.644 }" .. and the line > print( xtable(df , sanitize.text.function = function(x){x})) converts them to .. & $\backslash$textbf\{ 0.644 \} & .. escaping both double backslashes and brackes. maybe somebody her

Re: [R] function censReg in panel data setting

2011-09-06 Thread Arne Henningsen
On 6 September 2011 07:51, Igors wrote: >>You chose a suitable solution for the first problem (NA in initial >>gradient). Unfortunately, the documentation of "censReg" is not very >>clear regarding starting values of panel tobit models. Please note >>that you have to specify 4 starting values: int

[R] How do I define moving window fequency

2011-09-06 Thread azam jaafari
Hi list   I want to define a moving window based on ferquency in a grid file. is there a package for this? I found packages for moving window mean, median or quantile.   thanks  [[alternative HTML version deleted]] __ R-help@r-project.org mail

Re: [R] Sweave : some comments disappear

2011-09-06 Thread Achim Zeileis
On Tue, 6 Sep 2011, Remko Duursma wrote: Dear R-helpers, when I have an R code chunk in a sweave file like this: <<>>= x <- 1:10 # this comment disapears x # this one does not! print(x) #mean mean(x) @ The first comment does not appear in the sweaved document, the second one does. How can

Re: [R] capturing a figure to PDF or Image

2011-09-06 Thread Berend Hasselman
eranid wrote: > > Thank you Sarah and David, > > I only used a simple plot, and remembered to dev.off(). > attached is the session: > >> plot(c(1,2,3),c(3,2,4))> jpeg("test.jpg")> dev.off()RStudioGD > 2 > sessionInfo()R version 2.13.1 (2011-07-08) > Put the statement jpeg("test.jpg")

Re: [R] How to create R executable?

2011-09-06 Thread Pariksheet
Thanks guys. I didn't know that R is interpreted language. Could you suggest good reference? My work is here to do analysis on Data stored on teradata warehouse and plot corresponding graphs. Any idea how to capture output in different image formats? -- View this message in context: http://r.7

[R] Sweave : some comments disappear

2011-09-06 Thread Remko Duursma
Dear R-helpers, when I have an R code chunk in a sweave file like this: <<>>= x <- 1:10 # this comment disapears x # this one does not! print(x) #mean mean(x) @ The first comment does not appear in the sweaved document, the second one does. How can this be? I have tried print=TRUE and keep

[R] read.xls (gdata) problem

2011-09-06 Thread Peter Engelbrecht
I've suddenly started seeing a consistent problem with read.xls. No matter what xls file I try I always get an error message of this type: Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method, : Intermediate file '/var/folders/cb/vvshkpm90lx_y2n69qlyw4z4gn/T//RtmpK50r4g/fi

[R] write.matrix row names vs sink vs capture.output

2011-09-06 Thread Mark Ebbert
Dear R gurus, I am trying to write several large matrices (~ 1GB) to separate files. I have learned that write.table is simply too slow for this task and was attempting to use write.matrix, but write.matrix does not have the ability to include row names in the output. Anyone know why that's the

Re: [R] function censReg in panel data setting

2011-09-06 Thread Igors
>You chose a suitable solution for the first problem (NA in initial >gradient). Unfortunately, the documentation of "censReg" is not very >clear regarding starting values of panel tobit models. Please note >that you have to specify 4 starting values: intercept, slope >parameter, variance of the ind

Re: [R] r-help volcano plot

2011-09-06 Thread Duny
Use the ggplot2 package in order to make a volcano plot! Check out the following book for more information about the package: ggplot2: Elegant Graphics for Data Analysis (Use R) by Hadley Wickham. ggplot2 is great for creating professional graphics in no time. If you look up stat_density in

Re: [R] Dealing with NA's in a data matrix

2011-09-06 Thread Daniel Malter
Please provide the data as self-contained code, as requested in the posting guide, so that helpers can directly paste it into R. Alternatively, you can provide the dilomaaethiops.txt. Best, Daniel Watching19 wrote: > > hello... I am trying to get this code to work, but as I get to the predict >

Re: [R] glm

2011-09-06 Thread Daniel Malter
y is the dependent variable, not a predictor or independent variable. since this is a binomial model, y should be 0/1 or, atypically, a proportion. HTH, Daniel Samuel Okoye wrote: > > Dear all, > > I am using glm with quasibinomial. What does the following error message > mean: > > Error in e