Re: [R] Splitting Area under curve into equal portions

2009-03-26 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Milton, Not quite, that would be an equal number of data points in each colour group. What I want is an unequal number of points in each group such that: sum(work[group.members]) is approximately the same for each group of data points. In the

Re: [R] boxplot in subgroups

2009-03-26 Thread Annette Heisswolf
Hei, the error message below just tells you that you have specified nine places along the axis where you want to have labels (i.e. at=1:9) but obviously you have only specified three labels (i.e. labels = c(C,M,S)). Thus, R is complaining that there are not enough labels for all positions.

Re: [R] using xyplot

2009-03-26 Thread Deepayan Sarkar
On 3/22/09, Santosh santosh2...@gmail.com wrote: Dear R-sians! I am trying generate a bunch of xyplots library(lattice) myPanel - function(x,y,xl=range(x),yl=range(y),...) { panel.xyplot(x,y,pch=20,col='blue',cex=0.7,xlim=xl,ylim=yl,...) panel.abline(v=0,

Re: [R] very fast OLS regression?

2009-03-26 Thread Thomas Lumley
On Wed, 25 Mar 2009, ivo welch wrote: thanks, dimitris. I also added Bill Dunlap's solve(qr(x),y) function as ols5. here is what I get in terms of speed on a Mac Pro: ols1 6.779 3.591 10.37 0 0 ols2 0.515 0.21 0.725 0 0 ols3 0.576 0.403 0.971 0 0 ols4 1.143 1.251 2.395 0 0 ols5 0.683 0.565

Re: [R] very fast OLS regression?

2009-03-26 Thread Thomas Lumley
On Wed, 25 Mar 2009, Ravi Varadhan wrote: Yes, Bert. Any least-squares solution that forms X'X and then inverts it is not to be recommended. If X is nearly rank-deficient, then X'X will be more strongly so. The QR decomposition approach in my byhand.qr() function is reliable and fast.

Re: [R] command to start a program (fortran code)

2009-03-26 Thread thoeb
Thank you! That's what I need! Tamara Hoebinger Uwe Ligges-3 wrote: If you want to integrate Fortran into R, see the manual Writing R Extensions. If you want to just call some external program (independent of the language it is written in) via the operating system, see ?system (and

Re: [R] How to separate huge dataset into chunks

2009-03-26 Thread Thomas Lumley
On Wed, 25 Mar 2009, Guillaume Filteau wrote: Hello Thomas, Thanks for your help! Sadly your code does not work for the last chunk, because its length is shorter than nrows. You just need to move the test to the bottom of the loop repeat{ chunk-read.table(conn,

Re: [R] upgrade to 2.5

2009-03-26 Thread Peter Dalgaard
John Sorkin wrote: Why do you wish to upgrade to 2.5, it is not the current release! You should upgrade to 2.8.1. John Because you are replying to a thread that started in May 2007... -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics

Re: [R] [.data.frame and lapply

2009-03-26 Thread Romain Francois
Hi, This is a bug I think. [.data.frame treats its arguments differently depending on the number of arguments. d - data.frame(x = rnorm(5), y = rnorm(5), z = rnorm(5) ) d[, 1:2] x y 1 0.45141341 0.03943654 2 -0.87954548 1.83690210 3 -0.91083710 0.22758584 4

Re: [R] Fortran-90 and R

2009-03-26 Thread Peter Dalgaard
mau...@alice.it wrote: I have some code in Fortran-90 that outperforms my R implementation of the same algorithm (in terms of speed). I wonder whether it is possible to interface R with Fortran-90. that is would like to call a Fortran routine from my R script, passing to the Fortran routine

Re: [R] Extreme AIC in glm(), perfect separation, svm() tuning

2009-03-26 Thread Maggie Wang
Dear List, With regard to the question I previously raised, here is the result I obtained right now, brglm() does help, but there are two situations: 1) Classifiers with extremely high AIC (over 200), no perfect separation, coefficients converge. in this case, using brglm() does help! It

[R] (Interpretation) VGAM - FRECHET 3 parameters by maximum likelihood estimation for

2009-03-26 Thread Maithili Shiva
Dear R Helpers This is the R code (which I have slightly changed) I got in VGAM package for estimating the parameters of FRECHET. _ y = rfrechet(n - 100, shape=exp(exp(0))) #(A) fit3 = vglm(y ~ 1,

Re: [R] Splitting Area under curve into equal portions

2009-03-26 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Nathan S. Watson-Haigh Sent: Wednesday, March 25, 2009 10:59 PM To: milton ruser Cc: r-help@r-project.org Subject: Re: [R] Splitting Area under curve into equal portions

Re: [R] Extreme AIC in glm(), perfect separation, svm() tuning

2009-03-26 Thread ratna ghosal
Hi all, I am very new to R, thus have some basic doubts regarding the output of the analysis. I cannot understand that how the degrees of freedom gets calculated in a Mixed Effect Model. Suppose I use the following command: mod1 - lme(D. ~ S., data=dat, random = ~S.|Female), then the output

Re: [R] Piecewise

2009-03-26 Thread vito muggeo
Hi, In addition to useful Ben's suggestion, you have a, possibly simpler, alternative. If you are willing to assume to know the power of you piecewise polynomial (beta parameter according to code of Ben) you can use the package segmented. Using the data generated by Ben in his previous

Re: [R] very fast OLS regression?

2009-03-26 Thread Bernardo Rangel Tura
On Wed, 2009-03-25 at 22:11 +0100, Dimitris Rizopoulos wrote: check the following options: ols1 - function (y, x) { coef(lm(y ~ x - 1)) } ols2 - function (y, x) { xy - t(x)%*%y xxi - solve(t(x)%*%x) b - as.vector(xxi%*%xy) b } ols3 - function (y, x) {

[R] R: Fortran-90 and R

2009-03-26 Thread mauede
I do hope the chapte about Interfacing R and Fortran is sufficient. I have a heavy load of work from two projects and no previous experience in either cases (analysis packages, algorithms, and so on ...). I am a postdoc. Thank you. Maura -Messaggio originale- Da: Peter Dalgaard

[R] loop problem

2009-03-26 Thread Muhammad Azam
Dear R members I have a problem regarding storing the lists. Let L=number of distinct values of any predictor (say L=5) P=number of predictors (say P=20) g1 - c() for(i in 1:P){ if(L 1){ for(j in 1:(L-1)){ g - g1[j] - g } } g2[]=sort.list(g1)

Re: [R] [.data.frame and lapply

2009-03-26 Thread baptiste auguie
Hi, I got an off-line clarification from Martin Morgan which makes me believe it's not a bug (admittedly, I was close to suggesting it before). Basically, [ is a .Primitive, for which the help page says, The advantage of .Primitive over .Internal functions is the potential efficiency

Re: [R] Competing risks Kalbfleisch Prentice method

2009-03-26 Thread Arthur Allignol
I don't think there is a package to do that. But you could have a look at ?predict.crr. Best regards, Arthur Allignol Eleni Rapsomaniki wrote: Dear R users I would like to calculate the Cumulative incidence for an event adjusting for competing risks and adjusting for covariates. One

Re: [R] R: Fortran-90 and R

2009-03-26 Thread Dieter Menne
mauede at alice.it writes: I do hope the chapte about Interfacing R and Fortran is sufficient. I have a heavy load of work from two projects and no previous experience in either cases (analysis packages, algorithms, and so on ...). I am a postdoc. In that case, think hard if you are not

Re: [R] Manual sort in a for loop

2009-03-26 Thread Simon Pickett
I would suggest avoiding the function ?assign inside a loop. I used top use this until someone here kindly pointed out that it was much easier to catch the data of interest in a list... eg. df.list - vector(list, length(10)) for (i in 1:10)}

Re: [R] loop problem

2009-03-26 Thread Jim Lemon
Muhammad Azam wrote: Dear R members I have a problem regarding storing the lists. Let L=number of distinct values of any predictor (say L=5) P=number of predictors (say P=20) g1 - c() for(i in 1:P){ if(L 1){ for(j in 1:(L-1)){ g - g1[j] - g } }

[R] Sort by timestamp

2009-03-26 Thread j.k
#Good morning alltogheter. I'm using R for a short time to analyse TimeSeries and I have the following Problem: #I have a bunch of Time Series: #First of all I import them from a txt File data.input01 -read.csv(./LD/20081030.txt, header = TRUE, sep = ;, quote=\, dec=,, fill = TRUE,

Re: [R] Density estimation: scale back for calendar time

2009-03-26 Thread Pradeep Raje
Thanks David for your response.I had done that. Problem is not with the computations, but in the interpretation. Assume that x ordinates are 'time' [1:3472], and y are associated parameter values. Now density gives me 512/1024/2048 x-ordinates, of which some (7 to be precise) are negative. What do

[R] Getting started,

2009-03-26 Thread gug
Hello, First of all, I'm new to R and I don't have anyone who already knows the language to ask for tips, so please excuse my ignorance. I'm trying to download data direct from the Federal Reserve statistics website and graph it, using the following: #This downloads the data from the

Re: [R] R: Fortran-90 and R

2009-03-26 Thread Gavin Simpson
On Thu, 2009-03-26 at 11:01 +0100, mau...@alice.it wrote: I do hope the chapte about Interfacing R and Fortran is sufficient. I have a heavy load of work from two projects and no previous experience in either cases (analysis packages, algorithms, and so on ...). I am a postdoc. Ranjan

[R] Warning messages from quantreg

2009-03-26 Thread Daren Tan
Hi, I keep getting warning messages from quantreg about tiny diagonals replaced with Inf when calling blkfct. Is there any cause for concern like improper codes, NAs in datasets or missing values ? Thanks Stanley __ R-help@r-project.org mailing list

[R] same value in column--delete

2009-03-26 Thread Duijvesteijn, Naomi
Hi Readers, I have a question. I have a large dataset and want to throw away columns that have the same value in the column itself and I want to know which column this was. For example x-data.frame(id=c(1,2,3), snp1=c(A,G, G),snp2=c(G,G,G),snp3=c(G,G,A)) x

[R] Using JRclient in java application

2009-03-26 Thread Tomasz Spulak
Hi, I'm wondering if anyone can help me. I'm writing java application that using JRclient and Rserve to communicate with R. I want to get response from R for command: x - rbind(matrix(rnorm(100, sd = 0.3), ncol = 2),matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2)) kmeans(x, 2, 22, algorithm =

[R] Centring variables in Cox Proportional Hazards Model

2009-03-26 Thread Laura Bonnett
Dear All, I am contemplating centering the covariates in my Cox model to reduce multicollinearity between the predictors and the interaction term and to render a more meaningful interpretation of the regression coefficient. Suppose I have two indicator variables, x1 and x2 which represent age

Re: [R] Getting started,

2009-03-26 Thread jim holtman
In answer to your first question, your statement should be: date_vec = as.Date(data_download[1:50,1],%m/%d/%Y) Notice the capital Y; lower case says the year is only 2 digits, so you were pickup up the '19' from the date. Use 'plot(..., type='l')' for a line plot. Your data is being read in as

Re: [R] same value in column--delete

2009-03-26 Thread jim holtman
Try this: x id snp1 snp2 snp3 1 1AGG 2 2GGG 3 3GGA str(x) 'data.frame': 3 obs. of 4 variables: $ id : num 1 2 3 $ snp1: Factor w/ 2 levels A,G: 1 2 2 $ snp2: Factor w/ 1 level G: 1 1 1 $ snp3: Factor w/ 2 levels A,G: 2 2 1 # test for which

Re: [R] Manual sort in a for loop

2009-03-26 Thread Steve Murray
Thanks all - I'm fairly new to R, so I was oblivious to the pros and cons of using a data frame as opposed to a list! The 'get' command also seemed to work successfully. Thanks again, Steve _ 25GB of FREE Online Storage – Find

Re: [R] Getting started,

2009-03-26 Thread Gabor Grothendieck
Try this: library(zoo) library(chron) my.url - http://www.federalreserve.gov/releases/h15/data/Business_day/H15_ED_M1.txt; z - read.zoo(my.url, skip = 8, header = TRUE, sep = ,, na.strings = ND, strip.white = TRUE, FUN = as.chron) plot(z[1:50,]) # or to plot with NAs interpolated

Re: [R] same value in column--delete

2009-03-26 Thread Gustaf Rydevik
On Thu, Mar 26, 2009 at 12:15 PM, Duijvesteijn, Naomi naomi.duijveste...@ipg.nl wrote:   Hi Readers,   I have a question.   I have a large dataset and want to throw away columns that have the same   value in the column itself and I want to know which column this was.   For example  

Re: [R] Centring variables in Cox Proportional Hazards Model

2009-03-26 Thread Frank E Harrell Jr
Laura Bonnett wrote: Dear All, I am contemplating centering the covariates in my Cox model to reduce multicollinearity between the predictors and the interaction term and to render a more meaningful interpretation of the regression coefficient. Suppose I have two indicator variables, x1 and x2

Re: [R] same value in column--delete

2009-03-26 Thread Patrizio Frederic
this works which.is.not.unique - apply(x,2,function(x)ifelse(length(unique(x))==1,F,T)) x[,which.is.not.unique] patrizio 2009/3/26 Duijvesteijn, Naomi naomi.duijveste...@ipg.nl:   Hi Readers,   I have a question.   I have a large dataset and want to throw away columns that have the same

Re: [R] R: Fortran-90 and R

2009-03-26 Thread jgarcia
Perhaps you should consider also the possibility of simply export the data from the R workspace to the system and make your fortran code to read these system files. On Thu, 2009-03-26 at 11:01 +0100, mau...@alice.it wrote: I do hope the chapte about Interfacing R and Fortran is sufficient. I

[R] Column name assignment problem

2009-03-26 Thread Steve Murray
Dear all, I'm trying to assign a name to the fourth column whilst using 'assign', but keep encountering errors. What have I done wrong?! assign(colnames(c(paste(arunoff_,table_year, sep=)[4]), COUNT)) Error in if (do.NULL) NULL else if (nc 0) paste(prefix, seq_len(nc), : argument is not

Re: [R] same value in column--delete

2009-03-26 Thread Uwe Ligges
Patrizio Frederic wrote: this works which.is.not.unique - apply(x,2,function(x)ifelse(length(unique(x))==1,F,T)) x[,which.is.not.unique] or you simplify that idea and say x[, apply(x, 2, function(x) length(unique(x)) 1)] Uwe Ligges patrizio 2009/3/26 Duijvesteijn, Naomi

[R] problem with choose.files command interactive functions

2009-03-26 Thread Shay O'Farrell
Hi all, I’m new to R, and I’m having a small but annoying problem with the choose.files command, using version 2.8.1 in Windows XP. I am holding my data text files in C:\\Data\\, and I’m writing a short script that first resets the default directory to this directory, then allows me to

Re: [R] problem with choose.files command interactive functions

2009-03-26 Thread Duncan Murdoch
On 3/26/2009 9:09 AM, Shay O'Farrell wrote: Hi all, I’m new to R, and I’m having a small but annoying problem with the choose.files command, using version 2.8.1 in Windows XP. I am holding my data text files in C:\\Data\\, and I’m writing a short script that first resets the default

[R] Plot the highest point in a contour plot

2009-03-26 Thread Thomas Levine
I'm plotting contour plots with contourplot. which.max gives me the index of the highest point of a matrix. I can find the point in the matrix from here, convert it to a point on a graph and add it with points, but you'd think someone's already written this. How do I plot the highest point in a

[R] Minimal R-installation (and it's size)

2009-03-26 Thread Oliver Bandel
Hello, for very small systems (embedded devices) I think about a minimalistic R-installation. When I look at the R-binary, it has just 5472 Bytes of size. I think this will only be a small initial program, that afterwards starts other executables and also will load standard/base package(s).

[R] Some install package fixes for Ubuntu Hardy

2009-03-26 Thread John C Nash
I encountered some failures in using install.packages() to install rgl and rJava in some of my (multiple) Ubuntu Hardy systems. A quick search of the 'Net did not show any debian packages for these. The install.packages messages said header or other files were missing, suggesting path and

Re: [R] Competing risks Kalbfleisch Prentice method

2009-03-26 Thread Eleni Rapsomaniki
Thank you for your reply. It wasn't too hard to code actually, which is probably why it doesn't have a special package dedicated to it. The results are almost identical to Fine Gray regression model. The problem with the latter is that my colleagues are not convinced that the model assumptions

Re: [R] Competing risks Kalbfleisch Prentice method

2009-03-26 Thread Ravi Varadhan
Hi Eleni, I would like to take a look at your R function for obtaining the cumulative incidence function (CIF) from individual Cox models for cause-specific hazards (CSH). Does your code predict the CIF (with pointwise confidence intervals and global confidence bands) for different sub-groups?

[R] Travel funding for DSC/useR 2009 for young researchers at U.S. institutions

2009-03-26 Thread luke
*** Travel and Accommodation Support *** [Deadline extended to April 15, 2009] Funds from the U.S. National Science Foundation may be available to provide partial support for travel and accommodation for some graduate students and junior faculty at U.S.

[R] programming creating different functions in a loop

2009-03-26 Thread Florin Maican
Hi I want to create the following functions in a loop f1-function(x){x+1} f2-function(x){x+2} f3-function(x){x+3} Output f1(2)=3 f2(2)=4 f3(2)=5 I tried to create the in a loop as bellow but I get wrong on answers because the value of i change for(i in 1:3){

[R] package installation on OSX --- suggestion

2009-03-26 Thread ivo welch
dear R experts: I am trying to install packages in OSX, R 2.8.1. Since I do this about every 2 years, I have completely forgotten it. However, this should not be difficult: http://wiki.r-project.org/rwiki/doku.php?id=getting-started:installation:packages nice document. beautiful method.

[R] arima, xreg, and the armax model

2009-03-26 Thread Marc Vinyes
Hello all, I'm having fun again with the arima function. This time I read in: http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm It has recently been suggested (by a reliable source) that using xreg in arima() does NOT fit an ARMAX model [insert slap head icon here]. This will

[R] Tables

2009-03-26 Thread skrug
Hi, I am just starting using R. Hence, sorry for asking probably rather easy questions. I used read.table to bring an .txt Table to R. Unfortunately the columns do not have the same length. I tried fill=TRUE, to fill the blank space with na. In a certain kind of way it worked, but befor

Re: [R] Tables

2009-03-26 Thread jim holtman
How are you sure it moved the data? What is the column separator that you have? Is it just 'white space' as opposed to a tab or comma? It you have a CSV file with a separator, the system knows where the columns are. If it sees 'a b c' and then 'a c' as the next row, 'c' will be in

[R] installing contributed programs

2009-03-26 Thread David Covell
Dear R-help, I'm sure this is contained within the documentation, but I have not yet located it (with good effort nonetheless). I am attempting to install the binary for randomForests. After unpacking the zip, I extracted the contents to my R-2.8.1 folder. However, when I try to execute the

[R] the by function

2009-03-26 Thread Melissa2k9
Hey, I have a dataframe with subjects who have watched films. The variables of interest are Pixel number and Temperature on the face. For each subject there are 8 films, for each film for each subject I need to measure the mean number of pixels then merge this vector with the data frame. I have

[R] Odp: Tables

2009-03-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 26.03.2009 16:39:18: Hi, I am just starting using R. Hence, sorry for asking probably rather easy questions. I used read.table to bring an .txt Table to R. Unfortunately the columns do not have the same length. I tried fill=TRUE, to fill the

Re: [R] programming creating different functions in a loop

2009-03-26 Thread luke
for() does not creae separete bindings for the index each iteration, so the function bodies see the global binding of i, which in this case will be the final value. One possible solution is to use local(), e.g. for(i in 1:3){ assign(paste(f,i,sep=), local({ k - i #

[R] standard plot font

2009-03-26 Thread Martin Batholdy
hi, I was wondering what font-type R uses in plots (title etc.). Is that depending on the system you are working on? (working with mac OS) thanks for help! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] How to rotate axis labels? 2009

2009-03-26 Thread Jonas Stein
Hi, while searching for a solution i found many solutions in the internet. But the postings seemed to be many years old and the workaround was a dirty hack like this: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f Now its the year 2009 and there might

[R] Odp: installing contributed programs

2009-03-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 26.03.2009 15:11:32: Dear R-help, I'm sure this is contained within the documentation, but I have not yet located it (with good effort nonetheless). I am attempting to install the binary for randomForests. After unpacking the zip, I extracted

Re: [R] How to rotate axis labels? 2009

2009-03-26 Thread Uwe Ligges
Jonas Stein wrote: Hi, while searching for a solution i found many solutions in the internet. But the postings seemed to be many years old and the workaround was a dirty hack like this: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f Now its the year

Re: [R] standard plot font

2009-03-26 Thread Uwe Ligges
Martin Batholdy wrote: hi, I was wondering what font-type R uses in plots (title etc.). Is that depending on the system you are working on? (working with mac OS) In fact, it is dependent on the *Device* you are plotting to. See ?Devices and the help page for the device you are going to

Re: [R] How to rotate axis labels? 2009

2009-03-26 Thread Usuario R
Hi, What you want is done with argument srt of par function. See ?par and then look for srt argument. Regards 2009/3/26 Jonas Stein n...@jonasstein.de Hi, while searching for a solution i found many solutions in the internet. But the postings seemed to be many years old and the workaround

Re: [R] programming creating different functions in a loop

2009-03-26 Thread Florin Maican
Thanks Luke! It works! My mistake was that I used local binding only for i and not for the whole function. Best regards, Florin On Thu, 26 Mar 2009 10:57:21 -0500 (CDT) l...@stat.uiowa.edu wrote: for() does not creae separete bindings for the index each iteration, so the function bodies

Re: [R] installing contributed programs

2009-03-26 Thread Duncan Murdoch
On 3/26/2009 10:11 AM, David Covell wrote: Dear R-help, I'm sure this is contained within the documentation, but I have not yet located it (with good effort nonetheless). I am attempting to install the binary for randomForests. After unpacking the zip, I extracted the contents to my R-2.8.1

Re: [R] programming creating different functions in a loop

2009-03-26 Thread Greg Snow
Anytime that you are tempted to use assign and a loop, you should consider using lapply (or sapply) and a list instead. Consider this alternative: f - lapply( 1:3, function(i){ force(i); function(x) x+i} ) f[[1]](3) [1] 4 f[[2]](10) [1] 12 f[[3]](0) [1] 3 sapply( f, function(f) f(1:10)

Re: [R] How to rotate axis labels? 2009

2009-03-26 Thread Ben Bolker
Usuario R r.user.spain at gmail.com writes: Hi, What you want is done with argument srt of par function. See ?par and then look for srt argument. Regards To clarify: if you just want labels rotated parallel/perpendicular to axes, then par(las) will do everything you need. If you

Re: [R] Way to rotate a histogram?

2009-03-26 Thread Mike Lawrence
In case anyone is still interested, a slight improvement is to plot both density and normal distributions on top of the empirical histogram (previous version plotted only density): library(ggplot2) test_data-rnorm(100,mean=10,sd=4) a = data.frame(obs = test_data,condition = 'None') p1 = ggplot(

Re: [R] programming creating different functions in a loop

2009-03-26 Thread Bert Gunter
... but perhaps even more straightforward is: f - function(i,x)x+i Of course, we don't know exactly what the poster is after with his rather arcane construction, so this may not suit. But you know the rule: if the question requires a complex, tricky answer, it's probably the wrong question.

[R] Locale problem between WinXP and Ubuntu

2009-03-26 Thread Harsh
Hi R list, I have a peculiar problem in trying to Sweave a document in Ubuntu. The error message I get is the following: Error in gsub(\\n, _, dd_name_level_nominal[k, 1], perl = TRUE) : input string 1 is invalid in this locale dd_name_level_nominal[k, 1] is a character object. I initially

Re: [R] programming creating different functions in a loop

2009-03-26 Thread Greg Snow
But wrong questions requiring complicated answers are sometimes more fun :-). One difference though is in my last example, your function will give a different answer for f(1:3, 1:10), but for the simpler cases, yours is probably the better. -- Gregory (Greg) L. Snow Ph.D. Statistical Data

Re: [R] programming creating different functions in a loop

2009-03-26 Thread Bert Gunter
Good point, Greg. So to handle i as a vector, you'd probably want something like f - function(x,i)outer(x,i,+) -- Bert Bert Gunter Genentech Nonclinical Biostatistics 650-467-7374 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] Density estimation: scale back for calendar time

2009-03-26 Thread David Winsemius
Pradeep Raje raje.pradeep at gmail.com writes: Thanks David for your response.I had done that. But not shared it. Problem is not with the computations, but in the interpretation. Assume that x ordinates are 'time' [1:3472], and y are associated parameter values. Now density gives me

Re: [R] Competing risks Kalbfleisch Prentice method

2009-03-26 Thread Eleni Rapsomaniki
Ravi, I agree with you, that the Fine Gray method does much more than calculating the cumulative incidence. The Kalbfleisch Prentice formula relies on the strong assumption that the coefficients for the cause specific hazard models are valid in the presence of competing risks. You will find my

Re: [R] problem with choose.files command interactive functions

2009-03-26 Thread O'Farrell, Shay
Perfect. That's fixed the problem. Thanks very much for the advice. Shay If you don't specify where to open the dialog, it will open in the last location where it was opened. This saves time if you are running it more than once, because often you

[R] Conerned about Interfacing R with Fortran

2009-03-26 Thread mauede
I am reading the manual sections illustrating how to call a Fortran subroutine from R. I feel uneasy at the explicit statement about .Fortran interface working with Fortran 77. I would like to call a Fortran-90 subroutine from my R script. Is that supported at all ? Thank you, Maura tutti i

Re: [R] boxplot in subgroups

2009-03-26 Thread Pooja Jain
Thank you very much Annette, With your help I can do exactly what I wanted to. Best wishes, -Pooja On 26 Mar 2009, at 06:59, Annette Heisswolf wrote: Hei, the error message below just tells you that you have specified nine places along the axis where you want to have labels (i.e. at=1:9)

[R] Reading in files with variable parts to names

2009-03-26 Thread Steve Murray
Dear all, I'm trying to read in a whole directory of files which have two variable parts to the file name: year and month. E.g. comp198604.asc represents April of 1986 - 'comp' is fixed in each case. Years range between 1986 to 1995 and months are between 1 and 12. Just to be clear, there

[R] Analogy for %in% for the whole columns (rather than individual values)

2009-03-26 Thread Dimitri Liakhovitski
Hello! I have a matrix a with 2 variables (see below) that contain character strings. I need to create a 3rd variable that contains True if the value in column x is equal to the value in column y. The code below does it. a-data.frame(x=c(john, mary, mary, john),y=c(mary,mary,john,john))

Re: [R] Analogy for %in% for the whole columns (rather than individual values)

2009-03-26 Thread Jorge Ivan Velez
Dear Dimitri: Try this: a-data.frame(x=c(john, mary, mary,john),y=c(mary,mary,john,john)) a$x-as.character(a$x) a$y-as.character(a$y) a$TEST-apply(a,1,function(x) x[1]==x[2]) a See ?apply for more details. HTH, Jorge On Thu, Mar 26, 2009 at 2:48 PM, Dimitri Liakhovitski

Re: [R] Reading in files with variable parts to names

2009-03-26 Thread baptiste auguie
Hi, If your directory contains only files you want to load anyway, then list.files() is your friend, list.files(pattern = comp) # or pattern =.asc for example If you do need to create the names manually, then you could create the combinations with expand.grid, as in, do.call(paste,

Re: [R] Reading in files with variable parts to names

2009-03-26 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
Try this to generate your year/month combinations: expand.grid(year=1986:1995, month=1:12) Obviously you'll have to format the months. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steve Murray Sent: Thursday, March 26, 2009

Re: [R] Analogy for %in% for the whole columns (rather than individual values)

2009-03-26 Thread Fredrik Karlsson
Hi Dimitri, What about this: with(a, x == y) - a$equal a xy equal 1 john mary FALSE 2 mary mary TRUE 3 mary john FALSE 4 john john TRUE /Fredrik On Thu, Mar 26, 2009 at 7:48 PM, Dimitri Liakhovitski ld7...@gmail.comwrote: Hello! I have a matrix a with 2 variables (see below)

Re: [R] Reading in files with variable parts to names

2009-03-26 Thread Dieter Menne
Steve Murray smurray444 at hotmail.com writes: I'm trying to read in a whole directory of files which have two variable parts to the file name: year and month. E.g. comp198604.asc represents April of 1986 - 'comp' is fixed in each case. Years range between 1986 to 1995 and months are

Re: [R] Reading in files with variable parts to names

2009-03-26 Thread Jorge Ivan Velez
Dear Steve, Another option would be using list() to storage your files into R: # Year/Month year - 1986:1995 month - sprintf(%02d, 1:12) # Names Files - paste(year,month,'.asc',sep=) # Data ListFiles - sapply(Files, read.table, header=TRUE,sep=) # To access the fist file ListFiles[[1]] #for

Re: [R] Analogy for %in% for the whole columns (rather than individual values)

2009-03-26 Thread Dimitri Liakhovitski
Thank you very much! I tried %in% and it did not work. However == works! Thank you! On Thu, Mar 26, 2009 at 3:05 PM, Fredrik Karlsson dargo...@gmail.com wrote: Hi Dimitri, What about this: with(a, x == y) - a$equal a x    y equal 1 john mary FALSE 2 mary mary  TRUE 3 mary john

[R] Hazard rate estimation by smoothing baseline cumulative hazard from Cox model - Was: RE: Competing risks Kalbfleisch Prentice method

2009-03-26 Thread Ravi Varadhan
Hi Eleni, I will take a look at this. I have some preliminary comments. You estimate the hazard function from the Cox model baseline cumulative hazard by differencing successive jumps. It seems that a better approach might be to estimate this using kernel smoothing, i.e. as the derivative of

[R] ICC question: Interrater and intrarater variability (intraclass correlation coefficients)

2009-03-26 Thread Tal Galili
Hello dear R help group. I encountered this old thread (http://tinyurl.com/dklgsk) containing the a similar question to the one I have, but left without an answer. I am and hoping one of you might help. A simplified situation: I have a factorial design (with 2^3 experiment combinations), for

[R] Bug? FORTTRAN help

2009-03-26 Thread rkevinburton
I was feeling masochistic the other day and we have been having some wierd memory problems so I started digging into the source for L-BFGS-B. In the lbgfsb.c file I see the following code: /* Cholesky factorization of (2,2) block of wn. */ F77_CALL(dpofa)(wn[*col + 1 + (*col + 1) *

[R] VGAM and cnstraints

2009-03-26 Thread Raffaello Vardavas
Dear R-Users, I am learning how to use the package VGAM to do multinomial regressions. I have worked through the example provided by UCLA stats group: http://www.ats.ucla.edu/stat/r/dae/mlogit.htm However - what I would like to learn is how to use the constraint option. So in the example

[R] ApEn (Approximate Entropy), Total Corr, Information Interaction

2009-03-26 Thread Vishal Belsare
Is there any existing implementation in R/S of : 1] Pincus Kalman's approximate entropy (ApEn) measure 2] Total Correlation / Multiinformation 3] Information Interaction A search doesn't quite reveal anything, but I'd be keen to not reinvent in case someone has worked on it. Many thanks in

[R] pgmm (Blundell-Bond) sample needed

2009-03-26 Thread ivowel
Dear R Experts--- Sorry for all the questions yesterday and today. I am trying to use Yves Croissant's pgmm function in the plm package with Blundell-Bond moments. I have read the Blundell-Bond paper, and want to run the simplest model first, d[i,t] = a*d[i,t-1] + fixed[i] + u[i,t] . no

Re: [R] Column name assignment problem

2009-03-26 Thread Tal Galili
Way are you taking the forth argument of the paste ?paste(arunoff_,table_year, sep=)[4] Either way, way not use something like: colnames(x)[column to change] - text, or pasted text Cheers, Tal On Thu, Mar 26, 2009 at 2:33 PM, Steve Murray smurray...@hotmail.comwrote: Dear all, I'm

[R] for Interaction of continous var and categorical var, any way approach the categorical var to continous ?

2009-03-26 Thread Yong Wang
Dear list, This is NOT a techical question ragrding use of R. I have a linear model where the response variable is neigborhood safety . It is projected poverty deteriorate safety and number of officers per thousand residents improve safety. The focal hypothesis is poverty poses less safety

Re: [R] ApEn (Approximate Entropy), Total Corr, Information Interaction

2009-03-26 Thread Stephan Kolassa
Hi Vishal, re 1]: Ben Bolker very kindly shared an R reimplementation of Kaplan's Matlab code a little while ago: http://www.nabble.com/Approximate-Entropy--to21144062.html#a21149402 Best wishes Stephan Vishal Belsare schrieb: Is there any existing implementation in R/S of : 1] Pincus

[R] R 2.8.1 and 2.9 alpha crash when running survest of Design package

2009-03-26 Thread Nguyen Dinh Nguyen
Dear Prof Harrell and everyone, My PC: Window XP service pack 3 and service pack 2 R version 2.8.1 and 2.9 alpha For the last 3 days, after updating R, my two computers have been facing problems when running existing and runable R commands that involves with Design package I attempt

[R] [R-pkgs] New CRAN Package: WriteXLS

2009-03-26 Thread Marc Schwartz
A new package called WriteXLS (Version 1.5.0), containing a single function of the same name, is now available via CRAN. The package is made available under the GPL, version =2. The function is based upon a Perl script that I have previously posted on r-help, now wrapped in R for

[R] Snow Parallel R: makeCluster with more nodes than available

2009-03-26 Thread Ubuntu Diego
Hi all, I would like to know what would happen if using snow I create a cluster of size 50, for example using makeCluster(50,type='SOCK') on a machine with 2 Cores and run a function. Does snow run 25 and 25 functions on each of my 2 real processors or it just run 50 functions in one

[R] Trellis barchart help

2009-03-26 Thread jimdare
Hi, I apologise if this sounds like a really simple problem. I have a time-series data set with two columns of data: Catch and TACC. I want Catch plotted as a barchart and TACC plotted on the same graph as a series of points with an overlaying a line. I have created the code for a barchart

  1   2   >