Re: [R] Finding data association in R

2009-05-18 Thread Johannes Hüsing
Am 19.05.2009 um 05:39 schrieb phen_ys: surgery <- data.frame(outcome = c(0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0), age = c(50, 50, 51, + 51, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, + 59, 60, 6

Re: [R] how to calculate means of matrix elements

2009-05-18 Thread Chris Stubben
dxc13 wrote: > > If these three matrices are given in separate text files, how can I > write code that will get this result I need? > If you have matrices in separate text files like mat1.txt, mat2.txt, mat3.txt, you could load them into a list using a loop x<- vector('list', 3) for ( i i

[R] fitting distribution

2009-05-18 Thread Kon Knafelman
Hey Guys, i have the sample variances for 1000 samples, and i want to fit it to a chi-squared distribution. after making a loop for the simulation initially, i have the following code to compute the variances samples = replicate(n, rnorm(m, 0, 1), simplify=FALSE) variances = sapply(samples, va

Re: [R] Multi-Row Lattice Plot With Y Axis on Same Side

2009-05-18 Thread jimdare
Thank you. Duncan Mackay-2 wrote: > > Hi > > A toy example which you omitted > dat <- data.frame(x = rep(1:10,2),y = rnorm(20), gp = rep(letters[1:2], > each=10) ) > > xyplot(y~x|gp,dat, scales = list(y = list("alternating" = 3))) > > see ? xyplot and scales > > a slimmed down > sessionIn

Re: [R] Overlay two quantreg coefficients plots

2009-05-18 Thread Duncan Mackay
Hi I am unsure whether you want to plot the two summaries on the one "panel" or have 2 "panels" 1 for each summary If it is the latter ? layout / ?par HTH Regards Duncan Mackay Department of Agronomy and Soil Science University of New England ARMIDALE NSW 2351 At 08:45 19/05/2009, you wr

[R] Finding data association in R

2009-05-18 Thread phen_ys
> surgery <- data.frame(outcome = c(0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0), age = c(50, 50, 51, + 51, 53, 54, 54, 54, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, + 59, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 64, 6

[R] Grouping using pairs function

2009-05-18 Thread phen_ys
> bodies <- data.frame(chest = c(34, 37, 38, 36, 38, 43, 40, 38, + 40, 41, 36, 36, 34, 33, 36, 37, 34, 36, 38, 35), waist = c(30, + 32, 30, 33, 29, 32, 33, 30, 30, 32, 24, 25, 24, 22, 26, 26, + 25, 26, 28, 23), hips = c(32, 37, 36, 39, 33, 38, 42, 40, + 37, 39, 35, 37, 37, 34, 38, 37, 38, 37, 40,

Re: [R] Multi-Row Lattice Plot With Y Axis on Same Side

2009-05-18 Thread Duncan Mackay
Hi A toy example which you omitted dat <- data.frame(x = rep(1:10,2),y = rnorm(20), gp = rep(letters[1:2], each=10) ) xyplot(y~x|gp,dat, scales = list(y = list("alternating" = 3))) see ? xyplot and scales a slimmed down sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 attached bas

Re: [R] how to calculate means of matrix elements

2009-05-18 Thread Gabor Grothendieck
Try this: (mat1 + mat2 + mat3) / 3 On Mon, May 18, 2009 at 8:40 PM, dxc13 wrote: > > useR's, > I have several matrices of size 4x4 that I want to calculate means of their > respective positions with.  For example, consider I have 3 matrices given by > the code: > mat1 <- matrix(sample(1:20,16,re

Re: [R] how to calculate means of matrix elements

2009-05-18 Thread jim holtman
You can convert it to an array and then use apply: > mat1 [,1] [,2] [,3] [,4] [1,]32 124 [2,] 14 13 132 [3,] 15969 [4,]2 15 13 19 > mat2 [,1] [,2] [,3] [,4] [1,]0 11 107 [2,] 1293 13 [3,] -4 130 14 [4,] -

[R] RGoogleDocs: can now see documents but cannot get content.

2009-05-18 Thread Farrel Buchinsky
The author of the package, Duncan Temple Lang posted an update. I have installed it and now can list my spreadsheets but alas I cannot read the data within any of them. Has anybody been able to get it to work. I would love to see a real live example of sheetAsMatrix I am not sure how to specify she

[R] how to calculate means of matrix elements

2009-05-18 Thread dxc13
useR's, I have several matrices of size 4x4 that I want to calculate means of their respective positions with. For example, consider I have 3 matrices given by the code: mat1 <- matrix(sample(1:20,16,replace=T),4,4) mat2 <- matrix(sample(-5:15,16,replace=T),4,4) mat3 <- matrix(sample(5:25,16,repl

[R] normal score transformation...

2009-05-18 Thread Fernando Marmolejo Ramos
Dear R members I’m interested in reviewing some data transformations. I’ve found literature regarding Box-Cox, logarithmic and square-root transformations. I know there is a library called “coin” which contains a transformation called normal score transformation (see “normal_trafo” function). How

[R] About " Error: C stack usage is too close to the limit"--resend

2009-05-18 Thread goon83
Hi everyone! I meet one problem when embedding R in C code, when I run the the R code in one child thread , it always print error info: Error: C stack usage is too close to the limit I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-ext doc say,

[R] Overlay two quantreg coefficients plots

2009-05-18 Thread Christian Lehmann
Dear R-mailing list, I would like to overlay to two quantreg coefficients plots. I have plot(summary(rq(ff~tipo,tau = 1:49/50,data=Spilldata))) plot(summary(rq(ff~tipo,tau = 1:49/50,data=Spilldata1))) Is there a possibility to display the two in the same graph? Thank you so much!!! Christian

[R] Overlay two quantreg coefficients plots

2009-05-18 Thread Christian Lehmann
Dear R-mailing list, I would like to overlay two quantreg coefficients plots. I have plot(summary(rq(ff~tipo,tau = 1:49/50,data=Spilldata))) plot(summary(rq(ff~tipo,tau = 1:49/50,data=Spilldata1))) Is there a possibility to display the two in the same graph? Thank you so much!!! Christian

[R] How to plot a surface plot (+contour map) from this data

2009-05-18 Thread Morpheous
I am new to R. I have 3 dimensional data as follows: X axis: date values (e.g. Jan-01, Feb-01 Jan-06) Y axis: float values Z axis: float values I would like to plot this data into a surface plot with a contour map underneath the surface plot, using this data. I would be very grateful for an

[R] Wilcoxon nonparametric p-values

2009-05-18 Thread cvandy
When I use wilcox.test, I get vastly different p-values than the problems from Statistics textbooks. For example: The following problem comes from "Applied Statistics and Probability for Engineers", 2nd Edition, by D. C. Montgomery. Page736, problem 14.7. The problem is to compare the sample dat

Re: [R] Using apply() and scale() in combination

2009-05-18 Thread Peter Alspach
Tena koe Armin >From the help file of apply(): If each call to 'FUN' returns a vector of length 'n', then 'apply' returns an array of dimension 'c(n, dim(X)[MARGIN])' if 'n > 1'. So, one should expect what you got in the second case. You can, of course, transpose the result using t

[R] Multi-Row Lattice Plot With Y Axis on Same Side

2009-05-18 Thread jimdare
Hi Everyone, I have been creating a lattice plot with the layout = c(1,2). For some reason my boss wants the Y axis of both plots to be on the left hand side of the graph. Is there a way to do this? Regards, James -- View this message in context: http://www.nabble.com/Multi-Row-Lattice-Plot-

Re: [R] Connection to Microsoft SQL Server

2009-05-18 Thread David Scott
On Mon, 18 May 2009, Uwe Ligges wrote: Meenu Sahi wrote: Dear Users I am new to R. I'm trying to make a connection to Microsoft SQL Server via R. How can I find the correct syntax to make the connection? The Help pdf file has an example for mySql but there's isnt much on SQL Server. Please he

Re: [R] stringsAsFactors param in expand.grid not working

2009-05-18 Thread Rolf Turner
On 19/05/2009, at 10:20 AM, Steve Lianoglou wrote: Hi all, I've (tried) to look through the bug tracker, and gmane-search the R list to see if this has been mentioned before, and it looks like it hasn't. According to the R 2.9.0 release notes[1], the expand.grid function should now take

Re: [R] Generic 'diff'

2009-05-18 Thread Stavros Macrakis
On Mon, May 18, 2009 at 6:00 PM, Gabor Grothendieck wrote: > I understood what you were asking but R is an oo language so > that's the model to use to do this sort of thing. > I am not talking about creating a new class with an analogue to the subtraction function. I am talking about a function

[R] stringsAsFactors param in expand.grid not working

2009-05-18 Thread Steve Lianoglou
Hi all, I've (tried) to look through the bug tracker, and gmane-search the R list to see if this has been mentioned before, and it looks like it hasn't. According to the R 2.9.0 release notes[1], the expand.grid function should now take a stringsAsFactor=LOGICAL argument which controls whether

Re: [R] Generic 'diff'

2009-05-18 Thread Gabor Grothendieck
I understood what you were asking but R is an oo language so that's the model to use to do this sort of thing. On Mon, May 18, 2009 at 5:48 PM, Stavros Macrakis wrote: > I guess I wasn't very clear.  The goal is not to define diff on a different > object type, but to have a different 'subtraction

Re: [R] Generic 'diff'

2009-05-18 Thread Stavros Macrakis
I guess I wasn't very clear. The goal is not to define diff on a different object type, but to have a different 'subtraction' operator with the same lag logic. An easy example would be quotient instead of subtraction. Of course I could do that by simply cutting and pasting diff.default and replac

[R] Using apply() and scale() in combination

2009-05-18 Thread Armin Raznahan
Hello I am an R newbie, and am coming against a couple of problems when I try and apply the scale function across all the rows of a matrix. - #I have a matrix "dt_l". > str(dt_l) num [1:40962, 1:885] 3.04 4.1 3.4 3.58 3.77 ... #I want to convert the values in each row

Re: [R] Generic 'diff'

2009-05-18 Thread Gabor Grothendieck
You can define a new class for the object diff operates on and then define your own diff method for that. For some examples see: methods(diff) On Mon, May 18, 2009 at 4:24 PM, Stavros Macrakis wrote: > I would like to apply a function 'f' to the lagged version of a vector and > the vector itse

Re: [R] error in importing text files

2009-05-18 Thread jim holtman
For the sample of data that you provided, I would read it fine: > x <- read.table('clipboard') > x V1 V2 V3 V4 V5 V6V7 V8 1 20080204131646 2 32 560 63 6 0 NA 2 20080204131646 2 33 152 -1 7 0 NA 3 20080204150043 2 -32767 0 0 65535 NA 4 20080

Re: [R] Runtime Error! Keep on happening while using amap, anacor and ca pckg

2009-05-18 Thread Antoine
Hi, Thanks for this detailed bug, I have fixed it. I upload a patch on cran (amap with version 0.8-3) Antoine. On Mon, 18 May 2009 14:20:21 +0200 Uwe Ligges wrote: > After Ana Kolar sent me some code in a private mesage: > > I reduced that to a minimal example that crashed R - due to a bug

[R] Predicting complicated GAMMs on response scale

2009-05-18 Thread William Paterson
Hi, I am using GAMMs to show a relationship of temperature differential over time with a model that looks like this:- gamm(Diff~s(DaysPT)+AirToC,method="REML") where DaysPT is time in days since injury and Diff is repeat measures of temperature differentials with regards to injury sites compar

[R] Generic 'diff'

2009-05-18 Thread Stavros Macrakis
I would like to apply a function 'f' to the lagged version of a vector and the vector itself. This is easy to do explicitly: mapply( f, v[-1], v[-length(v)] ) or in the case of a pointwise vector function, simply f( v[-1], v[-length(v)] ) This is essentially the same as 'diff' but

Re: [R] error in importing text files

2009-05-18 Thread Eric McKibben
Hi Steve, Thanks for the reply. My initial thought was just as you indicated, one of the rows must be missing an element. Interestingly, all of the rows in that text file had 8 columns. I went directly to the line in the text file indicated in the error and there was nothing unusual about th

Re: [R] MEXVAL

2009-05-18 Thread Mihai Nica
Sorry, I thought it is relatively known. It appears it was introduced by Clopper Almon, University of Maryland. One reviewer suggested I would use it... So I am trying to do what I was told. "A convenient way to express the answer is to ask by what percent the standard error of estimate goes up

[R] Barchart in lattice - wrong order of groups, data labels on top of each other, and a legend question

2009-05-18 Thread Dimitri Liakhovitski
Hello! I have a question about my lattice barchart that I am trying to build in Section 3 below. I can't figure out a couple of things: 1. When I look at the dataframe "test" that I am trying to plot, it looks right to me (the group "Total" is always the first out of 5). However, in the chart it is

Re: [R] Question about barplot: gridlines & value labels

2009-05-18 Thread Dimitri Liakhovitski
Thanks a lot - I am trying it with lattice now On Sat, May 16, 2009 at 10:44 PM, Duncan Mackay wrote: > Dimitri > > You mentioned lattice so I presumed that you tried a barchart in lattice > > if you found the class of table.a.percents will it comply with the lattice > requirements of the data ty

Re: [R] Superscripts and subscripts in trellis graphics

2009-05-18 Thread Steve_Friedman
Gabor's solution has worked very nicely. Thank you very much. Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147

Re: [R] MAC OSX vs Win XP: Different stats test results!

2009-05-18 Thread Mike Lawrence
A good example of why manipulating data in external programs is dangerous. See a discussion of this at http://tolstoy.newcastle.edu.au/R/e6/help/09/05/13697.html On Mon, May 18, 2009 at 10:56 AM, Mareen Weber wrote: > > Hello Peter, > thanks for your quick response - you have hinted into the righ

Re: [R] bagged importance estimates in earth problem

2009-05-18 Thread Joseph Retzer
Thanks for the info. some notes below: --- On Mon, 5/18/09, Max Kuhn wrote: From: Max Kuhn Subject: Re: [R] bagged importance estimates in earth problem To: "Joseph Retzer" Cc: gavin.simp...@ucl.ac.uk, "R help" Date: Monday, May 18, 2009, 1:03 PM > If you read my message closely,  you'll see

Re: [R] bagged importance estimates in earth problem

2009-05-18 Thread Max Kuhn
> If you read my message closely,  you'll see I'm indicating that the check > error "may" explain why  carat 4.15 _is not available in CRAN binaries_. > Because of this (not having the latest version) I suspect varImp is > returning the error I detailed. Ok, but your diagnosis of the issue may hav

Re: [R] Matrix package,solve() errors and crashes Please help

2009-05-18 Thread Surendar Swaminathan
Hello Martin, Thank you very much for the reply. Thanks for solving the problem earlier I was not aware of it.I did not receive any message and that is what made me to post it again. Thank you once again. I will let the person know about the solve(a,Matrix(b)) I still have this doubt.I still g

[R] multinom() and parameters

2009-05-18 Thread Vladimir Bezlyak
Dear All, I am doing multinomial logistic regression with multinom(). I have to process many variables and I created a function which biulds the models and format the results (see below). It works prefect when I set the variables and the dataset locally Outcome <- "Group" covars

[R] comparing two ROCs

2009-05-18 Thread Xiao Li
Dear R-helper, I am trying to compare two AUCs derived from same population, but one is derived by adding extra features on top of the other. I found the codes below from R-help. I would like to know, in my case, whether I could use cROC, and also how can I got the right correlation (r)? I have be

[R] (no subject)

2009-05-18 Thread hadeel klakattawi
hi if I have sample of discret observations, and I want to test if this sample is follwed by a certion discret distribution for example: geometric distribution, negative binomial distribution, and so on (i.e chisq-goodness of fit test), how can I do this in R "in S+ we can use (chisq.gof)" t

[R] discrepancies between stata and r for a cox regression

2009-05-18 Thread Michel Boutsen
Hello I would like to develop the use of R. Trying R and more particulary the cox model, I am surprised by discrepancies between results with stata and R for a cox model With the same data base, I get a hazard ratio (4.82) that is not the same obtained with stata (4.52) You will find attached

Re: [R] MAC OSX vs Win XP: Different stats test results!

2009-05-18 Thread Mareen Weber
Hello Peter, thanks for your quick response - you have hinted into the right direction. I triple-checked my data and - how embarrassing - I actually did have different data matrices. Due to a faulty Win Excel macro that sorted data into groups after data collection, I ended up with different da

Re: [R] bagged importance estimates in earth problem

2009-05-18 Thread Joseph Retzer
Max, If you read my message closely,  you'll see I'm indicating that the check error "may" explain why  carat 4.15 _is not available in CRAN binaries_. Because of this (not having the latest version) I suspect varImp is returning the error I detailed. Can you provide information as to why 4.15

[R] RES: Read.table problems

2009-05-18 Thread Leandro Marino
I was having this problem with a file. My problem was a ' indo the name, link Ricardo D'avilla, the ' skipped all sep to the end of the file. Maybe it is your problem. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeir

Re: [R] bagged importance estimates in earth problem

2009-05-18 Thread Max Kuhn
Joe, On Mon, May 18, 2009 at 11:01 AM, Joseph Retzer wrote: > Thanks for your response Gavin. I get the same error as I noted before when > running the example from bagEarth. > > earth and caret are the most recent versions (on the MAC) available on CRAN > binaries, 2.0-5 and 3.45 respectively.

Re: [R] Read.table problems

2009-05-18 Thread Marc Schwartz
On May 18, 2009, at 11:24 AM, Steve Murray wrote: Dear all, I have a file which I've converted from NetCDF (.nc) to text (.txt) using ncdump in Unix (as I had problems using the ncdf package to do this). The first few rows (as copied and pasted from the Unix console) of the file appear a

Re: [R] build CONTENTS or 00Index.html without installing whole package

2009-05-18 Thread Jonathan Baron
Replying to my own message, I've now fixed up the bash script so that it works (below). I don't think that buildVignettes does anything I need, so I commented it out (but now runs). Rscript, and not R CMD (which I was mistakenly using before), seems to be the way to run arbitrary R functions from

Re: [R] discrepancies between stata and r for a cox regression

2009-05-18 Thread Gary Collins
try res <- coxph(Surv(TIME, STATUS)~TREAT, data=leukemia, method="breslow") R default for handling ties is Efron's method, whereas it's Breslow for STATA. Have a look under method in ?coxph it clearly states this, and STATA output clearly states the Breslow method for ties in the output of

[R] Read.table problems

2009-05-18 Thread Steve Murray
Dear all, I have a file which I've converted from NetCDF (.nc) to text (.txt) using ncdump in Unix (as I had problems using the ncdf package to do this). The first few rows (as copied and pasted from the Unix console) of the file appear as follows: _, _, _, _, _, _, _, _, _, _, _, _, _, _, _

Re: [R] discrepancies between stata and r for a cox regression

2009-05-18 Thread Achim Zeileis
On Mon, 18 May 2009, Michel Boutsen wrote: Hello I would like to develop the use of R. Trying R and more particulary the cox model, I am surprised by discrepancies between results with stata and R for a cox model With the same data base, I get a hazard ratio (4.82) that is not the same obta

[R] discrepancies between stata and r for a cox regression

2009-05-18 Thread Michel Boutsen
Hello I would like to develop the use of R. Trying R and more particulary the cox model, I am surprised by discrepancies between results with stata and R for a cox model With the same data base, I get a hazard ratio (4.82) that is not the same obtained with stata (4.52) You will find attached

Re: [R] comparing two ROCs

2009-05-18 Thread Xiao Li
> Dear R-helper, > > I am trying to compare two AUCs derived from same population, but one > is derived by adding extra features on top of the other. I found the > codes below from R-help. I would like to know, in my case, whether I > could use cROC, and also how can I got the right correlation (r)

Re: [R] error in importing text files

2009-05-18 Thread Steve_Friedman
Eric, The error suggests that the file has an inconsistent number of attributes. You should inspect the file to make sure that each line has the same number of expected attributes (columns). If one or more is missing, it suggests that the data collection process from the Palm Pilot is not what

Re: [R] bagged importance estimates in earth problem

2009-05-18 Thread Joseph Retzer
Thanks for your response Gavin. I get the same error as I noted before when running the example from bagEarth. earth and caret are the most recent versions (on the MAC) available on CRAN binaries, 2.0-5 and 3.45 respectively. I see that the CRAN checks for caret lists an error status for vers

Re: [R] Superscripts and subscripts in trellis graphics

2009-05-18 Thread Simon Pickett
Hi Steve, you need to use the expression() function. I think it is described under ?plotmath. Defo works with mtext, not sure about ylab. try ylab(text=c(expression(paste("Hatched Eggs R"^{2} etc. - Original Message - From: To: Sent: Monday, May 18, 2009 3:25 PM Subject: [R]

Re: [R] Superscripts and subscripts in trellis graphics

2009-05-18 Thread Gabor Grothendieck
Try: R2 <- -0.18 panel.text(label = bquote(R^2 == .(R2)), ... On Mon, May 18, 2009 at 10:25 AM, wrote: > > I'd like to annotate an xyplot with an R^2 value, but can not find the > syntax to define the superscript format for the text. > > I'd appreciate suggestions, > > xyplot(SharkSloughEggs.d

Re: [R] intermediate iterations of stepwise regression

2009-05-18 Thread Peter Flom
utkarshsinghal wrote >> Hi all, >> >> I am performing a stepwise regression by running the "step" function on an >> "lm" object. Now I want to save the intermediate iterations. I know the >> argument trace=T will print it on the console, but I rather want to assign >> it to some R object or may b

[R] error in importing text files

2009-05-18 Thread Eric McKibben
Hello All: I am very new to R and am trying to import some (107) text files into R while simultaneously manipulating the data into a structure that I can use. Below is a description of what I am trying to ultimately accomplish. However, I find that I am unable to even read one file into R usin

Re: [R] Seewave options

2009-05-18 Thread Uwe Ligges
Thiago de Carvalho wrote: Good afternoon, My name is Thiago. I'm a graduate student and affiliated to an Anuran Bioacustic and Systematics Laboratory at UFU (Federal University of Uberlândia) in Brazil. The professor in charge of the lab (Dr. Ariovaldo Antonio Giaretta) and I have recently b

[R] Superscripts and subscripts in trellis graphics

2009-05-18 Thread Steve_Friedman
I'd like to annotate an xyplot with an R^2 value, but can not find the syntax to define the superscript format for the text. I'd appreciate suggestions, xyplot(SharkSloughEggs.df$Sharkeggs.rel + SharkSloughEggs.df$SharkHatched.rel + SharkSloughEggs.df$SharkFlooded.rel + HSI.shark$MEAN ~ Year,

Re: [R] intermediate iterations of stepwise regression

2009-05-18 Thread Gabor Grothendieck
Don't use = to mean assign. Replace all your equal signs (except the ones intended to refer to argument names) with <- . On Mon, May 18, 2009 at 10:10 AM, utkarshsinghal wrote: > Hi Gabor, > > Thanks for your input. It is of some help if not all. > > fit = lm(y~1, data) > out = capture.output(ne

Re: [R] (no subject)

2009-05-18 Thread Thomas Lumley
On Mon, 18 May 2009, Debbie Zhang wrote: Based on a set of binomial sample data, how would you utilize the "nlm" function in R to estimate the true proportion of the population? I can't see why anyone would want to use nlm() for this. The sample proportion is the MLE, and binom.test() gives

Re: [R] sample variance from simulation

2009-05-18 Thread Mike Lawrence
Ah, I thought this smelled like homework... Please read the R-help mailing list posting guide (http://www.r-project.org/posting-guide.html), specifically: "Basic statistics and classroom homework: R-help is not intended for these." On Mon, May 18, 2009 at 10:35 AM, Kon Knafelman wrote: > Hey,

Re: [R] intermediate iterations of stepwise regression

2009-05-18 Thread utkarshsinghal
Hi Gabor, Thanks for your input. It is of some help if not all. fit = lm(y~1, data) out = capture.output(new.fit = step(fit, direction="forward", scope=y~x1+x2+x3)) Here the assignments made inside the capture.output function are no longer valid once I came out of it, i.e. there is no object c

Re: [R] Simple plotting errors

2009-05-18 Thread Steve Murray
Many thanks once more for helping me to solve this. Gabor - I wasn't even aware of month.abb, so thanks for bringing this useful trick to my attention! Steve _ [[elided Hotmail spam]]

Re: [R] Parsing configuration files

2009-05-18 Thread Gabor Grothendieck
This isn't secure but if its just for yourself and friends you could provide them in R source form, e.g. # my config.ini file a = "abc" b = 12 x = "d" in which case reading them is just a matter of source("config.ini") or possibly source("config.ini", local = TRUE) On Mon, May 18, 2009 at 6:10

Re: [R] MEXVAL

2009-05-18 Thread spencerg
I do not understand the term "mexval statistics". I think you want to look for "anova.glm", fitting several models leaving each term out one at a time in succession and then using "anova.glm" to compare your general model with each submodel in succession. If that does NOT give you

Re: [R] Simple plotting errors

2009-05-18 Thread Gabor Grothendieck
Try this (and make sure to follow the last line to every message on r-help which asks for reproducible code in questions): plot(amazon.sum, xlab = "Month", ylab = "Amazon Sum", xaxt = "n") axis(1, at = 1:12, substr(month.abb, 1, 1)) On Mon, May 18, 2009 at 8:39 AM, Steve Murray wrote: > > Thank

Re: [R] intermediate iterations of stepwise regression

2009-05-18 Thread Gabor Grothendieck
Try this: out <- capture.output(example(step)) On Mon, May 18, 2009 at 9:11 AM, utkarshsinghal wrote: > Hi all, > > I am performing a stepwise regression by running the "step" function on an > "lm" object. Now I want to save the intermediate iterations. I know the > argument trace=T will print

[R] intermediate iterations of stepwise regression

2009-05-18 Thread utkarshsinghal
Hi all, I am performing a stepwise regression by running the "step" function on an "lm" object. Now I want to save the intermediate iterations. I know the argument trace=T will print it on the console, but I rather want to assign it to some R object or may be output it in a CSV or text file.

Re: [R] sample variance from simulation

2009-05-18 Thread Wacek Kusnierczyk
Mike Lawrence wrote: > why not simply > > vars=list() > for (i in 1:1000) vars[[i]] = var(z[[i]]) > > ... or, much simpler, vars = sapply(z, var) vQ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
read ?par 1.use ylab="" to suppress y labels, then mxtext to manually draw em yourself OR use mgp=... within par() 2.use xlab not xlim to change the x axis labels HTH, Si. - Original Message - From: "Steve Murray" To: ; ; ; Sent: Monday, May 18, 2009 1:39 PM Subject: RE: [R] Sim

Re: [R] (no subject)

2009-05-18 Thread Martin Maechler
Dear Debbie, can you **PLEASE** use a 'Subject' in your postings to R-help, and also (see below) > "DZ" == Debbie Zhang > on Mon, 18 May 2009 17:33:51 +1030 writes: DZ> Dear R users, DZ> Based on a set of binomial sample data, how would you DZ> utilize the "nlm" func

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Stavros Macrakis
If you want to concatenate the *vectors*, you need 'c', which will also coerce the elements to a common type. If you want to concatenate the corresponding *elements* of the vectors, you need 'paste', which will coerce them to character strings. -s On 5/18/09, Henning Wildhagen wrote:

Re: [R] Simple plotting errors

2009-05-18 Thread Gabor Grothendieck
Here is a slight elaboration on Jim's solution: # create a vector of the names - month.abb is built into R # This is like: df.names <- c("FetekeJAN", "FetekeFEB", ...) # but avoids having to write out every name. df.names <- paste("Feteke", toupper(month.abb), sep = "") # create a list of the d

Re: [R] Function Surv and interpretation

2009-05-18 Thread Terry Therneau
Dr Pearce, 1. The heart of your question is why Surv(time, death) works, when the standard S action would be to match "death" to the "time2" argument. The answer is that Surv is not conventional -- if only 2 unnamed arguments are present, then it assumes that they match to the time and eve

Re: [R] sample variance from simulation

2009-05-18 Thread Mike Lawrence
why not simply vars=list() for (i in 1:1000) vars[[i]] = var(z[[i]]) On Mon, May 18, 2009 at 6:51 AM, Kon Knafelman wrote: > > Hi, > >> g=list() >> for(i in 1:1000){z[[i]]=rnorm(15,0,1)} > > I've attempted a similar problem based on the above method. Now, if i want to > find the sample varianc

Re: [R] How to run Rcmdr in Mac Os X Tiger?

2009-05-18 Thread John Fox
Dear Jenny, Please see the instructions for Mac OS X Tiger in the Rcmdr installation notes at < http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html>. I hope this helps, John > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] O

Re: [R] MAC OSX vs Win XP: Different stats test results!

2009-05-18 Thread Mike Lawrence
If mulrank does any sort of random number generation or non-exhaustive randomization, you should set the seed of the random number generator first: set.seed(1) mulrank(3,6,data03$x) On Mon, May 18, 2009 at 7:37 AM, Mareen wrote: > > Hi all, > I wondered whether anyone has some advice on a stats

Re: [R] Simple plotting errors

2009-05-18 Thread Steve Murray
Thanks for all the useful information; use of 'c(...)' did the trick, although in future I'll try to hold the data in a more user-friendly setup. I've now got a plot, but have two issues that I can't seem to resolve: 1, The ylab is overlapping the y-axis tick mark values. I've tried using oma

Re: [R] Runtime Error! Keep on happening while using amap, anacor and ca pckg

2009-05-18 Thread Uwe Ligges
After Ana Kolar sent me some code in a private mesage: I reduced that to a minimal example that crashed R - due to a bug in amap - hence CCing the amap maintainer to whom the original report should have gone anyway: The function matlogic() in package amap, or more particular the call to:

Re: [R] Simulation from a multivariate normal distribution

2009-05-18 Thread Peter Dalgaard
Liaw, Andy wrote: Check out the help page for replicate(). Andy Or the 'n' argument to mvrnorm (or mvtnorm::rmvnorm for that matter)... From: barbara.r...@uniroma1.it I must to create an array with dimensions 120x8x500. Better I have to make 500 simulations of 8 series of return from a mul

Re: [R] Parsing configuration files

2009-05-18 Thread Wacek Kusnierczyk
Uwe Ligges wrote: > > > Marie Sivertsen wrote: >> Dear list, >> >> Is there any functionality in R that would allow me to parse config >> files? > > Which kind of config files? R has read.dcf, for example. > indeed, there are quite a number of more or less unambiguously specified configuration fil

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
you mean you want to plot "SUM" against month? (assuming these12 data frames are 12 months). you could first bind them all together using data.frame(), see ?data.frame which would make it much easier. you need to create a variable for months then plot it against your variable. If you dont wa

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Simon Pickett
Sorry, I saw the word concatenate and dived in. Andrew Dolmans solution works fine. Simon. - Original Message - From: "Linlin Yan" To: "Simon Pickett" Cc: "Henning Wildhagen" ; Sent: Monday, May 18, 2009 12:30 PM Subject: Re: [R] Concatenating two vectors into one It seems that

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
you mean you want to plot "SUM" against month? (assuming these12 data frames are 12 months). you could first bind them all together using data.frame(), see ?data.frame which would make it much easier. you need to create a variable for months then plot it against your variable. If you dont wa

Re: [R] Save Cluster results to data frame

2009-05-18 Thread Christian Hennig
Hi Chris, this isn't particularly a clustering question, is it? Why don't you just take your clustering vector (pam.output.object$clustering) and assign it to a$clustering (given that a is the name of your data frame)? And why don't you just define a new character/string vector and assign th

Re: [R] Connection to Microsoft SQL Server

2009-05-18 Thread Uwe Ligges
Meenu Sahi wrote: Dear Users I am new to R. I'm trying to make a connection to Microsoft SQL Server via R. How can I find the correct syntax to make the connection? The Help pdf file has an example for mySql but there's isnt much on SQL Server. Please help. I am trying the following code librar

Re: [R] Chow test(1960)/Structural change test

2009-05-18 Thread Achim Zeileis
On Mon, 18 May 2009, Axel Leroix wrote: Thank your for your answer. I try to perform the Chow test with the formula as you suggest and it works. Nevertheless, I would like to ask additional questions please :   The first one is related to the early one that I have asked to my first message:

Re: [R] Split data frame based on Class

2009-05-18 Thread Kushantha Perera
Try split()! ?split e.g > a var1 var2 var3 1 a14 2 a25 3 a36 4 b47 5 b58 6 a69 7 b7 NA 8 c82 9 c95 10b34 11a24 12a14 13c23 14c54

[R] Connection to Microsoft SQL Server

2009-05-18 Thread Meenu Sahi
Dear Users I am new to R. I'm trying to make a connection to Microsoft SQL Server via R. How can I find the correct syntax to make the connection? The Help pdf file has an example for mySql but there's isnt much on SQL Server. Please help. I am trying the following code library(RODBC) con<-odbcConn

Re: [R] Simulation from a multivariate normal distribution

2009-05-18 Thread Uwe Ligges
barbara.r...@uniroma1.it wrote: I must to create an array with dimensions 120x8x500. Better I have to make 500 simulations of 8 series of return from a multivariate normal distribution. there's the command "mvrnorm" but how I can do this repeating the simulation 500 times?" ?replicate Uwe

Re: [R] Simulation from a multivariate normal distribution

2009-05-18 Thread Liaw, Andy
Check out the help page for replicate(). Andy From: barbara.r...@uniroma1.it > > I must to create an array with dimensions 120x8x500. Better I > have to make 500 simulations of 8 series of return from a multivariate > normal distribution. there's the command "mvrnorm" but how I > can do this

Re: [R] Simple plotting errors

2009-05-18 Thread Stefan Grosse
On Mon, 18 May 2009 11:17:50 + Steve Murray wrote: SM> plot(FeketeJAN[1,2], FeketeFEB[1,2], FeketeMAR[1,2], *through to SM> December* type="l") SM> What is it that I'm doing wrong?! try plot( c(FeketeJAN[1,2], FeketeFEB[1,2], ...)),type="l") however it is better to create one big data fram

Re: [R] Simple plotting errors

2009-05-18 Thread Simon Pickett
you mean you want to plot "SUM" against month? (assuming these12 data frames are 12 months). you could first bind them all together using data.frame(), see ?data.frame which would make it much easier. you need to create a variable for months then plot it against your variable. If you dont wa

Re: [R] Parsing configuration files

2009-05-18 Thread jim holtman
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. There are regular expressions that can be used. It is very dependent upon the format of a configuration file

  1   2   >