Re: [R] Fourier Row and spectral analysis

2009-02-23 Thread Peterko
Hi, i have result from other program. Original serie have 225 observing, but program use only 224. the most domain frequencies are f1=1/224 f2=1/122 f3=1/74,66 f4=1/56 f5=1/24,88 When i know these frequencies a can do, new variable ,nubmers of variavle is 2*nubmer of frequencies: t-1:225

Re: [R] Filtering a data frame using a string for colum header

2009-02-23 Thread Prof Brian Ripley
I would have used 1) != rather than ! ... == 2) !(names(my.df) %in% DrHorrible) since that handles NA names (possible, but not easy to get) better. and note that 3) subset(my.df, select = -DrHorrible) works. On Mon, 23 Feb 2009, Petr PIKAL wrote: Hi r-help-boun...@r-project.org napsal

[R] Build Error on Solaris

2009-02-23 Thread 亿元五角
Dear R user, I try to build R-2.8.1 on SunOS 5.9, and use following command: CC=cc -xarch=v9 CFLAGS=-xO5 -xlibmil -dalign F77=f95 -xarch=v9 FFLAGS=-xO5 -xlibmil -dalign CXX=CC -xarch=v9 CXXFLAGS=-xO5 -xlibmil -dalign FC=f95 -xarch=v9 FCFLAGS=-xO5

Re: [R] Dates and times from Excel

2009-02-23 Thread Hans-Peter Suter
Excel stores times of the day as fractions of a day so I wrote a function to convert the fraction to a number of seconds, extract the hours, minutes and seconds and output it in ISO standard format (%H:%M:%S). What about the 'colClasses' or 'dateTimeAs' argument in 'read.xls' which gives back

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Thomas Mang
Hi, thanks for the link. In the bottom part of the relevant section, you say: Standard advice is to avoid using '=' when you mean '-' Is this a formal, generally accepted (R community) advice, or does it reflect you personal opinion? Note I am not asking this question as to criticize by

Re: [R] Function with 'data' parameter

2009-02-23 Thread Greg Pyle (Secretary)
Thanks, worked like a charm. Greg. On Feb 22, 1:58 pm, Gavin Simpson gavin.simp...@ucl.ac.uk wrote: On Sun, 2009-02-22 at 20:52 +1100, Jim Lemon wrote: Greg wrote: I'm trying to write a simple function with a data parameter. tfun - function(x, y, data = NULL) {      

[R] Help with R and MySQL

2009-02-23 Thread Aaron Barzilai
Hello, This forum has been very helpful to me in the past, and I've run out of ideas on how to solve my problem. I had been using R and MySQL (and Perl) together for quite some time successfully on my Windows XP machine. However, I recently had some problems with MySQL (the ibdata file had

[R] is there any IV probit estimator in R?

2009-02-23 Thread Julian TszKin Chan
Hi Is there any package in R that allow me to do IV probit, just like the ivprobit command in stata. or do i have to carry out the newey's two-step estimator myself? Regards, Julian [[alternative HTML version deleted]] __

Re: [R] Build Error on Solaris

2009-02-23 Thread Prof Brian Ripley
Please do read the posting guide: 1) It says this is not the list for problems about compiled code. 2) It asks you to try the current patched version before posting. (That works for me.) If that is not the solution, the problem is in the lines before the one you showed us, e.g. I get

Re: [R] change attributes of all data.frame elements

2009-02-23 Thread Jarrod Hadfield
Hi Philipp, # Sorry - perhaps I wasn't being very clear. For example, creating the data frame: df-data.frame(y=rnorm(100), x=array(1:100)) # gives 2 elements, the last of which has a dim attribute lapply(df, dim) # I would like some way of changing the dim attribute to NULL for all

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Patrick Burns
Since this topic came up, I've been thinking that that sentence needs more work. The standard is not from me -- I'm a bit more agnostic than the statement although I personally always use '-'. I'm thinking a revised version might be something along the lines of: Standard advice from most

Re: [R] 1.095e+09 for integers

2009-02-23 Thread Bernardo Rangel Tura
On Sun, 2009-02-22 at 23:42 -0500, Alexy Khrabrov wrote: I've had a very long file written out by R with write.table, with fields of time values, converted from POSIXlt as.numeric. Among 2.5 million values, very few had 6 trailing zeroes, and those were output in scientific notation as

Re: [R] Using R in Java?

