Re: [R] Stepwise logistic model selection using Cp and BIC criteria

2007-09-17 Thread Dimitris Rizopoulos
For model selection using BIC you can have a look at stepAIC() from package MASS and boot.stepAIC() from package bootStepAIC. For instance, library(bootStepAIC) boot.stepAIC(glmFit1, data, B = 50, k = log(nrow(n))) where `glmFit1' is the object represinting the fitted model, `data' the data.f

Re: [R] programming question

2007-09-17 Thread Gabor Grothendieck
R 2.6.0 has Reduce; myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219) Reduce(function(myvec, p) setdiff(myvec, findSubsets2(p)), myvec, myvec) On 9/16/07, Adrian Dusa <[EMAIL PROTECTED]> wrote: > > Dear list, > > I have a vector of numbers, let's say: > > myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219

[R] Odp: GR&R - Best methods in R

2007-09-17 Thread Petr PIKAL
Hi below you can find a function I wrote to mimic a Minitab R+R procedure. It is intended for myself only so it is not commented. If you want to know how it functions contact me off-list. Regards Petr [EMAIL PROTECTED] napsal dne 17.09.2007 05:55:00: > Dear List, > > Which is the most efici

[R] Must be easy, but haven't found the function (numerical integration)

2007-09-17 Thread Ptit_Bleu
Hi, I have a data frame of 2 columns with the following types : data$day char data$value num And I plot my data with : plot(strptime(donnees$day,format="%Y-%m-%d %H:%M:%S"),donnees$value, type="l") And I'd just like to get the numerical value of the integration of this graph. I looked at ?integ

[R] vector name

2007-09-17 Thread livia
I have got a list named "filtered", I would like to construct alist named "fdata" as following: fdata <- cbind(matrix(unlist(filtered),ncol=28), myregime) If I try names(filtered), it gives all the correct name for each vector, but if I try names(fdata), it appears "filtered[[1]]"

Re: [R] vector name

2007-09-17 Thread Stephen Tucker
Hi, Either of the following should work (I assume there are 28 elements in your list): fdata <- cbind(as.matrix(as.data.frame(filtered)), myregime) fdata <- cbind("colnames<-"(matrix(unlist(filtered),ncol=28), names(filtered)), myregime) --- livia <[EMAIL PROTECTED]> wrote: > > I hav

Re: [R] vector name

2007-09-17 Thread Peter Dalgaard
livia wrote: > I have got a list named "filtered", I would like to construct alist named > "fdata" as following: > > fdata <- cbind(matrix(unlist(filtered),ncol=28), myregime) > > If I try names(filtered), it gives all the correct name for each vector, but > if I try names(fdata), it ap

Re: [R] programming question

2007-09-17 Thread Adrian Dusa
On Monday 17 September 2007, you wrote: > R 2.6.0 has Reduce; > > myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219) > Reduce(function(myvec, p) setdiff(myvec, findSubsets2(p)), myvec, myvec) Thanks Gabor, at first I jumped off my chair but... for many input variables it takes to reduce the vector. M

[R] aggregate function oddity

2007-09-17 Thread Mihalicza Péter
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] aggregate function oddity

2007-09-17 Thread Mihalicza Péter
Dear All, I tried to aggregate the rows according to some factors in a data frame. I got the "Error in Summary.factor(..., na.rm = na.rm) : sum not meaningful for factors" message. This problem was once already discussed in 2003 on this list, where the following solution was given: inclu

[R] Matrix entries not recognised as numeric

2007-09-17 Thread snapperball
Hello, I am using a number of large matrices in a project. I read a couple of the matrices using the read.csv command. However in some instances, R does not recognize the resulting matrices as consisting of numerical values (I suspect R considers them as strings or factors) for instance when I

Re: [R] Must be easy, but haven't found the function (numerical integration)

2007-09-17 Thread Paul Smith
On 9/17/07, Ptit_Bleu <[EMAIL PROTECTED]> wrote: > I have a data frame of 2 columns with the following types : > data$day char > data$value num > > And I plot my data with : > plot(strptime(donnees$day,format="%Y-%m-%d %H:%M:%S"),donnees$value, > type="l") > > And I'd just like to get the numerical

