Re: [R] modifying factors in a data frame

2010-08-19 Thread Abhishek Pratap
Kiaora Koe Peter It worked. I hope I am getting my Maori right. -Abhi On Thu, Aug 19, 2010 at 1:50 AM, Peter Alspach peter.alsp...@plantandfood.co.nz wrote: Tena koe Abhi The easiest way is probably data1$sample - as.numeric(data1$sample) If you want it to remain as a factor then

[R] R reports

2010-08-19 Thread Donald Paul Winston
I don't see much in the way of an ability to write reports in R the way you can with SAS. You basically have to write a program with R in a 3G way unlike SAS with it's 4G proc print and proc report. Are there similar R functions and packages? -- View this message in context:

Re: [R] Help with Vectors and conditional functions

2010-08-19 Thread Ferreira, Thiago Alves
Good morning, I have something like this: names(coint_tests) - apply(b,2,paste, collapse=_) which prints 15 names like: A_B, C_D, E_F, ... AA,B,C,D.. Are time series. Then there is a vector called coint_tests of length 15 which yields yes or no. I need to add a function to plot the time series

Re: [R] Rolling window linear regression

2010-08-19 Thread Achim Zeileis
The function rollapply() in package zoo can be used to run rolling regressions. See the examples in the manual page for a worked example. On Thu, 19 Aug 2010, siddharth.gar...@gmail.com wrote: Thanks, I will try it. Regards Sid Sent on my BlackBerry? from Vodafone -Original Message-

Re: [R] Help with Vectors and conditional functions

2010-08-19 Thread Ivan Calandra
Hi, I haven't spent too much time on it, but that might help: if (coint_tests[[i]]==YES)... Note the double = which is the operator for equality. The single = is the assignment operator, especially with arguments. HTH, Ivan Le 8/19/2010 09:03, Ferreira, Thiago Alves a écrit : Good morning,

Re: [R] Rolling window linear regression

2010-08-19 Thread Achim Zeileis
On Thu, 19 Aug 2010, siddharth.gar...@gmail.com wrote: Hi That's right, but that isn't what I am trying to achieve. When we have a rolling window, the only difference between two neighboring windows is first and the last point. Yes, this is what the example does. Consider the following

Re: [R] reading lmer table

2010-08-19 Thread Mark Difford
Hi Nicola, In few word: does this row indicate a global effect of the predictor 'cat' or a more specific passage? It indicates a more specific passage. Use anova(m7) for global/omnibus. Check this for yourself by fitting the model with different contrasts. The default contrasts in R are

Re: [R] AIC in MuMIn

2010-08-19 Thread Gavin Simpson
On Thu, 2010-08-19 at 04:42 +0800, elaine kuo wrote: Yes, I tried the example in the ?dredge and agreed that something else caused the mistake. Aside from the cause which takes time to clarify (16 explanatory variables in the model), I would like to ask another question. Please

Re: [R] Yet another memory limit problem

2010-08-19 Thread Tim Clark
Thanks for everyones help - mydat was not what I thought it was.  str(mydat) showed:  $ Date   : Factor w/ 1504 levels ,2002-11-22,..: 295 295 295 295 295 295 295 295 295 295 ...  $ Time   : Factor w/ 72447 levels ,00:00:00,..: 15423 15470 15509 17112 17136 17159 17209 17239 17266

[R] Why does Bootstrap work for one of similar models but not for the other?

2010-08-19 Thread Reiko Akiyama
Dear all, Could anyone help me figure out why bootstrap works for one of similar models but not for the other and how I can solve it? I am using R 2.11.1 in Windows and would like to get confidence intervals for my models A and B by bootstrapping. However, bootstrap gives expected output

[R] Slow response from Windows Rgui - caused by Word?

2010-08-19 Thread Jon Olav Skoien
Dear list, I quite often experience a delayed response when I type in the console of the RGui of my computer. When typing a command, the text only appears letter-by-letter on the console if I type rather slow (maximum 1-2 letters per second), otherwise it appears some time after I finished