2009-02-23 Thread Fan Shao
Hi nicro, There's a way that we use a lot in our projects which allows Java to call R and capture the text/table/image outputs. In Java We call 'Rscript exampleScript.R' via shell command. The R script should generate an XML file when it finishes, describing what output was generated, then java

[R] R/Finance 2009: Applied Finance with R -- Registration now open

2009-02-23 Thread Dirk Eddelbuettel
R/Finance 2009: Applied Finance with R April 24 25, Chicago, IL, US The first annual R/Finance conference for applied finance using R , the premier free software system for statistical computation and graphics, will be held this spring in Chicago, IL, USA on Friday April 24 and

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Thomas Lumley
On Mon, 23 Feb 2009, Patrick Burns wrote: Since this topic came up, I've been thinking that that sentence needs more work. The standard is not from me -- I'm a bit more agnostic than the statement although I personally always use '-'. I'm thinking a revised version might be something along

Re: [R] Filtering a data frame using a string for colum header

2009-02-23 Thread Tony Breyal
Cheers guys, yeah, I was using this bit of code as my work around: filter.col - which(names(my.df)!=DrHorrible) my.df[filter.col] but you guys had better solutions :-) Is there an R wish list somewhere? I tried google but couldn't find a specific location, just various threads here and

[R] are arithmetic comparison operators binary?

2009-02-23 Thread Wacek Kusnierczyk
the man page for relational operators (see, e.g., ?'') says: Binary operators which allow the comparison of values in atomic vectors. Arguments: x, y: atomic vectors, symbols, calls, or other objects for which methods have been written. it is somewhat surprizing that the

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Wacek Kusnierczyk
Thomas Lumley wrote: Although it's probably true that most long-time R users use -, this is at least in part because a long-time R user would initially have had to use -, since = wasn't available in the distant past. I would say that it's entirely a matter of taste -- the things that

[R] [R-pkgs] New package: exams - Automatic Generation of Standardized Exams

2009-02-23 Thread Bettina Gruen
Dear useRs, the new R package exams provides Sweave-based automatic generation of exams with multiple-choice questions and arithmetic problems. The package is available from CRAN: http://CRAN.R-project.org/package=exams It includes a vignette giving an overview of the main design aims and

Re: [R] Fourier Row and spectral analysis

2009-02-23 Thread Dieter Menne
Peterko lanikpeter at gmail.com writes: Original serie have 225 observing, but program use only 224. the most domain frequencies are f1=1/224 f2=1/122 f3=1/74,66 f4=1/56 f5=1/24,88 When i know these frequencies a can do, new variable ,nubmers of variavle is 2*nubmer of frequencies: t-1:225

Re: [R] [Rd] Semantics of sequences in R

2009-02-23 Thread Wacek Kusnierczyk
Stefan Evert wrote: Dear vQ, vectors (can-be-considered-lists), can you please stop repeating this nonsense? I don't think anybody ever claimed that vectors can be considered list. yes, it is nonsense. yes, there is one person who repeatedly made this claim. please read the archives;

Re: [R] Fourier Row and spectral analysis

2009-02-23 Thread Peterko
Dieter Menne wrote: Peterko lanikpeter at gmail.com writes: Original serie have 225 observing, but program use only 224. the most domain frequencies are f1=1/224 f2=1/122 f3=1/74,66 f4=1/56 f5=1/24,88 When i know these frequencies a can do, new variable ,nubmers of variavle is

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Ken Knoblauch
Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no writes: Thomas Lumley wrote: Although it's probably true that most long-time R users use -, this is at least in part because a long-time R user would initially have had to use -, since = wasn't available in the distant past.

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Wacek Kusnierczyk
Ken Knoblauch wrote: Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no writes: Thomas Lumley wrote: Although it's probably true that most long-time R users use -, this is at least in part because a long-time R user would initially have had to use -, since = wasn't

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Kenneth Knoblauch
It's easier to read. Better machine-human interaction. ergonomic: (esp. of workplace design) intended to provide optimum comfort and to avoid stress or injury. Quoting Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no: Ken Knoblauch wrote: Wacek Kusnierczyk

Re: [R] Dates and times from Excel

2009-02-23 Thread Erich Neuwirth
RExcel (the addin package for RExcel I wrote) tries very hard to transfer dates and times from Excel to R. David Scott wrote: I have used xlsReadWrite to read data from an Excel spreadsheet. I had a problem with converting times of the day so that I could create POSIXct date-time

