### Re: [R] Beyond double-precision?

Thanks Berwin, Spencer, and Gabor!!! Berwin A Turlach wrote: G'day all, On Sat, 09 May 2009 08:01:40 -0700 spencerg spencer.gra...@prodsyse.com wrote: The harmonic mean is exp(mean(logs)). Therefore, log(harmonic mean) = mean(logs). Does this make sense? I think

### Re: [R] Comparing COXPH models, one with age as a continuous variable, one with age as a three-level factor

?anova.coxph will tell you that there's an additional parameter, test, taking values F, Cp, or Chisq which instructs the anova method to perform the stated test comparing the two models and spit out a p- value (for F and Chisq at least). example(anova.chisq) provides some examples. Cheers,

### [R] What does it mean by skip=2 and skip=7?

Can anyone tell me what is skip=2, skip =7 and %in% mean here? fromcsv=read.csv ('2_2005_top200_postdoc.csv',header=FALSE,skip=7,stringsAsFactors=FALSE) fromreadxls = read.xls ('2_2005_top200_postdoc.xls',stringsAsFactors=FALSE,header=FALSE,skip=2) fromreadxls = fromreadxls[fromreadxls$V7

### [R] Sweave \Sexpr{} advice please

Dear List, First off, my deepest gratitude to the Sweave developers: this tool has improved my quality greatly. A question in my work I use \Sexpr{} statements scalar values and the xtable package for all manner of tables. What I'd like to do is to use a vector inline, rather than a whole

### [R] how to get design matrix?

How do you get the design matrix R used when calculating ANOVA? -- View this message in context: http://www.nabble.com/how-to-get-design-matrix--tp23464638p23464638.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

### Re: [R] plm: plm.data vs pdata.frame

Stephen: I am trying to use the plm package for panel econometrics. I am just trying to get started and load my data. Look at the Journal of Statistical Software paper that introduces the plm package: http://www.jstatsoft.org/v27/i02/ It seems from most of the sample documentation that

### [R] Traceback NA's to their first appearance

Hello, I've written a relatively complex interconnected population model in R. When changing a certain parameter, the outputs end up containing NA's. I would like to find out, in which step the model (in form of a loop) starts to produce NA's. Does anyone know how to achieve this? Since it

### [R] Predictive Analytics Seminar: May 27-28, New York City

Hi all, I wanted to let you know about our training seminar on predictive analytics - coming May, Oct, and Nov in NYC, Stockholm, DC and other cities. This is intensive training for marketers, managers and business professionals to make actionable sense of customer data by predicting buying

### Re: [R] Sweave \Sexpr{} advice please

Kyle Matoba kmmatoba at ucdavis.edu writes: A question in my work I use \Sexpr{} statements scalar values and the xtable package for all manner of tables. What I'd like to do is to use a vector inline, rather than a whole separate table. Something like: % Sweave block: = covmat -

### Re: [R] What does it mean by skip=2 and skip=7?

Tung86 wyutung at gmail.com writes: Can anyone tell me what is skip=2, skip =7 and %in% mean here? fromcsv=read.csv ('2_2005_top200_postdoc.csv',header=FALSE,skip=7,stringsAsFactors=FALSE) Did you check the docs? skipinteger: the number of lines of the data file to skip before

### Re: [R] Sweave \Sexpr{} advice please

Hi Kyle, First off, my deepest gratitude to the Sweave developers: this tool has improved my quality greatly. A question in my work I use \Sexpr{} statements scalar values and the xtable package for all manner of tables. What I'd like to do is to use a vector inline, rather than a whole

### Re: [R] Spatstat

Richard Chirgwin wrote: Hi all, I am trying to install Spatstat on OpenSUSE 11.1. install.packages(spatstat, dependencies = TRUE) fails on the basis of various compiler packages (full message below). I have gcc version 4.3.2, which should include gfortran and g++ - so I'm not

### Re: [R] sqlSave()

Felipe Carrillo mazatlanmexico at yahoo.com writes: I have created a MS Access table named 'PredictedValues' through the statement below: myDB - odbcConnectAccess(C:/Documents and Settings/Owner/Desktop/Rpond Farming.mdb,uid=admin,pwd=) sqlSave(myDB,PredictedValues,rownames=FALSE)

### Re: [R] Traceback NA's to their first appearance

On 10/05/2009 1:01 AM, Benjamin Leutner wrote: Hello, I've written a relatively complex interconnected population model in R. When changing a certain parameter, the outputs end up containing NA's. I would like to find out, in which step the model (in form of a loop) starts to produce NA's.

### Re: [R] Overloading some non-dispatched S3 methods for new classes

On Sat, 2009-05-09 at 20:50 +0200, Carlos J. Gil Bellosta wrote: Hello, I am building a package that creates a new kind of object not unlike a dataframe. However, it is not an extension of a dataframe, as the data themselves reside elsewhere. It only contains metadata. I would like to be

### Re: [R] how to get design matrix?

On Sat, 2009-05-09 at 19:29 -0700, linakpl wrote: If I was doing an ANOVA analysis how can I get the design matrix R used? You can do ANOVA several different ways in R, and that is just the few functions to do this that I am aware of. Showing us what function/code you used would be really

### Re: [R] Citing R/Packages Question

Most common styles (e.g. APA, Harvard) include the date of access for an electronic reference. While this may be an artifact of history, both reviewers and editors are justified in asking authors to adhere to the style used in a particular journal. That said, I don't see why Nature or any

### [R] ade4 and inertia of axis 2

Hello, Could someone please tell me how to find the estimate of inertia for the second axis of an RLQ analysis using ade4? Using the example from the ade4 package, I *suspect* that the inertia for the 2nd axis of the R table would be 4.139332 (see below results summary from rlq1). However,

### [R] ggplot2: recommended workaround for broken legend.position=top

Searching the mail archives I found that using legend.position as in p.ring.3 + opts(legend.position=top) is a known bug. I tried doing p.ring.3 + opts(legend.position=c(0.8, 0.2)) which works, but the legend background is transparent, i.e. I see the plot background through the legend. Adding

### Re: [R] ggplot2: recommended workaround for broken legend.position=top

On Sun, May 10, 2009 at 10:32 AM, Zeljko Vrba zv...@ifi.uio.no wrote: Searching the mail archives I found that using legend.position as in p.ring.3 + opts(legend.position=top) is a known bug. I tried doing p.ring.3 + opts(legend.position=c(0.8, 0.2)) which works, but the legend background

### Re: [R] need help with chisq

JC, If each row are the counts for a 2 x 2 contingency table - so for the ith contingency table you have counts for row 1 c(Y08[i],Z08[i]) and row 2 (Y09[i],Z09[i]) then you could use apply: X - cbind(vdata$Y08,vdata$X08-vdata$Y08,vdata$Y09,vdata$X09-vdata$Y98) f.chisq - function(x){ m -

### Re: [R] a general way to select a subset of matrix rows?

One simple adjustment is the following: apply(matrix(x[rows,],nr=length(rows)),2,mean) Quoting Peter Kharchenko peter.kharche...@post.harvard.edu: Dear fellow R users, I can't figure out how to do a simple thing properly: apply an operation to matrix columns on a selected subset of rows.

### [R] function for nice correlation output with significance symbols

hi, I am searching for a nice function which computes correlations out of a data.frame and adds asterix-signs after each correlation when they are significant... ...or a function which just show correlations greater than x in the output. thanks!

### [R] Function recommendation for this study...

Hi, I'm not used to thinking along these lines, and wanted to ask your advice: Suppose you have a sample of around 100, consisting of patients according to doctors, in which patients and doctors are given a questionnaire with categorical responses. Each patient somehow has roughly 3 doctors, or

### [R] ade4 and inertia of axis 2

Hello, Could someone please tell me how to find the estimate of inertia for the second axis of an RLQ analysis using ade4? Using the example from the ade4 package, I *suspect* that the inertia for the 2nd axis of the R table would be 4.139332 (see below results summary from rlq1). However,

### [R] Help with kalman-filterd betas using the dlm package

Hi all R gurus out there, Im a kind of newbie to kalman-filters after some research I have found that the dlm package is the easiest to start with. So be patient if some of my questions are too basic. I would like to set up a beta estimation between an asset and a market index using a

### [R] Partial Derivatives in R

Quick question: Which function do you use to calculate partial derivatives from a model equation? I've looked at deriv(), but think it gives derivatives, not partial derivatives. Of course my equation isn't this simple, but as an example, I'm looking for something that let's you control

### Re: [R] 2 dimension convolve

Did you try the imgFFTConvolve function in the biOps package? GreenBrower wrote: Anybody know how to do a fast 2 dimension convolve in R? I used a traditional method, but it's very slow, even can not stand it! -- View this message in context:

### Re: [R] function for nice correlation output with significance symbols

On 5/10/2009 3:26 PM, Martin Batholdy wrote: hi, I am searching for a nice function which computes correlations out of a data.frame and adds asterix-signs after each correlation when they are significant... ...or a function which just show correlations greater than x in the output.

### Re: [R] I'm offering $300 for someone who know R-programming to do the assignments for me.

On Sat, 09 May 2009 12:17:57 -0400, Carl Witthoft c...@witthoft.com wrote: Sorry, but your professor offered me $500 NOT to do your assignments. Actually all he wanted was your name so you could be expelled for plagiarism! -- Bob Doherty __

### Re: [R] Spatstat

Peter Dalgaard wrote: Richard Chirgwin wrote: Hi all, I am trying to install Spatstat on OpenSUSE 11.1. install.packages(spatstat, dependencies = TRUE) fails on the basis of various compiler packages (full message below). I have gcc version 4.3.2, which should include

### Re: [R] Partial Derivatives in R

If you want `numerical' partial derivatives, check out: require(numDeriv) ?grad Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University

### Re: [R] Partial Derivatives in R

On May 10, 2009, at 10:05 AM, Paul Heinrich Dietrich wrote: Quick question: Which function do you use to calculate partial derivatives from a model equation? I've looked at deriv(), but think it gives derivatives, not partial derivatives. Your reading of the help page and the examples

### Re: [R] Partial Derivatives in R

Have you considered genD{numDeriv}? If this does not answer your question, I suggest you try the RSiteSearch package. The following will open a list of options in a web browser, sorted by package most often found with your search term: library(RSiteSearch) pd -

### Re: [R] function for nice correlation output with significance symbols

Maybe pairs.panels(df,scale=T) from the psych library - se more here: http://www.personality-project.org/r/html/00.psych-package.html setting scale=T scales the cor coefficient according to their value. I have seen an implementation with added asterix' but couldn't find it right now. On Sun, May

### [R] Unintended loading of package:datasets

The dataset package is being loaded apparently by one of the packages that I am using. The loading of the datasets takes a long time and I would like to eliminate it. I thought the datasets were effectively examples so don't understand why they would be required at all. 1) How can I determine

### [R] plot(survfit(fitCox)) graph shows one line - should show two

R 2.8.1 Windows XP I am trying to plot the results of a coxph using plot(survfit()). The plot should, I believe, show two lines one for survival in each of two treatment (Drug) groups, however my plot shows only one line. What am I doing wrong? My code is reproduced below, my figure is

### [R] Select the rows in a dataframe that matches a criteria in another dataframe

Hi everyone! Thank you for the help you have been given to me, and here I'm with another problem with my dataframes: I have two dataframes (with much more observations), like these: Dataframe1 Firm Year cash 5004002002007 100 5004002002006 200 5004002002005

### [R] How does one plot the -log(log(survival))

R 2.8.1 Windows XP How does one plot the -log(log(survival)) from a coxph? Survfit does not seem to be up to the task. Thanks, John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10

### Re: [R] plot(survfit(fitCox)) graph shows one line - should show two

I did not see an attached figure to compare against, perhaps it was removed by the server. I suspect that: plot(survfit(fit0,newdata=GVHDdata) will produce the plot you're looking for. It will generate survival curves for the data in GVHDdata using the estimates from the fit0 coxph model. At

### Re: [R] plot(survfit(fitCox)) graph shows one line - should show two

On Sun, 10 May 2009, John Sorkin wrote: R 2.8.1 Windows XP I am trying to plot the results of a coxph using plot(survfit()). The plot should, I believe, show two lines one for survival in each of two treatment (Drug) groups, however my plot shows only one line. What am I doing wrong?

### Re: [R] How does one plot the -log(log(survival))

On Sun, 10 May 2009, John Sorkin wrote: R 2.8.1 Windows XP How does one plot the -log(log(survival)) from a coxph? Survfit does not seem to be up to the task. It depends on what you mean. You can convert the plots to a -log(log(survival)) scale with the option fun=cloglog. In the example

### Re: [R] Unintended loading of package:datasets

On 11/05/2009, at 9:17 AM, David A Vavra wrote: The dataset package is being loaded apparently by one of the packages that I am using. The loading of the datasets takes a long time and I would like to eliminate it. I thought the datasets were effectively examples so don't understand why

### Re: [R] Select the rows in a dataframe that matches a criteria in another dataframe

?subset ?%in% (I have gotten tired of converting dataframes that are presented in a non-executable form, such as is supported by the dput function. So, ... you should read those help pages and take the obvious path to success.) Something along the lines of: subset(df1, Firm %in%

### Re: [R] Unintended loading of package:datasets

On May 10, 2009, at 7:33 PM, Rolf Turner wrote: On 11/05/2009, at 9:17 AM, David A Vavra wrote: The dataset package is being loaded apparently by one of the packages that I am using. The loading of the datasets takes a long time and I would like to eliminate it. I thought the datasets

### Re: [R] Function recommendation for this study...

Paul, I suggest looking up observer agreement. The description of your study sounds like a classical categorical observer agreement problem. I can't give a reference off the top of my head, but if you get stuck, e-mail me and I'll try and find a ref to get you started. Murray M Cooper, Ph.D.

### Re: [R] Unintended loading of package:datasets

Thanks. Perhaps something else is going on. There is a large time period (about 20 sec.) after the message about loading the package. More investigation, I suppose. Thanks again, DAV -Original Message- From: Rolf Turner [mailto:r.tur...@auckland.ac.nz] Sent: Sunday, May 10, 2009 7:34

### Re: [R] Reading large files quickly

At the moment I'm just reading the large file to see how fast it goes. Eventually, if I can get the read time down, I'll write out a processed version. Thanks for suggesting scan(); I'll try it. Rob jim holtman wrote: Since you are reading it in chunks, I assume that you are writing out each

### Re: [R] Unintended loading of package:datasets

G'day David, On Sun, 10 May 2009 17:17:38 -0400 David A Vavra dava...@verizon.net wrote: The dataset package is being loaded apparently by one of the packages that I am using. The loading of the datasets takes a long time and I would like to eliminate it. I thought the datasets were

### Re: [R] Unintended loading of package:datasets

G'day David, On Sun, 10 May 2009 21:35:30 -0400 David A Vavra dava...@verizon.net wrote: Thanks. Perhaps something else is going on. There is a large time period (about 20 sec.) after the message about loading the package. More investigation, I suppose. What R version are you using? I do

### [R] Building US maps in R

Hi, I'm trying to build some maps of the US by county that will have the following characteristics: Feature/Map Map 1 Map2 Both Broken out by county Yes Yes Yes Heatmaps of US Census Data for income by county Yes No Yes

### Re: [R] Partial Derivatives in R

Thank you for suggesting other functions, I will look into them. When I read the deriv() function, it did mention partial, but I (being a newbie) wasn't able to get partials for a simple MNL equation. I'm sure I did something wrong then, but here's what I tried the following and got different

### Re: [R] Function recommendation for this study...

To look up observer agreement, you might consider the RSiteSearch package. The RSiteSearch.function looks only for matches in help pages of contributed packages. library(RSiteSearch) oa - RSiteSearch.function(observer agreement) attr(oa, hits) # 4 functions matching this term HTML(oa)