[R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Marius Hofert
Dear expeRts, below are two examples of using texi2dvi. The problem becomes clear from the second example: on cleaning, texi2dvi also deletes the generated .pdf file. Is there a solution? Cheers, Marius ## Example 1: texi2dvi cleans fine, without deleting the generated .pdf require(tools)

Re: [R] ROCR predictions

2010-08-19 Thread Assa Yeroslaviz
Hello everybody, yes I'm sorry. I can see it is not so easy to understand. I'l try to explain a bit more. The experiment was used to compare two (protein domain) data bases and find out whether or not the results founded in one are comparable to the second DB. the first column shows the list of

Re: [R] R reports

2010-08-19 Thread ONKELINX, Thierry
Dear Donald, I'm not sure what the meaning of '3G' and '4G' is. You should take a look at Sweave() which is a very powerfull tool for generating reports in R. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur-

Re: [R] reading lmer table

2010-08-19 Thread Nicola Spotorno
Thank you very much Mark, I'll try. Regards, Nicola Mark Difford ha scritto: Hi Nicola, In few word: does this row indicate a global effect of the predictor 'cat' or a more specific passage? It indicates a more specific passage. Use anova(m7) for global/omnibus. Check this for

Re: [R] R reports

2010-08-19 Thread David Hajage
and: - brew - HTMLUtils - ascii - odfWeave - R2HTML - hwriter - ... 2010/8/19 ONKELINX, Thierry thierry.onkel...@inbo.be Dear Donald, I'm not sure what the meaning of '3G' and '4G' is. You should take a look at Sweave() which is a very powerfull tool for generating reports in R.

Re: [R] How to read ANOVA output

2010-08-19 Thread Stephen Liu
- Original Message From: ted.hard...@manchester.ac.uk ted.hard...@manchester.ac.uk To: r-help@r-project.org Cc: Stephen Liu sati...@yahoo.com Sent: Wed, August 18, 2010 4:41:11 PM Subject: RE: [R] How to read ANOVA output Hi Ted, Thanks for your advice. - snip - You need to

Re: [R] How to read ANOVA output

2010-08-19 Thread Stephen Liu
- Original Message From: Gavin Simpson gavin.simp...@ucl.ac.uk To: Stephen Liu sati...@yahoo.com Cc: r-help@r-project.org Sent: Wed, August 18, 2010 4:13:03 PM Subject: Re: [R] How to read ANOVA output Hi Gavin, Thanks for your advice. tabA = c(5.67, 5.67, 5.55, 5.57) tabB =

Re: [R] Slow response from Windows Rgui - caused by Word?

2010-08-19 Thread jim holtman
Start up perfmon on your system (or the task manager) and then look at who is consuming the CPU and memory. This will provide insight to the problem. You need to determine if it is a CPU problem or possibly memory due to paging. The tools are there for you to trouble shoot the problem since it

Re: [R] reading a text file, one line at a time

2010-08-19 Thread jim holtman
Here is how I would do it to just do character substitution on the data: inFile - textConnection( V1 V2 V3 V4 V5 + 1 1 b b a -0.4990719 + 2 2 b a a 1.5134101 + 3 3 a b b 1.9375467 + 4 4 a a b 0.3310612 + 5 5 a b a 0.2807520 + 6 6 a a b 0.9646351 + 7

Re: [R] Adding column to dataframe

2010-08-19 Thread jim holtman
I think you are probably paging on your system. Turn on your performance metrics and look at it. If the object you are processing is all numeric, it would seem to require about 3.5GB of space (50% of available memory). Provide and 'str' and 'object.size' of the object so that we can see what

Re: [R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Tim Gruene
Dear Marius, from reading the texi2dvi man-page and R-help on texi2dvi I suggest to set 'clean=F' and use 'texi2dvi = getOption(texi2dvi --mostly-clean)' instead. Tim On Thu, Aug 19, 2010 at 10:36:30AM +0200, Marius Hofert wrote: Dear expeRts, below are two examples of using texi2dvi. The

Re: [R] memory problem

2010-08-19 Thread Duncan Murdoch
avsha38 wrote: Hi, when i run the following code i get this massege: The instruction at 0x reference memory at 0x###, the memory cannot be read. and then i have to close R. what is the problem and how can i solve it? The problem is a bug in the underlying C (or other)

Re: [R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Marius Hofert
Dear Tim, you mean require(tools) filepath - paste(getwd(),/test/myLaTeXFile2.tex,sep=) sink(file=filepath) cat(\\documentclass{article}\n) cat(\\usepackage[T1]{fontenc}\n) cat(\\usepackage[english]{babel}\n) cat(\\usepackage{blindtext}\n)

Re: [R] How to read ANOVA output

2010-08-19 Thread Siri Bjoner
He's already sent you some good advice. Go to amazon.com and search for basic statistics + your area in Books. Giving you specific recommendations will also take a lot of time, both for us and you, especially seeing as we don't really know what area or subject you're looking for. Any

Re: [R] R reports

2010-08-19 Thread Prof Brian Ripley
On Thu, 19 Aug 2010, ONKELINX, Thierry wrote: Dear Donald, I'm not sure what the meaning of '3G' and '4G' is. You should take a I think he means 3GL, as in http://en.wikipedia.org/wiki/Third-generation_programming_language (and I've not heard the term used for 20 years now). look at

[R] Math symbols in ylab with vis.gam() or plot.gam()

2010-08-19 Thread Vijaya Parthiban
Hi all, Has anyone tried to plot math symbols with vis.gam() - a function that uses (I think) plot.gam() internally? This is from the package mgcv - I am new to gam(). For example, with the normal plot(), the expression() works fine for Math symbols: plot(xx,

Re: [R] Help with Vectors and conditional functions

2010-08-19 Thread Nikhil Kaza
In additiion to Ivan's comment, in this case, you are just plotting Yes or No. I think thats not what you want. Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 19, 2010, at 3:42 AM, Ivan Calandra wrote: Hi, I haven't

[R] 2d kriging with anisotropy on an irregular network (RandomFields Package)

2010-08-19 Thread Jean-Marie Lepioufle
Dear List I am using the RandomFields package, and I have a problem when 2d-kriging, with an anisotropy, some values from an irregular network. It works well when : - 2d-kriging, without any anisotropy, some data from an irregular network - 2d-kriging, with and without anisotropy, some data from

Re: [R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Tim Gruene
Dear Marius, yes, that's what I had meant. I am sorry I had not actually tested my suggestion nor your problem (bad practice). Now I have and actually in case 2 you describe I only end up with test/myLaTeXFile2.tex and myLaTeXFile2.pdf. If, however, I run texi2dvi at least once with option

Re: [R] R reports

2010-08-19 Thread Donald Paul Winston
Oops, I meant 4GL. Part of SAS involves more or less declarative coding where SAS figures out how to process the information and you don't have to. Sweave and html generators in R are not what I'm looking for. I'm looking for a function whose arguments are data, column names, grouping variables,

Re: [R] Slow response from Windows Rgui - caused by Word?

2010-08-19 Thread Jon Olav Skoien
Hi, It is certainly not a memory or CPU problem, I should have mentioned in the first email that I already tried to check for that. However, I now tried to disable EndNote 9 from the Add-Ins, and it seems that was the problem. I still dont understand why this happens though. There seems to

Re: [R] Different way of aggregating

2010-08-19 Thread skan
Phil Spector wrote: For chron objects: aggregate(thedata$value,list(hour=hours(thedata$date)),mean) Ok, thanks, that's what I need. Now it seems so easy... Could you tell me why we write... ? aggregate(thedata$value,list(hour=hours(thedata$date)),mean) instead of just

Re: [R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Marius Hofert
Dear Tim, if I run ... ## Example 2: texi2dvi also deletes the generated .pdf require(tools) filepath - paste(getwd(),/test/myLaTeXFile2.tex,sep=) sink(file=filepath) cat(\\documentclass{article}\n) cat(\\usepackage[T1]{fontenc}\n)

Re: [R] R reports

2010-08-19 Thread David Hajage
I'm not sure I understand what is 3GL or 4GL, but R is on the list of fourth-generation languages : Data manipulation, analysis, and reporting languageshttp://en.wikipedia.org/wiki/Fourth-generation_programming_language#Some_fourth-generation_languages on wikipedia. I don't know a function like

Re: [R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Duncan Murdoch
On 19/08/2010 7:55 AM, Marius Hofert wrote: Dear Tim, if I run ... ## Example 2: texi2dvi also deletes the generated .pdf require(tools) filepath - paste(getwd(),/test/myLaTeXFile2.tex,sep=) sink(file=filepath) cat(\\documentclass{article}\n)

Re: [R] Finding a scalar value...

2010-08-19 Thread Adaikalavan Ramasamy
Your best option is to read the relevant help files. A simple (untested) example to find R when P, T and scal.fn=Z is given, is to do this: my.fun - function(P, R, T, Z) scal.fn(P, R, T) - Z uniroot( fn, R=rr, T=tt, Z=zz, lower=-100, upper=100 )$root You have to make an intelligent

Re: [R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Tim Gruene
Dear Marius, I see. I suppose it's a matter of your version of texi2dvi then - when I do the same in a freshly created directory (including the test directory), cutting and pasting your very code into R leaves me only with myLaTeXFile2.pdf and test/myLaTeXFile2.tex This is texi2dvi --version

Re: [R] texi2dvi: option clean also deletes the generated pdf file

2010-08-19 Thread Marius Hofert
Dear all, many thanks for your help. I totally missed that texi2dvi is also a system command (I don't use that explicitly to compile my .tex docs). So I checked my system-texi2dvi. It's quite interesting, if I use the option --mostly-clean, everthing is removed. However, if I use just --clean,

Re: [R] GLMM random effects

2010-08-19 Thread Ben Bolker
Natasha natasha.lloyd at gmail.com writes: For future reference, you may have better luck *either* on the r-sig-mixed-models help list (for advice about GLMMs) *or* on r-sig-ecology (for advice about ecological studies) [it's not considered polite to cross-post: try looking at the archives of

Re: [R] R reports

2010-08-19 Thread Frank Harrell
What do low level proc print and proc report have on Sweave or http://biostat.mc.vanderbilt.edu/wiki/pub/Main/StatReport/summary.pdf? If proc print and proc report are 4G, let's move back a generation. Frank E Harrell Jr Professor and ChairmanSchool of Medicine

Re: [R] ifelse command

2010-08-19 Thread David Winsemius
On Aug 18, 2010, at 10:46 PM, Philip Wong wrote: well to be honest, it is a assignment for the Bayesian statistic paper I wish to take later in the academic year. But I'm a slow learner, so I'm going to try out some of the assignments posted in the university forum hoping to get some

[R] Correlograms and linear regression

2010-08-19 Thread ashz
Dear all, I generated a Correlograms and used the panel.ellipse (confidence ellipse and smoothed line) option. Is there a way to get instead of the smoothed line the linear regression? Thanks, As hz -- View this message in context:

Re: [R] Linear regression equation and coefficient matrix

2010-08-19 Thread ashz
Dear Greg, Thanks for the tip. As I am new in R can you please provide me a script how do to so. It will help my learning process. Thanks, Asher -- View this message in context: http://r.789695.n4.nabble.com/Linear-regression-equation-and-coefficient-matrix-tp2329804p2330867.html Sent from

[R] Combining means

2010-08-19 Thread Holger Danner
Hi volunteer statisticians, I want to combine the stdev of 6 populations of means for two different treatments and there seem to be many methods for doing so. It is QPCR data consisting of 3 technical replicates building one mean and 6 biological samples in two treatment groups. Now as an

[R] Little's MCAR test

2010-08-19 Thread Sander
L.S., Does anyone know if there is an R library which implements Little's MCAR test for completely at random missing values? It is implemented in SPSS and SAS, and widely mentioned in the literature. Thanks in advance! Sander van Kuijk -- View this message in context:

Re: [R] creation package

2010-08-19 Thread anderson nuel
Dear r-help, I don't use namespace. How can I make asia available? I think my problem in creating the package in this: I have a singleglobal function (RT) in my package, but inside RT I need to call several other function( comb l,earn_comb, nchoo). When I used package.sekeleton, Iput in lists

[R] zoo. window

2010-08-19 Thread wyd923
Hi, I have a dataset including monthly date from 1971-01-01 to 2009-01-01. The dates are character variables. I want to select the subsample from my original data, so I use mydata3-window(mydata,start=1972-02-01,end=2005-02-01), or mydata3-window(mydata,

[R] error with bitmap, please help

2010-08-19 Thread kayj
Hi All I still have a problem with “bitmap” function in R, I have downloaded ghostscript 8.71 and added the path to the executable to the path environment variable, by going to the control panel , system, advanced system settings, added C:\Program Files(x86)\gs\gs8.71\bin to the path variable.

Re: [R] R reports

2010-08-19 Thread peter dalgaard
On Aug 19, 2010, at 3:49 PM, Frank Harrell wrote: What do low level proc print and proc report have on Sweave or http://biostat.mc.vanderbilt.edu/wiki/pub/Main/StatReport/summary.pdf? If proc print and proc report are 4G, let's move back a generation. Er, no... AFAIK, 4GL just means that

Re: [R] Does R always insist on sending plot output to a file?

2010-08-19 Thread Matt Shotwell
Donald, I was able to 'trick' R into writing plot data to a GNU Linux fifo. I had forgotten that the fifo will block until there is a process at either end (a writer and a reader): At one terminal, create a fifo and set a program to catch output $ mkfifo Rfifo $ cat Rfifo At a second terminal

Re: [R] probabilities from predict.svm

2010-08-19 Thread Steve Lianoglou
Hi James, I'd like to help you out, but I'm not sure I understand what the problem is. Does the problem lie with building a predictive SVM, or getting the right values (class probabilities) to land in the right place on your map/plot? -steve On Wed, Aug 18, 2010 at 3:09 PM, Watling,James I

Re: [R] R reports

2010-08-19 Thread Spencer Graves
The sos package is designed to search the help pages of all contributed packages and return the results in a data.frame sorted to put first the package with the most matches. It also has a vignette, which appeared in last December's issue of The R Journal. This can be used to search in a

[R] Adding lines to xyplot with abline

2010-08-19 Thread Jeffrey.Morris
Is it kosher to add, say, horizontal lines to a lattice xyplot using abline(h=xxx)? The lines don't appear at the right value, that is, if h=150, the line might appear at h=140? Jeff This communication, including any attachments, is intended solely for the use of the addressee and may

Re: [R] error with bitmap, please help

2010-08-19 Thread Prof Brian Ripley
On Thu, 19 Aug 2010, kayj wrote: Hi All I still have a problem with “bitmap” function in R, I have downloaded ghostscript 8.71 and added the path to the executable to the path environment variable, by going to the control panel , system, advanced system settings, added C:\Program

[R] solution

2010-08-19 Thread Alex Levitchi
Hello I am not sure about your general aim, but from my previous experience on combination of treatments, it can be more useful to create a matrix or data.frame, which you can fulfill either with 1s and 0s, or with the values of treatment, especially if you will need this data later for the

Re: [R] zoo. window

2010-08-19 Thread Achim Zeileis
On Thu, 19 Aug 2010, wyd...@msn.com wrote: Hi, I have a dataset including monthly date from 1971-01-01 to 2009-01-01. The dates are character variables. I would suggest to use a more suitable class for the index, such as yearmon (if you only want to indicate the month anyway) or Date (if

Re: [R] Adding lines to xyplot with abline

2010-08-19 Thread David Winsemius
On Aug 19, 2010, at 10:31 AM, jeffrey.mor...@sanofipasteur.com wrote: Is it kosher to add, say, horizontal lines to a lattice xyplot using abline(h=xxx)? The lines don't appear at the right value, that is, if h=150, the line might appear at h=140? Correct. The coordinate systems are not

Re: [R] Correlograms and linear regression

2010-08-19 Thread Kevin Wright
Just define your own panel function. Here I modified the panel.ellipse function and called it panel.lm library(corrgram) data(baseball) vars2 - c(Assists,Atbat,Errors,Hits,Homer,logSal, Putouts,RBI,Runs,Walks,Years) panel.lm - function(x, y, ...){ dfn - 2 dfd - length(x) - 1

Re: [R] How to measure correlations in terms of distance and draw them on a 2-dimmentional plot?

2010-08-19 Thread weijian21cn
Thank you all a lot for all the suggestion! -- View this message in context: http://r.789695.n4.nabble.com/How-to-measure-correlations-in-terms-of-distance-and-draw-them-on-a-2-dimmentional-plot-tp2330413p2331408.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] probabilities from predict.svm

2010-08-19 Thread Steve Lianoglou
On Thu, Aug 19, 2010 at 10:56 AM, Watling,James I watli...@ufl.edu wrote: Hi Steve-- Thanks for your interest in helping me figure this out.  I think the problem has to do with the values of the probabilities returned from the use of the model to predict occurrence in a new dataframe. Ok,

Re: [R] How to measure correlations in terms of distance and draw them on a 2-dimmentional plot?

2010-08-19 Thread Kjetil Halvorsen
You could also try RSiteSearch(correlation circle) Kjetil On Thu, Aug 19, 2010 at 11:31 AM, weijian21cn wli...@stern.nyu.edu wrote: Thank you all a lot for all the suggestion! -- View this message in context:

[R] Quick q. on lists

2010-08-19 Thread Jonathan
Hi All, Anyone know how to quickly query some summary information on the components of a list? For example, I have a list that contains dataframes (originally generated by using split() on one large data frame). I simply want to know the number of rows in the longest dataframe from the

Re: [R] (no subject)

2010-08-19 Thread Ben Bolker
Kalaivani Mani manikalaivani at yahoo.co.in writes: To   R group Help Desk (We're not the help desk (!!) You can buy support from various companies if you want ...)   I am a user of R software.  I am facing a problem while using frailtyPenal command in R.2.11.1. When I use these

Re: [R] ROCR predictions

2010-08-19 Thread Frank Harrell
At the heart of this you have a problem in incomplete conditioning. You are computing things like Prob(X x) when you know X=x. Working with a statistician who is well versed in probability models will undoubtedly help. Frank Frank E Harrell Jr Professor and ChairmanSchool of

Re: [R] Quick q. on lists

2010-08-19 Thread Erik Iverson
Jonathan wrote: Hi All, Anyone know how to quickly query some summary information on the components of a list? For example, I have a list that contains dataframes (originally generated by using split() on one large data frame). I simply want to know the number of rows in the longest

Re: [R] Quick q. on lists

2010-08-19 Thread ONKELINX, Thierry
You need sapply max(sapply(myList, nrow)) Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium Research Institute for Nature and

Re: [R] Quick q. on lists

2010-08-19 Thread Jorge Ivan Velez
Hi Jonathan, Try this: # list of data frames mylist - list(d1 = matrix(rnorm(100), ncol = 10), d2 = matrix(rnorm(100), ncol = 5), d3 = matrix(rnorm(100), ncol = 20)) # max number of rows max(do.call(c, lapply(mylist, nrow))) # [1] 20 HTH, Jorge

Re: [R] functions and multiple levels

2010-08-19 Thread chris20
Thanks for the replies, it wasn't quite what I wanted but it has given me some more code for working out averages. I have managed to construct something that nearly works level.1 level.2 observation 1 1 0.5 1 1

Re: [R] probabilities from predict.svm

2010-08-19 Thread Watling,James I
Hi Steve-- Thanks for your interest in helping me figure this out. I think the problem has to do with the values of the probabilities returned from the use of the model to predict occurrence in a new dataframe. The svm model I referenced in the original message (svm.model) does a good job

Re: [R] ifelse command

2010-08-19 Thread Greg Snow
It would help us help you if you could give a description of what your ultimate goal is here. Is it to simulate the dice? Then you may want to just use the dice function in the TeachingDemos package (or you can animate the rolling with plot.rgl.die and roll.rgl.die in the same package). Or

Re: [R] Why does Bootstrap work for one of similar models but not for the other?

2010-08-19 Thread Bert Gunter
In future, when posting data in your message use dput() or textConnection() so that helpeRs can more easily load them. I was not able to replicate your results. Here's what I got: Bootstrap Statistics : originalbiasstd. error t1* 0.99975370 0.0044205644 0.04110232 t2*

Re: [R] Linear regression equation and coefficient matrix

2010-08-19 Thread Greg Snow
Here is a quick example: c1 - cor(iris[,-5]) s1 - sqrt(diag(var(iris[,-5]))) betas - diag( s1 ) %*% c1 %*% diag( 1/s1 ) # now compare: coef( lm( Sepal.Length ~ Sepal.Width, data=iris ) )[2] betas[1,2] But if you cannot work that out on your own, then you really should review linear algebra

Re: [R] creation package

2010-08-19 Thread Michael Dewey
At 13:57 19/08/2010, anderson nuel wrote: Dear r-help, I don't use namespace. Well, as I said in my original reply, it would be a good idea to do so. How can I make asia available? Without knowing where asia is that is quite a tough call. How do you access it when you test your code

[R] Pass By Value Questions

2010-08-19 Thread lists
I understand R is a Pass-By-Value language. I have a few practical questions, however. I'm dealing with a large dataset (~1GB) and so my understanding of the nuances of memory usage in R is becoming important. In an example such as: d - read.csv(file.csv); n - apply(d, 1, sum); must d be

Re: [R] R reports

2010-08-19 Thread Greg Snow
Your question brings up a bit of a philosophical issue (or possibly economic theory). The idea is the contrast between specialization and generalization. A purely specialized program will only do one thing (but hopefully do that one thing well), the ultimate generalized program will do

Re: [R] assign multiple variables at once

2010-08-19 Thread Hosack, Michael
R community, Brian generously provided the following code (see below) but I could not get it to run and it produced this error (after a few minutes of run time): Error: evaluation nested too deeply: infinite recursion / options(expressions=)? I am using Tinn-R and on the IO screen I also

[R] plotmath question

2010-08-19 Thread array chip
Hi all, let me give a simple example: b-20 I would like to print ylab as P20 where P is printed in Italic font. When I do the following: plot(1, ylab=expression(paste(italic(P),b,sep=))) I got y axis label printed as Pb instead of P20. What is the best solution to print platmath symbols with

Re: [R] plotmath question

2010-08-19 Thread baptiste auguie
Try this, b = 20 plot(1, ylab= bquote(italic(P) * .(b)) ) HTH, baptiste On 19 August 2010 20:02, array chip arrayprof...@yahoo.com wrote: Hi all, let me give a simple example: b-20 I would like to print ylab as P20 where P is printed in Italic font. When I do the following: plot(1,

Re: [R] plotmath question

2010-08-19 Thread David Winsemius
On Aug 19, 2010, at 2:02 PM, array chip wrote: Hi all, let me give a simple example: b-20 I would like to print ylab as P20 where P is printed in Italic font. When I do the following: plot(1, ylab=expression(paste(italic(P),b,sep=))) I got y axis label printed as Pb instead of P20. What

Re: [R] Trimmed Sample

2010-08-19 Thread Greg Snow
You can look at the code for mean.default and see how it does the trimming, then you can use that to create your own trimmed version to pass to other functions. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original

Re: [R] plotmath question

2010-08-19 Thread array chip
Thanks, yes it worked! What about if I want to print as P2, A where A is just letter A and 2 is from variable b. John - Original Message From: baptiste auguie baptiste.aug...@googlemail.com To: array chip arrayprof...@yahoo.com Cc: r-h...@stat.math.ethz.ch Sent: Thu, August 19, 2010

Re: [R] Pass By Value Questions

2010-08-19 Thread Duncan Murdoch
On 19/08/2010 12:57 PM, li...@jdadesign.net wrote: I understand R is a Pass-By-Value language. I have a few practical questions, however. I'm dealing with a large dataset (~1GB) and so my understanding of the nuances of memory usage in R is becoming important. In an example such as: d -

Re: [R] Automated plot and linear regression line/data

2010-08-19 Thread Greg Snow
?pairs ?lattice::splom ?lattice::panel.xyplot pairs( state.x77, panel=function(x,y){ points(x,y) abline(lm(y~x), col='red') }) library(lattice) splom( ~state.x77, type=c('p','r') ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [R] plotmath question

2010-08-19 Thread David Winsemius
On Aug 19, 2010, at 2:24 PM, array chip wrote: Thanks, yes it worked! What about if I want to print as P2, A where A is just letter A and 2 is from variable b. ?plotmath plot(1, ylab= bquote(italic(P) *,*.(b)~A) ) John - Original Message From: baptiste auguie

Re: [R] plotmath question

2010-08-19 Thread array chip
Thanks David! John - Original Message From: David Winsemius dwinsem...@comcast.net To: array chip arrayprof...@yahoo.com Cc: baptiste auguie baptiste.aug...@googlemail.com; r-h...@stat.math.ethz.ch Sent: Thu, August 19, 2010 11:34:07 AM Subject: Re: [R] plotmath question On Aug 19,

Re: [R] Pass By Value Questions

2010-08-19 Thread Matt Shotwell
On Thu, 2010-08-19 at 14:27 -0400, Duncan Murdoch wrote: On 19/08/2010 12:57 PM, li...@jdadesign.net wrote: I understand R is a Pass-By-Value language. I have a few practical questions, however. I'm dealing with a large dataset (~1GB) and so my understanding of the nuances of memory

Re: [R] plotmath question

2010-08-19 Thread David Winsemius
On Aug 19, 2010, at 2:46 PM, array chip wrote: Thanks David! I see that I didn't produce the correct answer, but perhaps I'm being thanked for something that was generalizable in that direction. Better would have ben one of these: plot(1, ylab= bquote(italic(P) *.(b)*,*~A) )

Re: [R] plotmath question

2010-08-19 Thread array chip
David, yes, I now see how it worked. Thanks again, John - Original Message From: David Winsemius dwinsem...@comcast.net To: array chip arrayprof...@yahoo.com Cc: baptiste auguie baptiste.aug...@googlemail.com; r-h...@stat.math.ethz.ch Sent: Thu, August 19, 2010 12:12:46 PM Subject:

[R] csv vs. data frame

2010-08-19 Thread Bruce Como
Hi, I am neither a statistician nor a user of R. I am a programmer trying to provide my users (both statisticians and R users) data in a format that works best for them. What is a data frame? Is source data easier to work with in this format or a csv file? Or yet another format? Thanks

[R] How to include trend (drift term) in arima.sim

2010-08-19 Thread StephenRichards
I have been trying to simulate from a time series with trend but I don't see how to include the trend in the arima.sim() call. The following code illustrates the problem: # Begin demonstration program x - c(0.168766559, 0.186874000, 0.156710548, 0.151809531, 0.144638812, 0.142106888,

[R] meta-analysis in R

2010-08-19 Thread zhangweiwei
Dear Sir or Madam, I am trying to explore the citation bias by perfroming meta-analysis. I need to plot a forest plot on some other proportions other than the usual effect size OR,RR, RD. I still do not have any idea after searching google and reading relevant books. Can anyone kindly

[R] Can't read/write to _nonfi

2010-08-19 Thread minh
Good afternoon, Hope you all have a wonderful day. I am glad to be here. Hope you could help me with the following errors that i have been trying to figure it all out since last week. I am using Splus from Insightful, and as i read, R and Splus are very similar. So hope you could help me.

Re: [R] Can't read/write to _nonfi

2010-08-19 Thread stephen sefick
I don't think I understand what the problem is... The code that you provided works just fine without the for loop statement. as for the can't access... The example that you provided doesn't address this. Unless I am totally misunderstanding. R is an interpreted language not compiled. Please,

Re: [R] csv vs. data frame

2010-08-19 Thread Bert Gunter
Do not post such questions to this list. Read an Introduction to R first, please. -- Bert On Thu, Aug 19, 2010 at 12:55 PM, Bruce Como br...@lmcsoftware.com wrote: Hi, I am neither a statistician nor a user of R.  I am a programmer trying to provide my users (both statisticians and R users)

Re: [R] Can't read/write to _nonfi

2010-08-19 Thread William Dunlap
Min, For S+-specific questions the S-news mailing list would be better. s-n...@wubios.wustl.edu Unlike R, S+ stores its data objects in files, one file per object. The ___nonfi (___nonfiles) file contains a mapping for object names to file names, for those objects whose names cannot be

Re: [R] csv vs. data frame

2010-08-19 Thread Erik Iverson
Bruce Como wrote: Hi, I am neither a statistician nor a user of R. I am a programmer trying to provide my users (both statisticians and R users) data in a format that works best for them. It sounds like they would be the best ones to ask then. What is a data frame? Is source data

[R] Aggregate Help

2010-08-19 Thread Hall, Ken (CDC/OSELS/NCPHI)
Please let me know if this is or is not the right place to ask these types of questions. Warning: I am new to R by two days. I have a simple dataset. I have loaded the dataset successfully using the following code: Filepath=(C:\temp\\pilot\dataset1.txt) Pilot=read.table(filepath, header=TRUE)

[R] Gathering different data types for aov etc

2010-08-19 Thread Bryan Hanson
Hello List Folks. I¹m trying to do manova using a function which assembles the response (LHS) and factors (RHS) from different sources. When I do so, the model routines complain that I'm passing a list for the RHS when I don't think I am. Here's a toy example: r - matrix(rnorm(30), ncol = 3) #

Re: [R] Aggregate Help

2010-08-19 Thread Phil Spector
Ken - Try aggregate(Pilot$Count,list(Date=Pilot$Date,illness=Pilot$illness),sum) If you don't want to keep typing Pilot, use with(Pilot,aggregate(Count,list(Date=Date,illness=illness),sum)) Notice that the aggregated variable will be called x in the output data frame from aggregate.

  1   2   >