Re: [R] [Rd] Semantics of sequences in R

2009-02-23 Thread Stefan Evert
can you please stop repeating this nonsense? I don't think anybody ever claimed that vectors can be considered list. yes, it is nonsense. yes, there is one person who repeatedly made this claim. please read the archives; specifically, [1]. note this statement: Note that any

Re: [R] [Rd] Semantics of sequences in R

2009-02-23 Thread Wacek Kusnierczyk
Stefan Evert wrote: can you please stop repeating this nonsense? I don't think anybody ever claimed that vectors can be considered list. yes, it is nonsense. yes, there is one person who repeatedly made this claim. please read the archives; specifically, [1]. note this statement:

[R] Segmentation Fault still exists

2009-02-23 Thread Moumita Das
Hi All, Sorry to bother everyone again.Ofcourse Prof Ripley ,Yihui and Uwe had replied to my email.But this segmentation fault error was not solved.I agree with Prof Ripley,as he said my R and all other configurations,are very old.But what i don't understand is ,i was able to run analysis till

Re: [R] Diagnostics for single-observation deletion in Cox models

2009-02-23 Thread Terry Therneau
Storer and Crowley (JASA 1985) presented an approach for approximating the changes in maximum partial-likelihood parameter estimates for the Cox model when a single observation is deleted. Is there an R implementation of this approach? I found that the approximation of Reid and Crepeau

Re: [R] line joining graphs

2009-02-23 Thread baptiste auguie
Paul Murrell's book provides such an example using Grid (figure 5.22). A short example is available on his website: http://www.stat.auckland.ac.nz/~paul/grid/doc/moveline.pdf It may be possible to use this in conjunction with gridBase. baptiste On 22 Feb 2009, at 20:43, Eik Vettorazzi

[R] Help in writing my own function

2009-02-23 Thread tedzzx
Dear all I am very intersted in writing my own function to deal with some complicated task, but I don't know how to start. I can't find detial material with examples teaching me how to write my own functions. Can anyone help me and recommend me some learning material? Many Thanks Ted -- View

[R] Problem with library(RMySQL), registry pointer problem?

2009-02-23 Thread Yakub
I have the following error: library(RMySQL) Error in fun(...) : A MySQL Registry key was found but the folder C:\Program Files\MySQL\MySQL Tools for 5.0\/. doesn't contain a bin or lib/opt folder. That's where we need to find libmySQL.dll. Error : .onLoad failed in 'loadNamespace' for

[R] re ad.table prn file

2009-02-23 Thread canadiangirl19
Dear Forum, I´ve imported a prn file with read.table (file(E:/test.prn),sep=\t,skip=3). My problem is now, that my file has a complicated structure: It is not tabstop seperated, it looks like that: JEAR JAN FEB MAR APR 1938154 912 19396 71014

[R] incomplete data analysis

2009-02-23 Thread evrim akar
Dear R users, First of all, thank you for your help about goodness of fit tests. I have another set of data and i am sure it is incomplete. I searched for incomplete data analysis with R but I could not find any suggestion, or method. Lets say (totally hypothetical situation) from a distribution

Re: [R] re ad.table prn file

2009-02-23 Thread Philipp Pagel
On Mon, Feb 23, 2009 at 05:18:28AM -0800, canadiangirl19 wrote: My problem is now, that my file has a complicated structure: It is not tabstop seperated, it looks like that: JEAR JAN FEB MAR APR 1938154 912 19396 71014 19409 If there

[R] how todefine an variable/column in a dataframe as numeric mode

2009-02-23 Thread Mao Jianfeng
Hello dear R-users, I have a tricky problem of data manipulation with R. Although it seems very easy, I can not solve it by myselves. The problem is a variable in my dataset is usually be readed as factor (variable mode), however I want it be a numeric one. I want to know how can I define an

Re: [R] how todefine an variable/column in a dataframe as numeric mode

2009-02-23 Thread jim holtman
First of all when read in you can define the class of each column. It sounds like you have a non-numeric in that column. If you are not using factors, then putting 'as.is=TRUE' will make sure that they are read in as characters. If you want to convert a column to numeric, do the following:

Re: [R] Help in writing my own function