[R] add group to boxplot

2007-09-17 Thread Karin Lagesen
I have two sets of data in data frames (different dimensions). Now, I am able to make boxplots for one of these. I am using a formula, which gives me three boxplots which is automatically placed at at = c(1:3), since there are three groups. However, I would now like to add data from the other dat

Re: [R] Matrix entries not recognised as numeric

2007-09-17 Thread Paul Smith
On 9/17/07, snapperball <[EMAIL PROTECTED]> wrote: > I am using a number of large matrices in a project. I read a couple of the > matrices using the read.csv command. However in some instances, R does not > recognize the resulting matrices as consisting of numerical values (I > suspect R considers

[R] graphs with gradients of colors

2007-09-17 Thread Van Dongen Stefan
Hi All, I would like to fill the area under a curve with a gradient of colors. Are there any packages or trick I could use Thanks Stefan Stefan Van Dongen Antwerp [[alternative HTML version deleted]] __ R-help@r-project.org mailing li

Re: [R] Creating Hmisc labels inside a function

2007-09-17 Thread Steve Powell
Thanks, Frank - it doesn't work though. Your suggestion was: Test=function(obj,labe) { label(obj)=labe #at this point add the line: obj } #...but just returning the object does not permanently change the label: obj That is why I wanted to use assign. But "assign" will not work with attributes,

Re: [R] Matrix entries not recognised as numeric

2007-09-17 Thread Ted Harding
On 17-Sep-07 13:18:10, snapperball wrote: > > Hello, > > I am using a number of large matrices in a project. I read a > couple of the matrices using the read.csv command. However > in some instances, R does not recognize the resulting matrices > as consisting of numerical values (I suspect R con

[R] help not working

2007-09-17 Thread Bill Szkotnicki
Hi, When we install windows R 2.5.1 on a network drive ( the "P: ' drive, actually a samba public share ) R runs well but the windows help is unavailable. It complains about "Navigation to the webpage was cancelled" Does anyone know how to fix that? Thanks, Bill _

Re: [R] help not working

2007-09-17 Thread Uwe Ligges
Bill Szkotnicki wrote: > Hi, > When we install windows R 2.5.1 on a network drive ( the "P: ' drive, > actually a samba public share ) > R runs well but the windows help is unavailable. > It complains about "Navigation to the webpage was cancelled" > Does anyone know how to fix that? This has

[R] Converting zoo dates to ts dates

2007-09-17 Thread Edna Bell
Hi R Gurus I'm using get.hist.quote to obtain monthly historical data. This results in a zoo series. I would like to convert the zoo series to a time series within a function. How do I get the starting date for the ts from the zoo series, please? Thanks, Edna Bell

Re: [R] Converting zoo dates to ts dates

2007-09-17 Thread Gabor Grothendieck
as.ts(z) will convert zoo object z to a ts object. The get.hist.quote retclass= argument can be used to directly output a ts object. On 9/17/07, Edna Bell <[EMAIL PROTECTED]> wrote: > Hi R Gurus > > I'm using get.hist.quote to obtain monthly historical data. > > This results in a zoo series. > >

[R] side bars on dendrograms with latticeExtra

2007-09-17 Thread audrey
Dear all, I am using the heatmap representations of latticeExtra package and I would be interested to draw color side bars representing the groups of a factor of interest. From my understanding of : > help(dendrogramGrob) ... The 'add' argument can be used for additional annotation at the

[R] system.time behavior using source

2007-09-17 Thread Leeds, Mark (IED)
If I type the line below at my Rprompt, it works fine. But, if I put the same line in a file called systest.R and then source that file at the prompt, nothing happens. IF I use R CMD BATCH, it also works in that the system.time info is the .Rout file. Is there something I can do so that this line a

Re: [R] system.time behavior using source

2007-09-17 Thread Gabor Grothendieck
Try this: source("myfile.R", echo = TRUE) On 9/17/07, Leeds, Mark (IED) <[EMAIL PROTECTED]> wrote: > If I type the line below at my Rprompt, it works fine. But, if I put the > same line in a file called systest.R and then source that file at > the prompt, nothing happens. IF I use R CMD BATCH, it

Re: [R] Class probabilities in rpart

2007-09-17 Thread Terry Therneau
> The predict.rpart() function from the rpart library allows for > calculating the class probabilities for a given test case instead of a > discrete class label. > How are these class probabilities derived? Is it simply the proportion > of the majority class to all cases in a leaf node? Th

Re: [R] side bars on dendrograms with latticeExtra

2007-09-17 Thread deepayan . sarkar
On 9/17/07, audrey <[EMAIL PROTECTED]> wrote: > Dear all, > > I am using the heatmap representations of latticeExtra package and I > would be interested to draw color side bars representing the groups of a > factor of interest. From my understanding of : > > > help(dendrogramGrob) > ... > The

Re: [R] Creating Hmisc labels inside a function

2007-09-17 Thread Frank E Harrell Jr
Steve Powell wrote: > > Thanks, Frank - it doesn't work though. > Your suggestion was: > Test=function(obj,labe) { label(obj)=labe #at this point add the line: obj } > #...but just returning the object does not permanently change the label: > obj It does for me. Please re-run. -Fra

Re: [R] Must be easy, but haven't found the function (numerical integration)

2007-09-17 Thread bbolker
On 9/17/07, Ptit_Bleu <[EMAIL PROTECTED]> wrote: > I have a data frame of 2 columns with the following types : > data$day char > data$value num > > And I plot my data with : > plot(strptime(donnees$day,format="%Y-%m-%d %H:%M:%S"),donnees$value, > type="l") > > And I'd just like to get the numeri

Re: [R] help for high-quality plot (wmf) in files

2007-09-17 Thread Bert Gunter
May I ask a related question to tack on to this thread. One can also output a wmf plot to a file through the win.metafile() call. But as the help file says, due to Windows limitations only one plot per file is allowed and one must use parameterized filenames to produce multiple plots, which I ofte

Re: [R] Problem with nlm() function.

2007-09-17 Thread bbolker
Rolf Turner-3 wrote: > > > In the course of revising a paper I have had occasion to attempt to > maximize a rather > complicated log likelihood using the function nlm(). This is at the > demand of a referee > who claims that this will work better than my proposed use of a home- > grown i

Re: [R] removing a specific number of digist from a character string

2007-09-17 Thread Paul Hiemstra
Hi Kim, You could try: substr("060907_17_3_5_1_1_2909.tif", start = 1, stop = 18) ?substr cheers, Paul Kim Milferstedt schreef: > Hello, > > I would like to remove the last 8 digists of character strings in a > vector. Below I added a couple of elements from that vector. > > I have a problem de

Re: [R] removing a specific number of digist from a character string

2007-09-17 Thread Jeffrey Robert Spies
test <- c("060907_17_3_5_1_1_2909.tif", "060907_17_3_5_2_1_2910.tif", "060907_17_3_5_3_1_2911.tif") sub('[[:digit:]][[:digit:]][[:digit:]][[:digit:]]\.tif', '', test) or test <- c("060907_17_3_5_1_1_2909.tif", "060907_17_3_5_2_1_2910.tif", "060907_17_3_5_3_1_2911.tif") sub('[[:digit:]]{4}\.ti

[R] data frame

2007-09-17 Thread Alfredo Alessandrini
Hi everybody, If I've a data frame like this: dataframe a X0 X2 X4 X6 X8 X10 X12 X14 X16 1957 0 0 0 0 0 0 0 0 0 1958 0 0 0 0 0 0 0 0 0 1959 831 0 0 0 0 0 0 0 0 1960 544 282 0 0 0 0 0 0 0 1961 446 365 0 0 0 0 0

Re: [R] data frame

2007-09-17 Thread Stefano Calza
Ciao, do you mean the number of records? something like nrow(a) I would also suggest ncol(a) instad of length, which would work for a matrix as well. [Italian] E' quello che cercavi? [/Italian] Ciao Stefano On Mon, Sep 17, 2007 at 06:05:58PM +0200, Alfredo Alessandrini wrote: Hi everybody

Re: [R] data frame

2007-09-17 Thread Jeffrey Robert Spies
I believe you're looking for: dim(a) dim(a)[1] # Number of observations, in your example, 12 dim(a)[2] # Number of variables per observation, in your example, 9 --Jeff. On Sep 17, 2007, at 12:05 PM, Alfredo Alessandrini wrote: > Hi everybody, > > If I've a data frame like this: > > datafram

Re: [R] removing a specific number of digist from a character string

2007-09-17 Thread Jeffrey Robert Spies
For the sake of absolute correctness: > sub('[[:digit:]]{4}\.tif', '', test) should be sub('[[:digit:]]{4}\\.tif', '', test) -- Jeff. On Sep 17, 2007, at 11:59 AM, Jeffrey Robert Spies wrote: > test <- c("060907_17_3_5_1_1_2909.tif", "060907_17_3_5_2_1_2910.tif", > "060907_17_3_5_3_1_2911.tif

[R] var/cov matrix for a quantile regression model

2007-09-17 Thread Costanza Pizzi
Dear all, I'm trying to get the variance/covarince matrix after fitting a quantile regression model (either linear or non linear), in order to get the variance of my predictions and be able to calculate the median squared error. The commands working for the lm models (corr=T or vcov=T) do not se

Re: [R] removing a specific number of digist from a character string

2007-09-17 Thread Bert Gunter
Please note that the second expression below should be: sub('[[:digit:]]{4}\\.tif', '', test) The backslashes must be doubled: (from the ?regexpr Help file: "Patterns are described here as they would be printed by cat: do remember that backslashes need to be doubled when entering R character st

[R] Create correlated data with skew

2007-09-17 Thread Mike Lawrence
Hi all, I understand that it is simple to create data with a specific correlation (say, .5) using mvrnorm from the MASS library: > library(MASS) > set.seed(1) > > a=mvrnorm( + n=10 + ,mu=rep(0,2) + ,Sigma=matrix(c(1,.5,.5,1),2,2) + ,empirical=T + ) > a

Re: [R] What's the corresponding function in R for lo() function inS-PLUS?

2007-09-17 Thread Charles Annis, P.E.
?loess Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zhijie zhang Sent: Monday, September 17, 2007 1:19 PM To: [EMAIL PROTECTED

[R] color schemes in Tinn-R

2007-09-17 Thread Christopher W. Ryan
A question for anyone using Tinn-R: I find that using the default color scheme with the white background on my laptop hard on the ole' eyes. I see the drop-down menus leading to the ability to change the colors of individual components (numbers, commmands, strings, etc, and the background for eac

Re: [R] graphs with gradients of colors

2007-09-17 Thread Vladimir Eremeev
Maybe this information (from the R's father) can be of some help. http://www.stat.auckland.ac.nz/~ihaka/Graphics/index.html Van Dongen Stefan wrote: > > Hi All, > > I would like to fill the area under a curve with a gradient of colors. Are > there any packages or trick I could use > > Thank

[R] problems with nested loop

2007-09-17 Thread Riddle Chin
Hi, everyone: R is new to me. I am writing a nested loop to simulate data for t-test. The following code is wrong. The subscript is out of bounds. Could anyone tell me how to revise it? Thanks, Riddle Chin. result<-matrix(ncol=5, nrow=1000) colnames(result)<-c('N=20','N=40','N=60','N=8

[R] actually, problems with indexing

2007-09-17 Thread Vladimir Eremeev
Riddle Chin wrote: > > Hi, everyone: > R is new to me. I am writing a nested loop to simulate data for > t-test. The following code is wrong. The subscript is out of bounds. Could > anyone tell me how to revise it? Thanks, Riddle Chin. > > result<-matrix(ncol=5, nrow=1000) > colnames

Re: [R] What's the corresponding function in R for lo() function in S-PLUS?

2007-09-17 Thread Gavin Simpson
On Tue, 2007-09-18 at 01:19 +0800, zhijie zhang wrote: > Dear friends, > In S-PLUS, we can use the following argument, but not in R. > mode12 <- gam(score1 ~ lo(latitude) + lo(longitude)) > I searched the help in S-PLUS, it says lo() Allows the user to specify a > Loess fit in a GAM formula, but

Re: [R] How to produce a macron symbol (overline / overbar) on a plot

2007-09-17 Thread Vladimir Eremeev
xlab=expression(bar(temp)) or xlab=expression(bar(" temp")) The overbar looks like it begins above "e" in the first case. See demo(plotmath). Jason Horn wrote: > > Can anyone tell me how to produce a macron (or overbar or overline) > symbol on an R plot. I have an axis that is labeled "te

Re: [R] var/cov matrix for a quantile regression model

2007-09-17 Thread roger koenker
You need to say summary(rq(),cov=TRUE)$cov see ?summary.rq for further details. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558University of Illinois fax: 217

Re: [R] What's the corresponding function in R for lo() function inS-PLUS?

2007-09-17 Thread Prof Brian Ripley
On Mon, 17 Sep 2007, Charles Annis, P.E. wrote: > ?loess packages gam and mgcv both provide gam() functions in R: package gam is very close to the S(-PLUS) implementation and would fit the model given (in so far as we can tell from a non-reproducible example). loess will allow a general smooth

Re: [R] graphs with gradients of colors

2007-09-17 Thread Chris Stubben
You could use a loop and fill small polygons with colors. x<-seq(-3, 3, .01) y<-eval(expression(x^3-3*x)) plot(x,y, type="n", las=1) n<-length(x) # vertical bars for(i in 1:n) { polygon(c(x[i], x[i], x[i+1], x[i+1]), c(min(y), y[i], y[i+1], min(y)), border=0, col = rainbow(n)[i]) } ## or sp

Re: [R] x-axis order

2007-09-17 Thread Patrick Connolly
On Fri, 14-Sep-2007 at 02:18PM -0400, jim holtman wrote: |> This should do what you want. |> |> x<-c(26:52,1:25) |> y<-rnorm(52)+1:52 |> |> plot(seq_along(x), y, xaxt='n') |> axis(1, at=seq_along(x), labels=x) And if you have to economize on keystrokes, seq(x) will achieve the same as seq_alon

Re: [R] how to compare 2 numeric vectors

2007-09-17 Thread jim holtman
Here is one way of doing it: > v1 [1] 1 1 NA NA 1 NA NA NA NA 1 1 1 NA 1 NA 1 NA NA 1 NA > v2 [1] NA 1 NA 1 1 1 1 1 NA 1 1 NA 1 1 NA NA NA 1 NA 1 > which(!(is.na(v1) | is.na(v2))) [1] 2 5 10 11 14 > On 9/17/07, dxc13 <[EMAIL PROTECTED]> wrote: > > useR's > > I am trying

[R] machine learning and horse racing

2007-09-17 Thread stephenc
Hi I am trying to use various techniques (eg svm, logistic regression, neural networks) to classify and predict the outcome of horse races. Most of my predictive features are categorical - horse, jockey, trainer - and I keep on running out of memory owing to the size of the vector. Does any

Re: [R] x-axis order

2007-09-17 Thread jim holtman
But not necessarily performance. Look at the code for 'seq' and 'seq_along'. Time difference may be small, but keystrokes are done only once. On 9/17/07, Patrick Connolly <[EMAIL PROTECTED]> wrote: > On Fri, 14-Sep-2007 at 02:18PM -0400, jim holtman wrote: > > |> This should do what you want. >

[R] Intermediate R-squared results in stepwise regression

2007-09-17 Thread Yves Moisan
Hi All, Following from https://stat.ethz.ch/pipermail/r-help/1999-April/003834.html this post where someone was asking for "a slick way of asking for the results of doing a forward selection/backward elimination routine?" and someone answered "Call step(), print the anova component of the resul

[R] Histogram with colors

2007-09-17 Thread Alberto Monteiro
Is there a simple way to plot a histogram with colors? For example, suppose I generate random points in the N(2,1) distribution: x <- rnorm(10, mean = 2, sd = 1) Now I would like to plot the histogram: hist(x) but I would like to show the bars with x < 0 in red, and the bars with x >=

Re: [R] How to produce a macron symbol (overline / overbar) on a plot

2007-09-17 Thread Marc Schwartz
On Mon, 2007-09-17 at 14:00 -0400, Jason Horn wrote: > Can anyone tell me how to produce a macron (or overbar or overline) > symbol on an R plot. I have an axis that is labeled "temp", but I > need the overbar symbol over the entire word. See ?plotmath and the examples therein. Example: p

[R] Proposal: Archive UseR conference presentations at www.r-project.org/useR-yyyy

2007-09-17 Thread Earl F. Glynn
"hadley wickham" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Many of the presentations and posters from UseR! 2007 are now available > online: > http://user2007.org/program/ The UseR 2006 conference info and presentations are part of www.r-project.org, namely http://www.r-proj

[R] Problems with compiling rimage on macOS

2007-09-17 Thread Thomas Heine
hello, i want to install the rimage package (0.5-7) into my R (2.5.1). i installed the "i686-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)" from the macOS cd and created symbolic links to gcc and g++. well if i try now to install the package in R the console says: g++

Re: [R] are hurdle logit-poisson model and posson model nested?

2007-09-17 Thread bbolker
Wensui Liu wrote: > > Dear Listers, > I have a general statistical question. Are hurdle logit-poisson model > and posson model nested? > You might have to give us a little more detail. On first glance, my impression is that the Poisson model is _not_ nested in the hurdle-Poisson, because t

Re: [R] Cannot get contrasts to work with aov.

2007-09-17 Thread bbolker
ThatDeadDude wrote: > > I have been trying for hours now to perform an orthogonal contrast through > an ANOVA in R. > > I have done a two-factor factorial experiment, each factor having three > levels. I converted this dataset to a dataframe with one factor with nine > treatments, as I cou

[R] removing a specific number of digist from a character string

2007-09-17 Thread Kim Milferstedt
Hello, I would like to remove the last 8 digists of character strings in a vector. Below I added a couple of elements from that vector. I have a problem defining a pattern to replace the digits using for example "sub". Removing the ".tif" part works fine using sub('.tif',"",x), but how do I ge

[R] What's the corresponding function in R for lo() function in S-PLUS?

2007-09-17 Thread zhijie zhang
Dear friends, In S-PLUS, we can use the following argument, but not in R. mode12 <- gam(score1 ~ lo(latitude) + lo(longitude)) I searched the help in S-PLUS, it says lo() Allows the user to specify a Loess fit in a GAM formula, but i didn't find the correponding function in R. Anybody knows how

Re: [R] data frame

2007-09-17 Thread jim holtman
?str On 9/17/07, Alfredo Alessandrini <[EMAIL PROTECTED]> wrote: > Hi everybody, > > If I've a data frame like this: > > dataframe a > > X0 X2 X4 X6 X8 X10 X12 X14 X16 > 1957 0 0 0 0 0 0 0 0 0 > 1958 0 0 0 0 0 0 0 0 0 > 1959 831 0 0 0 0 0 0

Re: [R] Histogram with colors

2007-09-17 Thread Ross Darnell
Not really but a better plot call would be plot(x.hist,col=ifelse(x.hist$breaks<0,"red","green")) Ross Darnell -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alberto Monteiro Sent: Tuesday, 18 September 2007 6:12 AM To: [EMAIL PROTECTED] Subject: [R]

[R] How to produce a macron symbol (overline / overbar) on a plot

2007-09-17 Thread Jason Horn
Can anyone tell me how to produce a macron (or overbar or overline) symbol on an R plot. I have an axis that is labeled "temp", but I need the overbar symbol over the entire word. Thanks, Dr. Jason W. Horn Research Associate Boston University Department of Biology 5 Cumington Street Boston,

[R] Sourcing encrypted files

2007-09-17 Thread Dennis Fisher
Colleagues, I have an unusual problem; I am wondering whether anyone has dealt with it and found a solution. I have a script that needs to be encrypted. R will then be run on the script. There are various means to decrypt the file, some of which leave the decrypted code on the hard drive

Re: [R] Repeated measures logistic regression

2007-09-17 Thread Andy Fugard
Dear all, Thanks to everyone who replied off list to my (rambling) question earlier this year! I have put pointers to things I found useful over here: http://tinyurl.com/yvvvn9 Thought it might be helpful to share as now and again I receive emails from people wondering if I ever made p

Re: [R] Sourcing encrypted files

2007-09-17 Thread Marc Schwartz
On Mon, 2007-09-17 at 15:56 -0700, Dennis Fisher wrote: > Colleagues, > > I have an unusual problem; I am wondering whether anyone has dealt > with it and found a solution. > > I have a script that needs to be encrypted. R will then be run on > the script. There are various means to decrypt

[R] how to compare 2 numeric vectors

2007-09-17 Thread dxc13
useR's I am trying to compare two vectors that have the same length. More specifically, I am interested in comparing the corresponding positions of each element in the vector. Consider these two vectors of length 20: v1 <- 224NA NA NA 10 NA NA NA NA NA NA NA NA NA NA

Re: [R] Problem with nlm() function.

2007-09-17 Thread Rolf Turner
A couple of people have expressed an interest in having a look at the problematic code/package which led my cri de coeur posted yesterday. I have therefore made the package accessible by putting it up on my UNB web page: http://www.math.unb.ca/~rolf Click on ``Hidden generalized li

Re: [R] machine learning and horse racing

2007-09-17 Thread Moshe Olshansky
Hi Stephen, How many variables do you have? How many of them are categorical? How many observations do you have? Since I am not a racing expert, in how many races a typical horse participates? How many years does it usually span? In the past I had a good experience with Random Forest. There exis

[R] How can I write routines and scripts in the R environment ?

2007-09-17 Thread Maura E Monville
*I would like to plot some semi-periodic signals as a function of the phase expressed as a value in [0,2PI]* *The problem is that the phase data is reported as the residual of the division by 2PI.* *For instance if the phase is 10.359 rd then:* *15.359 / 6.283185 = 2*6.283185 + 2.79263* *then onl

Re: [R] Histogram with colors

2007-09-17 Thread hadley wickham
On 9/17/07, Alberto Monteiro <[EMAIL PROTECTED]> wrote: > Is there a simple way to plot a histogram with colors? > > For example, suppose I generate random points in the > N(2,1) distribution: > > x <- rnorm(10, mean = 2, sd = 1) > > Now I would like to plot the histogram: > > hist(x) > > b

Re: [R] MAD

2007-09-17 Thread Deepayan Sarkar
On 9/17/07, Nair, Murlidharan T <[EMAIL PROTECTED]> wrote: > > I am calculating the median absolute deviation using mad function, and > it tends to ignore the parameter constant=1, when I am calculating it > for x=seq(1:5). Am I missing something here? > > x<-seq(1:5) > mad(x)# gives [1] 1.4826 > m

Re: [R] What's the corresponding function in R for lo() function inS-PLUS?

2007-09-17 Thread zhijie zhang
I have read the gam() function in mgcv package, and find that it's inappropriate for the additive model. So i didn't go further. I may have solved it if i can search more info on gam. Thanks a lot anyway, it has been solved with your help. On 9/18/07, Prof Brian Ripley <[EMAIL PROTECTED]> wro

[R] MAD

2007-09-17 Thread Nair, Murlidharan T
I am calculating the median absolute deviation using mad function, and it tends to ignore the parameter constant=1, when I am calculating it for x=seq(1:5). Am I missing something here? x<-seq(1:5) mad(x)# gives [1] 1.4826 mad(x, constant=1)# gives [1] 1 #Here is the long form dev.from.median<-ab

Re: [R] machine learning and horse racing

2007-09-17 Thread jim holtman
Need more information. What is your operating system, how much memory do you have, how big is your data, what operations are you failing on, etc. On 9/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi > > I am trying to use various techniques (eg svm, logistic regression, > neural network

Re: [R] applying math/stat functions to rows in data frame

2007-09-17 Thread Gerard Smits
Hi all, Thanks for the suggestions. I have not yet tried the apply () approach, but have tried to get the indexed version working, so far with limited success. I realize that a transpose, as suggested, would work, but want to avoid that for something simpler. To repeat, the task is to perform

Re: [R] how to compare 2 numeric vectors

2007-09-17 Thread Moshe Olshansky
Below is one way to do this: > v1<-c(2,2,4,NA,NA,NA,10,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA) > v2<-c(NA,4,NA,NA,NA,NA,10,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,100,NA) > length(v1) [1] 20 > length(v2) [1] 20 > intersect(which(!is.na(v1)),which(!is.na(v2))) [1] 2 7 > --- dxc13 <[EMAIL PROTECTED]> wro

[R] help for high-quality plot again

2007-09-17 Thread Zheng Lu
Dear all: Thank you very much for your help. Actually, I save the plot(mfrow=c(2,3))as metafile, however, when I insert picture from the file in word to import this plot picture, everything seems to be shrinked. Is there anyone having good experience with import graph from R to Word document?

[R] map issues

2007-09-17 Thread Alexander Nervedi
Hi ! I have a shapefile that I can easily read into R using library(maptools). My problem stems from some warning messages that come even though everything seems to work fine. library(maptools) districts <- read.shape(filen = "a_ds", dbf.data = TRUE) length(districts$Shapes) so far so good. w

[R] Installing add-on packages

2007-09-17 Thread jpleis1
Admittedly, I don't have much experience with R. I have dowloaded and installed some add-on packages (leaps, for one). When I try to run the leaps function I get the following error: Error: could not find function "leaps" Any idea on what the problem could be? Thanks, -- John R Pleis __

Re: [R] help for high-quality plot again

2007-09-17 Thread Duncan Mackay
I have found through experience to use win.metafile produce a .wmf file and in word insert the picture as a file. The trick is to do produce everything as it will appear in the word document. Size is critical. The width and height of the wmf file must be as it will appear in word eg win.metafile

[R] Problem in extracting EQY_DVD_HIST from Bloomberg

2007-09-17 Thread Shubha Vishwanath Karanth
Hi R, Again the problem in Bloomberg, I give the below code, > con = blpConnect(show.days="trading",na.action="previous.days",periodicity="da ily")# connecting Bloomberg > div <- blpGetData(con,"IBM US Equity","EQY_DVD_HIST",start=as.chron(as.Date("01/01/2005", "%m/%d/%Y")),end=as.chron(Sys

Re: [R] system.time behavior using source

2007-09-17 Thread Prof Brian Ripley
You need to print the result of an expression if used from source(). Autoprinting only occurs at the top level. E.g. % cat > systest.R print(system.time(for(i in 1:100) mad(runif(1000 > source("systest.R") user system elapsed 0.140.000.20 On Mon, 17 Sep 2007, Leeds, Mark (IE

Re: [R] Installing add-on packages

2007-09-17 Thread Stefan Grosse
On Tuesday 18 September 2007 07:23:17 [EMAIL PROTECTED] wrote: jp > Admittedly, I don't have much experience with R. I have dowloaded and jp > installed some add-on packages (leaps, for one). When I try to run the jp > leaps function I get the following error: jp > jp > Error: could not find func

[R] FW: ISIN numbers into Bloomberg tickers

2007-09-17 Thread Shubha Vishwanath Karanth
Hi David, I tried the following and get the below error messages con = blpConnect(show.days="trading",na.action="previous.days",periodicity="da ily")# connecting Bloomberg > dat <- blpGetData(con,"US4009703799 Equity","PX_LAST",start=as.chron(as.Date("01/01/2005", "%m/%d/%Y"),end=as.chron(Sy

Re: [R] Sourcing encrypted files

2007-09-17 Thread Prof Brian Ripley
On Mon, 17 Sep 2007, Dennis Fisher wrote: > Colleagues, > > I have an unusual problem; I am wondering whether anyone has dealt > with it and found a solution. > > I have a script that needs to be encrypted. R will then be run on > the script. There are various means to decrypt the file, some of