Re: [R] How to save R clean sessions in BATCH mode?

2009-05-18 Thread Emmanuel Charpentier
Le samedi 16 mai 2009 à 17:21 +0200, mcnda...@mncn.csic.es a écrit : Thanks a lot for all of you that have reply me about opening and ending R workspaces in BATCH mode. However replies were a king general and I’m afraid I could not take the entire message from them. Therefore I chose to

Re: [R] Measures

2009-05-18 Thread Dieter Menne
Rafael Marconi Ramos rafaelmr at gmail.com writes: 1) (Goodman Kruskal) lambda 2) (Thiel's) uncertainty coefficient Dear Rafael, have you tried to search for Goodman Kruskal (solution be J Baron) and Thiel (comments by Marc Schwartz and Frank Harrell)? Dieter

Re: [R] One Sample Nonparametric

2009-05-18 Thread Dieter Menne
Charles Van deZande cvandy26 at gmail.com writes: I'm doing one and two sample nonparametric tests for the median using wilcox test. For a one-sample test I use: wilcox.test(x, mu =50 (or whatever), y=NULL,correct=TRUE) For two-sample test I use: wilcox.test(x,y,correct=TRUE) The

Re: [R] sprintf() question

2009-05-18 Thread Ei-ji Nakama
Hi The result of Windows is clearly strange. my Linux machine = good === sessionInfo() R version 2.9.0 (2009-04-17) x86_64-pc-linux-gnu locale: LC_CTYPE=ja_JP.EUC-JP;LC_NUMERIC=C;LC_TIME=ja_JP.EUC-JP;LC_COLLATE=ja_JP.EUC-JP;

[R] (no subject)

2009-05-18 Thread Debbie Zhang
Dear R users, 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? Thanks. Debbie _ [[elided Hotmail spam]] [[alternative HTML version

Re: [R] sprintf() question

2009-05-18 Thread Peter Dalgaard
Daniel Nordlund wrote: Enlightenment is what I asked for, and it is what I got. I was having a senior moment I guess. I was picturing 8 as binary 0100, when obviously it is binary 1000. So yes, the required power of 2 is 1, and it is fine with me that Windows implementation does not display

Re: [R] sprintf() question

2009-05-18 Thread Daniel Nordlund
-Original Message- From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk] Sent: Monday, May 18, 2009 12:15 AM To: Daniel Nordlund Cc: ted.hard...@manchester.ac.uk; r-help@r-project.org Subject: Re: [R] sprintf() question Daniel Nordlund wrote: Enlightenment is what I asked

Re: [R] newbie: closing unused connection + readline

2009-05-18 Thread Aval Sarri
I don't understand why read.table would have a problem reading directly from a socket instead of a textConnection.  Is this a bug? Some subtlety in the semantics of socketConnection as opposed to textConnection?  Incorrect parameters when opening the socketConnection? No problem with

Re: [R] How do you save in R?

2009-05-18 Thread Dieter Menne
prixel snickersoof at yahoo.com writes: I know it sounds like a silly question but whenever i click on save to file it doesn't save. Assuming it is Windows GUI and not your grandmother's knitting needles, save to file writes the selected part of the GUI to a file and is not that useful as a

Re: [R] How do you save in R?

2009-05-18 Thread Patrick Burns
I disagree with Dieter's last point. Whether you use 'attach' or 'load' should depend on whether you want the objects in the file to remain separate ('attach') or mixed into the global environment ('load'). Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home

Re: [R] Dickey-Fuller Tests with no constant and no trend

2009-05-18 Thread Pfaff, Bernhard Dr.
Dear Jake, have you had a look at the function 'ud.df()' contained in the package urca? You will find: library(urca) args(ur.df) function (y, type = c(none, drift, trend), lags = 1, selectlags = c(Fixed, AIC, BIC)) HTH, Bernhard -Ursprüngliche Nachricht- Von:

Re: [R] How do you save in R?

2009-05-18 Thread Dieter Menne
Patrick Burns pburns at pburns.seanet.com writes: I disagree with Dieter's last point. Whether you use 'attach' or 'load' should depend on whether you want the objects in the file to remain separate ('attach') or mixed into the global environment ('load'). Technically a good point, but

[R] consensus clusterings

2009-05-18 Thread Penner, Johannes
Dear all, does anybody know a package or solution which incorporated one of the three algorithms to build consensus clusters, proposed by Nguyen Caruana: - iterative voting consensus (ivc) - iterative probabilistic voting consensus (ipvc) - iterative pairwise consensus (ipc) Thanks in advance.

Re: [R] Simulation

2009-05-18 Thread Kon Knafelman
Hi peter, Quite an insight you have there hehe. i am continuing on from the orignal problem of creating a simulation. Im now trying to find (n−1)S2/σ2, and fit it to a chi squared dist with 5 degrees of freedom. im having trouble with the coding for this. i think for the second part of

Re: [R] creating and then executing command strings

2009-05-18 Thread Philipp Schmidt
Greg: Thanks for this concise explanation! I will have a look at the fortunes you mention. Best - P On Fri, May 15, 2009 at 7:36 PM, Greg Snow greg.s...@imail.org wrote: The arrow - is used to assign a value to a variable, the equals sign = is used to specify the value for a function

Re: [R] How do you save in R?

2009-05-18 Thread ronggui
I would second Dieter's point. 2009/5/18 Dieter Menne dieter.me...@menne-biomed.de: Patrick Burns pburns at pburns.seanet.com writes: I disagree with Dieter's last point. Whether you use 'attach' or 'load' should depend on whether you want the objects in the file to remain separate

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

2009-05-18 Thread Axel Leroix
    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:   When I try to perform another

Re: [R] How do you save in R?

2009-05-18 Thread Wacek Kusnierczyk
ronggui wrote: I would second Dieter's point. me to, among others because: 2009/5/18 Dieter Menne dieter.me...@menne-biomed.de: Patrick Burns pburns at pburns.seanet.com writes: I disagree with Dieter's last point. Whether you use 'attach' or 'load' should depend on whether

[R] sample variance from simulation

2009-05-18 Thread Kon Knafelman
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 variance, do i go about it like this? for (i in 1:1000)vars[[i]] = sum(z[[i]]) vars[[i]] the overall sigma squared will just be 1, because

Re: [R] How do you save in R?

2009-05-18 Thread Peter Flom
Dieter Menne dieter.me...@menne-biomed.de wrote Technically a good point, but I found it helpful for starters who want to avoid the inferno of what's attached now? not to use it at all. My suggestion is to use with() instead because it has a higher locality. I know, many of the examples use

Re: [R] (no subject)

2009-05-18 Thread Stefan Grosse
On Mon, 18 May 2009 17:33:51 +1030 Debbie Zhang debbie0...@hotmail.com wrote: DZ Based on a set of binomial sample data, how would you utilize the DZ nlm function in R to estimate the true proportion of the DZ population? Dear Debbie, This is a list that is mainly intended helping people if

[R] Parsing configuration files

2009-05-18 Thread Marie Sivertsen
Dear list, Is there any functionality in R that would allow me to parse config files? I have trie ??config and apropos('config') without succes, and also search the R package site. Mvh. Marie [[alternative HTML version deleted]] __

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

2009-05-18 Thread Ana Kolar
Hi there dear R users, Does anyone have any idea what the following error means and how to sort it out? Runtime Error! Program: C\Program Files\R\R-2.9.0\bin\Rgui.exe This application has requested the Runtime to terminate it in an unusual way. Please contact the application’s support team

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

2009-05-18 Thread Mareen
Hi all, I wondered whether anyone has some advice on a stats-related 'sanity check', as I ran a nonparametric multivariate test (mulrank function as decribed by R. Wilcox, 2005) on both systems, but got different results (please see below for the system-specific outputs)! The functions I used are

[R] Concatenating two vectors into one

2009-05-18 Thread Henning Wildhagen
Dear users, a very simple question: Given two vectors x and y x-as.character(c(A,B,C,D,E,F)) y-as.factor(c(1,2,3,4,5,6)) i want to combine them into a single vector z as A1, B2, C3 and so on. z-x*y is not working, i tried several others function, but did not get to the solution. Thanks

[R] Simple plotting errors

2009-05-18 Thread Steve Murray
Dear R Users, I have 12 data frames, each of 12 rows and 2 columns. e.g. FeketeJAN MEANSUM_ AMAZON 144.4997874 68348.4 NILE 5.4701955 1394.9 CONGO71.3670036 21196.0 MISSISSIPPI 18.9273250 6511.0 AMUR 1.8426874 466.2 PARANA

[R] Connection to 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. Thanks ! Me. [[alternative HTML version

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Simon Pickett
z-c(x,y) cheers, Simon. - Original Message - From: Henning Wildhagen hwildha...@gmx.de To: r-help@r-project.org Sent: Monday, May 18, 2009 12:09 PM Subject: [R] Concatenating two vectors into one Dear users, a very simple question: Given two vectors x and y

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Andrew Dolman
x-as.character(c(A,B,C,D,E,F)) y-as.factor(c(1,2,3,4,5,6)) ?paste paste(x,y, sep=) andydol...@gmail.com 2009/5/18 Henning Wildhagen hwildha...@gmx.de Dear users, a very simple question: Given two vectors x and y x-as.character(c(A,B,C,D,E,F)) y-as.factor(c(1,2,3,4,5,6)) i want

[R] Save Cluster results to data frame

2009-05-18 Thread Chris Arthur
If I cluster my data into 3 sets, using pam for instance, is there a way to save the resultant cluster results, to the originating data frame. and related to that how do i say change the cluster names to something a bit more meaningful that 1..2...3 So it goes like this. Data --- Cluster

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Tony Breyal
Something like this should work: z- paste(x,y, sep='') HTH, Tony On 18 May, 12:09, Henning Wildhagen hwildha...@gmx.de wrote: Dear users, a very simple question: Given two vectors x and y x-as.character(c(A,B,C,D,E,F)) y-as.factor(c(1,2,3,4,5,6)) i want to combine them into a single

[R] Split data frame based on Class

2009-05-18 Thread Chris Arthur
Each row of my data frame is assigned to a class (eg country). Can you suggest how I break apart the data frame so that I create new data frames for each class eg If Class = US put in new dataframe dataUS Thanks in advance for your help Chris __

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Ted Harding
On 18-May-09 11:09:45, Henning Wildhagen wrote: Dear users, a very simple question: Given two vectors x and y x-as.character(c(A,B,C,D,E,F)) y-as.factor(c(1,2,3,4,5,6)) i want to combine them into a single vector z as A1, B2, C3 and so on. z-x*y is not working, i tried several

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

2009-05-18 Thread Peter Dalgaard
Mareen wrote: Hi all, I wondered whether anyone has some advice on a stats-related 'sanity check', as I ran a nonparametric multivariate test (mulrank function as decribed by R. Wilcox, 2005) on both systems, but got different results (please see below for the system-specific outputs)! The

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Linlin Yan
z - paste(x, y, sep = '') z [1] A1 B2 C3 D4 E5 F6 On Mon, May 18, 2009 at 7:09 PM, Henning Wildhagen hwildha...@gmx.de wrote: Dear users, a very simple question: Given two vectors x and y x-as.character(c(A,B,C,D,E,F)) y-as.factor(c(1,2,3,4,5,6)) i want to combine them into a single

[R] Overdispersion using repeated measures lmer

2009-05-18 Thread Christine Griffiths
Dear All I am trying to do a repeated measures analysis using lmer and have a number of issues. I have non-orthogonal, unbalanced data. Count data was obtained over 10 months for three treatments, which were arranged into 6 blocks. Treatment is not nested in Block but crossed, as I

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

2009-05-18 Thread Uwe Ligges
Ana Kolar wrote: Hi there dear R users, Does anyone have any idea what the following error means and how to sort it out? Runtime Error! Program: C\Program Files\R\R-2.9.0\bin\Rgui.exe This application has requested the Runtime to terminate it in an unusual way. Please contact the

Re: [R] Simple plotting errors

2009-05-18 Thread Uwe Ligges
Steve Murray wrote: Dear R Users, I have 12 data frames, each of 12 rows and 2 columns. e.g. FeketeJAN MEANSUM_ AMAZON 144.4997874 68348.4 NILE 5.4701955 1394.9 CONGO71.3670036 21196.0 MISSISSIPPI 18.9273250 6511.0 AMUR 1.8426874

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Uwe Ligges
Henning Wildhagen wrote: Dear users, a very simple question: Given two vectors x and y x-as.character(c(A,B,C,D,E,F)) y-as.factor(c(1,2,3,4,5,6)) i want to combine them into a single vector z as A1, B2, C3 and so on. z-x*y is not working, i tried several others function, but did not get

Re: [R] Parsing configuration files

2009-05-18 Thread Uwe Ligges
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. Uwe Ligges I have trie ??config and apropos('config') without succes, and also search the R package site. Mvh. Marie

Re: [R] Concatenating two vectors into one

2009-05-18 Thread Linlin Yan
It seems that c(x,y) is not correct: z-c(x,y) z [1] A B C D E F 1 2 3 4 5 6 On Mon, May 18, 2009 at 7:17 PM, Simon Pickett simon.pick...@bto.org wrote: z-c(x,y) cheers, Simon. - Original Message - From: Henning Wildhagen hwildha...@gmx.de To: r-help@r-project.org Sent: Monday,

Re: [R] Simple plotting errors

2009-05-18 Thread baptiste auguie
I'd suggest you first combine the 12 data.frames into one, using melt() from the reshape package. makeDummy - function(.){ # since you don't provide a reproducible example data.frame(x=letters[1:10], y=rnorm(10)) } listOf12DataFrames - lapply(1:12, makeDummy)

[R] Simulation from a multivariate normal distribution

2009-05-18 Thread Barbara . Rogo
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? [[alternative HTML version deleted]]

Re: [R] Simple plotting errors

2009-05-18 Thread jim holtman
One way is to create a list of the dataframes and then use 'sapply' to extract the values: df.list - list(FeketeJAN, ..., FeketeDEC) plot(sapply(df.list, function(a) a[AMAZON, SUM_])) On Mon, May 18, 2009 at 7:17 AM, Steve Murray smurray...@hotmail.comwrote: Dear R Users, I have 12 data

Re: [R] Split data frame based on Class

2009-05-18 Thread jim holtman
?split new.df - split(old.df, old.df$Class) will create a list of dataframes split by Class On Mon, May 18, 2009 at 7:23 AM, Chris Arthur chris.art...@bristol.ac.ukwrote: Each row of my data frame is assigned to a class (eg country). Can you suggest how I break apart the data frame so that I

Re: [R] Parsing configuration files

2009-05-18 Thread jim holtman
PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://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;

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

Re: [R] Simple plotting errors

2009-05-18 Thread Stefan Grosse
On Mon, 18 May 2009 11:17:50 + Steve Murray smurray...@hotmail.com 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

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] 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

[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)

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

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] 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

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

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

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 yanlinli...@gmail.com To: Simon Pickett simon.pick...@bto.org Cc: Henning Wildhagen hwildha...@gmx.de; r-help@r-project.org Sent: Monday, May 18, 2009

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

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 file formats.

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

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] 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] 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 mareenwe...@yahoo.com wrote: Hi all, I wondered whether anyone has

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] On

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 konk2...@hotmail.com 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

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 event

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

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 data

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 debbie0...@hotmail.com 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

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 smurray...@hotmail.com To: simon.pick...@bto.org; r-help@r-project.org;

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 read the

[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] 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 utkarsh.sing...@global-analytics.com 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

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 smurray...@hotmail.com

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 what

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 AM,

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] 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

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

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] 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 utkarsh.sing...@global-analytics.com wrote: Hi Gabor, Thanks for your input. It is of some help if not all. fit = lm(y~1,

[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] 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

[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

Re: [R] intermediate iterations of stepwise regression

2009-05-18 Thread Peter Flom
utkarshsinghal utkarsh.sing...@global-analytics.com 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

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, steve_fried...@nps.gov 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,

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: steve_fried...@nps.gov To: r-help@r-project.org Sent:

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

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] 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

[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

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

[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 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

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

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

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 joe_ret...@yahoo.com 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

[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

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] 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

  1   2   >