2009-02-23 Thread jim holtman
That is covered in chapter 10 of the Intro to R document included in the distribution. On Mon, Feb 23, 2009 at 7:56 AM, tedzzx zengzhenx...@gmail.com wrote: Dear all I am very intersted in writing my own function to deal with some complicated task, but I don't know how to start. I can't find

Re: [R] Help in writing my own function

2009-02-23 Thread Chuck Cleland
On 2/23/2009 7:56 AM, tedzzx wrote: Dear all I am very intersted in writing my own function to deal with some complicated task, but I don't know how to start. I can't find detial material with examples teaching me how to write my own functions. Can anyone help me and recommend me some

[R] Help with t.test

2009-02-23 Thread Amit Patel
Hi I have managed to do a paired t-test with a data set i have 5 colums of data im dealing with GENE              SampA              SampB              SampC                   SampVehicle ctcc                   859  

[R] r: intergrate behaviour

2009-02-23 Thread Allan Clark
hello R users strange behavior of the integrate function! i assume this occurs because of the way in which the quadriture is set up! (any comments.) f=function(x){exp(-exp(-x)-5*x)/gamma(5)} xx=seq(from=-20, to=20, length.out=1000) plot(xx,f(xx),type=l) integrate(f, lower=-Inf, upper= 1)

Re: [R] re ad.table prn file

2009-02-23 Thread canadiangirl19
I´ve tried with: write.fwf(test,file=E:/test.prn,widths=6), but get the error: Fehler in write.table(t(as.matrix(colnamesMy)), file = file, append = append, : unbenutzte(s) Argument(e) (widths = 6) My matrix hast only one column (so it is a vector), and many rows, I want to seperate

Re: [R] are arithmetic comparison operators binary?

2009-02-23 Thread Martin Maechler
WK == Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no on Mon, 23 Feb 2009 12:06:32 +0100 writes: Thank you, Wacek, though .. wrong mailing list WK the man page for relational operators (see, e.g., ?'') says: WK WK Binary operators which allow the comparison of values

Re: [R] re ad.table prn file

2009-02-23 Thread Philipp Pagel
On Mon, Feb 23, 2009 at 06:24:33AM -0800, canadiangirl19 wrote: write.fwf(test,file=E:/test.prn,widths=6), but get the error: Fehler in write.table(t(as.matrix(colnamesMy)), file = file, append = append, : unbenutzte(s) Argument(e) (widths = 6) My matrix hast only one column (so

Re: [R] Problem with library(RMySQL), registry pointer problem?

2009-02-23 Thread Jeffrey Horner
Yakub wrote: I have the following error: library(RMySQL) Error in fun(...) : A MySQL Registry key was found but the folder C:\Program Files\MySQL\MySQL Tools for 5.0\/. doesn't contain a bin or lib/opt folder. That's where we need to find libmySQL.dll. Error : .onLoad failed in

Re: [R] r: intergrate behaviour

2009-02-23 Thread Ravi Varadhan
When the limits are infinite, it is not a good idea to use large but finite real numbers as approximate limits. It is best to use -Inf and/or +Inf. See the examples on the help page. Sometimes, setting a more stringent convergence criterion, i.e. decreasing rel.tol, helps, but it is best to use

Re: [R] Help with R and MySQL

2009-02-23 Thread Jeffrey Horner
Aaron Barzilai wrote: Hello, This forum has been very helpful to me in the past, and I've run out of ideas on how to solve my problem. I had been using R and MySQL (and Perl) together for quite some time successfully on my Windows XP machine. However, I recently had some problems with MySQL

[R] Support Vector Machine

2009-02-23 Thread Meir Preiszler
Hi, I would like to try using a Support Vector Machine on a classification problem that I'm dealing with. Does such a package exit in R? Thanks Meir Meir Preiszler - Research Engineer I t a m a r M e d i c a l Ltd. Caesarea, Israel: Tel: +(972) 4

[R] autonumber for grouping variable

2009-02-23 Thread clion
Dear R users, my dataframe looks like this head(dat) Id sex byear age 1 300 m 2003 50 2 300 m 2003 36 3 402f 2003 29 4 402f 2003 21 5 402f 2003 64 6 150 m 2005 43 ... ...(where Id is just the Identification number of Individual, sex (male or female), byear

Re: [R] autonumber for grouping variable

2009-02-23 Thread Dimitris Rizopoulos
say 'dat' is your data frame, then one way is the following: f - factor(dat$Id, levels = unique(dat$Id)) dat$Number - unclass(f) dat I hope it helps. Best, Dimitris clion wrote: Dear R users, my dataframe looks like this head(dat) Id sex byear age 1 300 m 2003 50 2 300 m 2003

Re: [R] Support Vector Machine

2009-02-23 Thread Crouch, Daniel
Hi, I use ksvm() in the kernlab package. If I recall correctly it's quite easy to implement, and has a choice of different kernals. Dan Daniel Crouch Research Student Department of Medical Molecular Genetics King's College London 8th Floor, Tower Wing Guy's Hospital London SE1 9RT United

[R] length 1 offset in glm

2009-02-23 Thread Kenneth Knoblauch
Hi, I'm trying to use an offset with glm. According to the glm man page offset ... This should be NULL or a numeric vector of length either one or equal to the number of cases. ... but with the following example, I get an error if the offset is of length 1 c1 - structure(list(Contr =

Re: [R] Support Vector Machine

2009-02-23 Thread Prof Brian Ripley
The simplest to use is probably svm() in package e1071 or svmlight() in klaR, both interfaces to well respected SVM code (but e1071 includes the C++ code it uses). See also help.search(support vector) MAclinical::svm_x Classification based on support vector machines

Re: [R] [R-pkgs] New package: exams - Automatic Generation of Standardized Exams

2009-02-23 Thread Adrian Dusa
Dear Bertina, This is an interesting solutions to generate unique tests for every student, and there are also some more possible approaches. We also faced this problem and our solution was to adopt the Moodle e-learning platform (http://www.moodle.org), create a large pool of exercises and

Re: [R] Support Vector Machine

2009-02-23 Thread Tony Breyal
There's loads of packages in the Machine Learning R Task View: http://cran.r-project.org/web/views/MachineLearning.html for example: package e1071 (http://cran.r-project.org/web/packages/ e1071/index.html) has a function called svm() On 23 Feb, 15:16, Meir Preiszler pm...@itamar-medical.com

[R] Follow-up to Reply: Overdispersion with binomial distribution

2009-02-23 Thread Jessica L Hite/hitejl/O/VCU
THANKS so very much for your help (previous and future!). I have a two follow-up questions. 1) You say that dispersion = 1 by definition dispersion changes from 1 to 13.5 when I go from binomial to quasibinomialdoes this suggest that I should use the binomial? i.e., is the dispersion

Re: [R] incomplete data analysis

2009-02-23 Thread Paul Heinrich Dietrich
I like the mi package, or when it's too large I use the Amelia package. evrim akar wrote: Dear R users, First of all, thank you for your help about goodness of fit tests. I have another set of data and i am sure it is incomplete. I searched for incomplete data analysis with R but I

Re: [R] Extracting xy from raster based on raster value

2009-02-23 Thread Michelle Greve
Dear Kingsford Thank you very much for your suggestion. It turns out I had downloaded an old version of raster. I also got a reply from the R-forge website with other suggestions. In case anybody using the R-help list is interested, here is the link:

[R] Insurance data in library(MASS)

2009-02-23 Thread choonhong ang
I have used the insurance data from R library and I have 2 questions: I use the following: library(MASS) data(Insurance) m1=glm(Claims ~ District + Group + Age + offset(log(Holders)),data = Insurance, family = poisson) summary(m1) Call: glm(formula = Claims ~ District + Group + Age +

Re: [R] line joining graphs

2009-02-23 Thread Greg Snow
You may want to look at the examples for the cnvrt.coords function in the TeachingDemos package for some ideas on how to draw lines between plots. However, it is better to use the grconvertX and grconvertY functions rather than the cnvrt.coords function (it will be deprecated one of these

[R] if statement of a vector

2009-02-23 Thread bioinformatics_guy
right now I have a vector of about 1000 points. I'd like to iterate through each of these points and and test if it is greater than a certain value and if not, throw it out. x=vector y=empty vector j=0 for i (0..length[vector]) if x[i] 10 y[j] = x[i] j++ Thats

Re: [R] if statement of a vector

2009-02-23 Thread Jorge Ivan Velez
Hi there, Try this: x-your.vector x[x10] HTH, Jorge On Mon, Feb 23, 2009 at 12:31 PM, bioinformatics_guy wwwhite...@gmail.comwrote: right now I have a vector of about 1000 points. I'd like to iterate through each of these points and and test if it is greater than a certain value and if

Re: [R] Insurance data in library(MASS)

2009-02-23 Thread Greg Snow
In the Insurance dataset both Age and Group are ordered factors so the default encoding for them is orthogonal polynomials (assuming that the user has not changed the default). In the output below the .L indicates that line is for the Linear piece of the encoding or the Linear contrast on the

Re: [R] Insurance data in library(MASS)

2009-02-23 Thread Prof Brian Ripley
You are asking about support software for a book, and the book contains the answers And it should be given due credit. On Mon, 23 Feb 2009, choonhong ang wrote: I have used the insurance data from R library and I have 2 questions: I use the following: library(MASS) data(Insurance)

[R] Get top cluster for each item in a correlation matrix

2009-02-23 Thread Tan, Richard
Hi, I posted a question a few days ago and got extremely well response. https://stat.ethz.ch/pipermail/r-help/2009-February/188225.html. Now I have a somewhat related question: I have a correlation matrix of about 3000 items, with 1 on diagonal ( for example, cor.mat -

[R] trade-off between speed and storage in matrix multiplications

2009-02-23 Thread Camarda, Carlo Giovanni
Dear R-users, I coded two equivalent ways to perform (in a simplified version) some matrix multiplications I would like to use in a more general framework. In the first case I used Kronecker product and vectorization of a certain matrix. This approach takes less time, but, as you may

Re: [R] trade-off between speed and storage in matrix multiplications

2009-02-23 Thread Christos Hatzis
You might want to compare the performance of your version to the kronecker method of Matrix (Matrix package) that has appropriate versions for sparse matrices etc. -Christos -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] are arithmetic comparison operators binary?

2009-02-23 Thread Wacek Kusnierczyk
Martin Maechler wrote: WK == Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no on Mon, 23 Feb 2009 12:06:32 +0100 writes: Thank you, Wacek, though .. wrong mailing list apologies. i was actually asking for explanation, assuming that it might be my

[R] Obtaining Least Square Means with lme (mixed models)

2009-02-23 Thread Claudia Ceballos
Hi Dear Alex, A few years ago you sent this email to R list: Hello, I was wondering how one could obtain LSM for fixed factors in a mixed-effect model using lme. In other words, if I have model such as: model-lme(yield~period+treatment+period*treatment, data=data,random=~1|cow) how can I get LSM

Re: [R] Help in writing my own function

2009-02-23 Thread Chun-Hao Tu
Hi Ted, I strongly recommend a book: S programming by W.N Venables and B.D Ripley ISBN: 0387-989668 It is easy to read. I love this book so much. Maybe someone has better idea. Super Chunhao Date: Mon, 23 Feb 2009 04:56:18 -0800 From: zengzhenx...@gmail.com To:

[R] ARIMA question

2009-02-23 Thread otunno
Hello - How do I simulate multivariate ARIMA data? I am familiar with the arima.sim function, which I have used several times to generate univariate data, but when I type help(arima.sim), the information I get back reveals nothing about possible multivariate options. Please reply when you get a

Re: [R] System of logistics Equations

2009-02-23 Thread Arne Henningsen
Hi Bernardo, the systemfit package cannot be used to estimate a system of logistic equations. Arne On Friday, 20. February 2009 05:19:40, Bernardo Rangel Tura wrote: Hi R-masters I need yours help about a problema in one of may ongoing researchers. In my research the subjects (20 in

[R] Listbox in R

2009-02-23 Thread RUSER2009
I am trying to display a set of listboxes in a systematic manner. For instance, I display Listbox 1, let the user pick the parameters of interest then destroy it. Now I display Listbox 2 and so on. So in essence I would like to create listboxes in a for -loop. When I try to loop - all the

Re: [R] Listbox in R

2009-02-23 Thread Greg Snow
Look at the tkwait.window function as one possibility. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of

[R] simple graphing question

2009-02-23 Thread William Deese
I have what should be a simple question but I've been unable to solve it in a reasonable length of time. For example with data like ge product response scenario 1wine5 base 2 steel 10 base 3 sugar4 base 4wine -10 policy 5 steel1

Re: [R] simple graphing question

2009-02-23 Thread David M Smith
If I understand your example correctly, I think you're looking for a dot-chart like this one from the R Graph Gallery: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=150 You'd just need to replace the green/blue circles with X's and O's, respectively. Provided you reorganize your

Re: [R] ARIMA question

2009-02-23 Thread Giovanni Petris
Date: Mon, 23 Feb 2009 14:03:07 -0500 (EST) From: otu...@clemson.edu Sender: r-help-boun...@r-project.org Importance: Normal Precedence: list User-Agent: SquirrelMail/1.4.13 Hello - How do I simulate multivariate ARIMA data? You can use package dlm. There is a function --

[R] Formula that includes previous row values

2009-02-23 Thread Pele
Hi R users, Is there an easy way in R to generate the results table below using table 1 and the formula (simplified version of the real problem)? It would be easy if I knew the R equivalent of SAS's retain function, but could not find one. Thanks in Advance for any help! table1: ID X2

[R] Slow indexing access for Matrix

2009-02-23 Thread Niels Richard Hansen
Consider the following little benchmark require(Matrix) tmp - Matrix(c(rep(1,1000),rep(0,9000)),ncol=1) ind - sample(1:1,1) system.time(tmp[ind,]) user system elapsed 0.004 0.001 0.005 ind - sample(1:1000,1,replace=TRUE) system.time(tmp[ind,]) user system elapsed

Re: [R] Formula that includes previous row values

2009-02-23 Thread Jorge Ivan Velez
Dear Pele, Probably not the best way to proceed but it works: X-read.table(textConnection(ID X2 1.001.00 2.000.00 3.001.00 4.003058 5.000.00 6.006.00),header=TRUE) closeAllConnections() X x3-0 for(i in 2:(nrow(X)+1)) x3-c(x3, X$X2[i-1]+0.24*x3[i-1]) X$x3-x3[-1] X

Re: [R] Formula that includes previous row values

2009-02-23 Thread Christos Hatzis
Here's a way without a loop: x - read.table(textConnection(ID X2 1.001.00 2.000.00 3.001.00 4.003058 5.000.00 6.006.00),header=TRUE) closeAllConnections() x$X3 - append(x$X2, 0, 0)[-nrow(x)] x$X4 - as.matrix(x[,2:3]) %*% c(1, 0.24) x ID X2 X3 X4 1 1

Re: [R] Slow indexing access for Matrix

2009-02-23 Thread Peter Dalgaard
Niels Richard Hansen wrote: Consider the following little benchmark require(Matrix) tmp - Matrix(c(rep(1,1000),rep(0,9000)),ncol=1) ind - sample(1:1,1) system.time(tmp[ind,]) user system elapsed 0.004 0.001 0.005 ind - sample(1:1000,1,replace=TRUE)

Re: [R] Formula that includes previous row values

2009-02-23 Thread Greg Snow
How about: x3 - cumsum( x2* 0.24^(5:0) ) / 0.24^(5:0) with the 5 replaced by the length -1 for the more general case. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

[R] why results from regression tree (rpart) are totally inconsistent with ordinary regression

2009-02-23 Thread Weidong Gu
Hi, In my analysis of impacts of insecticide-treated bednets on malaria, I look at the relationship between malaria incidence and mosquito behaviors. The condensed data set is copied here. Ordinary regression (lm) shows that Incidence was negatively related to Mortality. This makes sense because

Re: [R] why results from regression tree (rpart) are totallyinconsistent with ordinary regression

2009-02-23 Thread Bert Gunter
You did not read the tree graph correctly. Mortality is **not** positively related to incidence. You're reading the tree backwards. Read the output of summary() on your rpart fit object for clarity. -- Bert Gunter Genentech -Original Message- From: r-help-boun...@r-project.org

[R] predicting cumulative hazard for coxph using predict

2009-02-23 Thread Zainab Jamal
Hi I am estimating the following coxph function with stratification and frailty where each person had multiple events. m-coxph(Surv(dtime1,status1)~gender+cage+uplf+strata(enum)+frailty(id),xmodel)   head(xmodel) id enumdtime status gender cage uplf 1 10086661

Re: [R] why results from regression tree (rpart) are totallyinconsistent with ordinary regression

2009-02-23 Thread Weidong Gu
Hi Bert, Thanks for your prompt response. Yeah, summary() shows the correct answer, seemingly, plot() and text() reverse the direction of = sign, a bit confusion. Weidong Gu -Original Message- From: Bert Gunter [mailto:gunter.ber...@gene.com] Sent: Monday, February 23, 2009 5:14 PM

Re: [R] Formula that includes previous row values

2009-02-23 Thread Pele
Hi Greg - this is perfect - Thank You! Also, thanks to everyone for the other suggestions Greg Snow-2 wrote: How about: x3 - cumsum( x2* 0.24^(5:0) ) / 0.24^(5:0) with the 5 replaced by the length -1 for the more general case. -- Gregory (Greg) L. Snow Ph.D. Statistical Data

[R] array manipulation simple questions

2009-02-23 Thread Λεωνίδας Μπαντής
  Hi there,   I am pretty new to R. Actually I started using it yesterday. I have two questions:   1.   Suppose I have a-c(1:10)  (or a-array(c(1:10),dim=c(1,10)))   and I want to end up with vector b=[0 0 0 0 0 1 1 1 1 1]. i.e. I want to substitute alla elements that are 5 with 0 and 5 with 1.  

[R] question about loading date file in R

2009-02-23 Thread 850426
I am trying to load a .csv file in the R commander, but the output window always showed that Error: bad restore file magic number(file may be corrupted)--no data loaded. Did any one know why does this happen? btw, I can open this file in commander by open script file. Many thanks! -- View this

[R] Simple seq() boolean equality problem

2009-02-23 Thread Daniel G Polhamus
Hi all, thanks in advance for the help. Can someone explain to me the following result, and what I'm doing wrong in the second case? seq(-43.7,-43.69,.001)[3]==-43.698 [1] TRUE seq(-43.7,-43.69,.001)[2]==-43.699 [1] FALSE seq(-43.7,-43.69,.001)[1]==-43.7 [1] TRUE Dan

Re: [R] equivalent function to MatLab 'step' ?

2009-02-23 Thread Carl Witthoft
Well, I found out part of the confusion: The modern versions of MatLab renamed their function from 'step' to 'stepz' . Stepz(num,den) provides a calculation of the time-response to a step function based on the system state equation defined by the num and den coefficients. So, is there

Re: [R] Simple seq() boolean equality problem

2009-02-23 Thread Rolf Turner
On 24/02/2009, at 2:29 PM, Daniel G Polhamus wrote: Hi all, thanks in advance for the help. Can someone explain to me the following result, and what I'm doing wrong in the second case? seq(-43.7,-43.69,.001)[3]==-43.698 [1] TRUE seq(-43.7,-43.69,.001)[2]==-43.699 [1] FALSE

Re: [R] Semantics of sequences in R

2009-02-23 Thread Raubertas, Richard
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch Sent: Sunday, February 22, 2009 4:13 PM I think this was posted to the wrong list, so my followup is going to R-devel. On 22/02/2009 3:42 PM, Stavros Macrakis wrote: Inspired by

[R] multinom() and multinomial() interpretation

2009-02-23 Thread Grant Gillis
Hello and thanks in advance for any advice. I am not clear how, in practice, the multinom() function in nnet and the multinomial() function in VGAM differ in terms of interpretation. I understand that they are fit differently. Are there certain scenarios where one is more appropriate than the

Re: [R] Welcome to the R-help mailing list

2009-02-23 Thread sdzhangping
Dear R users: Analysis of the impact of a time-dependent covariate (GVHD or use of steroid after bone marrow transplantation) on two competing endpoints (invasive fungal infection and death) is frequently encountered in the setting of BMT data. Coxph package can be used as the following:

[R] help: calculations for causespecific hazard ratios in a competing risks analysis with timedependent covariates

2009-02-23 Thread sdzhangping
Dear R users: Analysis of the impact of a time-dependent covariate (GVHD or use of steroid after bone marrow transplantation) on two competing endpoints (invasive fungal infection and death) is frequently encountered in the setting of BMT data. Coxph package can be used as the following:

Re: [R] Help with R and MySQL

2009-02-23 Thread Aaron Barzilai
Thanks Jeff, that was exactly the problem. When I unzipped the version at the page below for my version of MySQL (5.1), it worked fine. The version I downloaded through install.packages() must have been for 5.0. Thanks so much for the help and quick response, Aaron

Re: [R] array manipulation simple questions

2009-02-23 Thread jdeisenberg
Λεωνίδας Μπαντής wrote: 1. Suppose I have a-c(1:10) (or a-array(c(1:10),dim=c(1,10))) and I want to end up with vector b=[0 0 0 0 0 1 1 1 1 1]. i.e. I want to substitute alla elements that are 5 with 0 and 5 with 1. I think you mean =5, not 5. In that case, try this: b -

  1   2   >