[R] Help

2005-06-27 Thread noomen ajmi
Hi, Please, can you tell if there are any package or R code for STAR models estimation and test misspecification. Thanks in advance Best regards AJMI Noomen PHD Student TUNISIA __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinf

Re: [R] GetRNGstate() crashes in Windows

2005-06-27 Thread Prof Brian Ripley
On Tue, 28 Jun 2005, Ju-Sung Lee wrote: > I think I've misread the intent of the GetRNGstate() and other API > functions; these only work when embedded in C functions eventually called > from R. Apologies for the mistake. First, the posting guide asks you to send programming questions to the R-

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Prof Brian Ripley
This is based on a false premise. R _can_ read files containing such names: use readLines() or scan(allowEscapes=FALSE). Someone else wrote the C for you! The restriction is that if you pass character strings to the parser, they are interpreted according to the documented rules, including int

Re: [R] Mixed model

2005-06-27 Thread Stephen
Thanks Most thoughtful... Regards S From: Spencer Graves [mailto:[EMAIL PROTECTED] Sent: Mon 27/06/2005 19:52 To: Stephen Cc: Douglas Bates; r-help@stat.math.ethz.ch Subject: Re: [R] Mixed model I often think carefully about what I want and store

Re: [R] GetRNGstate() crashes in Windows

2005-06-27 Thread Ju-Sung Lee
I think I've misread the intent of the GetRNGstate() and other API functions; these only work when embedded in C functions eventually called from R. Apologies for the mistake. On Tue, 28 Jun 2005, Ju-Sung Lee wrote: > Hi, > > Has anyone managed to successfully call GetRNGstate() / PutRNGstate(

[R] GetRNGstate() crashes in Windows

2005-06-27 Thread Ju-Sung Lee
Hi, Has anyone managed to successfully call GetRNGstate() / PutRNGstate() without crashing in a Windows environment (spec. XP)? I've compiled successfully using both the latest Cygwin, latest Mingw, and the version of Mingw suggested in "Building R for Windows" website, but when the executabl

[R] add transformed columns into a matrix

2005-06-27 Thread Luke
Dear R users, My input is a matrix. The matrx rows are sample; the matrix columns are features. I need an output matrix which include the original features and some kinds of transformed features. For example, there are only three features x1, x2, and x3 in my original matrix (input matrix). The fe

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Mulholland, Tom
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Henrik Bengtsson > Sent: Tuesday, 28 June 2005 2:54 AM > To: Spencer Graves > Cc: r-help@stat.math.ethz.ch; Dirk Eddelbuettel > Subject: Re: [R] How to convert "c:\a\b" to "c:/a/b"? > ... snipped > T

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Spencer Graves
Hi, Gabor, James, et al.: Thanks for the help. I'm unable to get "scan('clipboard', what='', allowEscapes=FALSE))" to work reliably on my system using Rgui under Windows XP, R 2.1.1 patched. However, "file.choose()" works like a charm. Thanks again, everyone. spe

[R] help--package:MIX

2005-06-27 Thread Li, Jia
Hi all, The package MIX is for estimation and multiple imputation for mixed categorical and continuous data. I want to use multiple imputation to impute the missing values in the covariates of Cox model, I am wondering if I could use MIX to do that. I mean that my dataset is failure time dist

Re: [R] Crosstabs in R

2005-06-27 Thread Jim Brennan
Here is one way to do it. > jen2<-reshape(jen,idvar="DNA",timevar="center",direction="wide") This makes it easier to work with. > jen2<-replace(jen2,jen2=="?",NA) Change the question marks to NA. > jen2$match1<-((jen2[,2]==jen2[,4])*1) > jen2$match2<-((jen2[,3]==jen2[,5])*1) > jen2 DNA snp

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Gabor Grothendieck
Try using file.choose() to locate the file instead of Windows Explorer. That will return the name in a form useable within R. On 6/27/05, Spencer Graves <[EMAIL PROTECTED]> wrote: > Thanks, Dirk, Gabor, Eric: > > You all provided appropriate solutions for the stated problem. >

Re: [R] Index (which) of last non-NA data in dataframe

2005-06-27 Thread Liaw, Andy
If you can be sure that the non-NAs are contiguous, then the following should work: sapply(d, function(x) max(which(!is.na(x Andy > From: Pierre Lapointe > > Hello, > > > > In a dataframe, I want the index if the last non-NA data. Example: > > > > d<-data.frame(matrix(c(1,3,4,2,7,

[R] Index (which) of last non-NA data in dataframe

2005-06-27 Thread Pierre Lapointe
Hello, In a dataframe, I want the index if the last non-NA data. Example: d<-data.frame(matrix(c(1,3,4,2,7,8,1,NA,2),3,3,byrow=TRUE)) gives: > d X1 X2 X3 1 1 3 4 2 2 7 8 3 1 NA 2 I want a vector that gives me 3 2 3 I know about tail and which, but I don't know

[R] Crosstabs in R

2005-06-27 Thread Tan Hui Hui Jenny
HI, I have the data in the following format. My aim is to determine the concordance in genotype calls (SNP1, 2, 3,etc) at two centers. DNA center snp1 snp2 NA07019 1 A A NA07348 1 M G NA10830 1 A G NA10851 1 M G NA10857 1 A G

Re: [R] A. Mani : colours in Silhouette

2005-06-27 Thread Mulholland, Tom
It's not so much a problem, as not working the way you expected. cluster:::plot.partition is used to do the plotting. If you look at the code for this you can see the difficulty in putting every possible permutation into the code. If for example you want the silhouette plot to be red using col =

Re: [R] Numerical accuracy

2005-06-27 Thread Don MacQueen
The following might be helpful. Statistical Reference Datasets (StRD) website http://www.nist.gov/itl/div898/strd http://www.amstat.org/publications/tas/mccull-1.pdf http://www.amstat.org/publications/tas/mccull.pdf -Don At 11:57 AM -0300 6/27/05, Talita Perciano Costa Leite wrote: >Hi peo

Re: [R] simplifying the code

2005-06-27 Thread alex diaz
problem solved. thank you Jim and Spencer for your answers. > This gives the same answer for what you have > supplied so far... > > > dat$d<-ifelse((dat$b-dat$a)>=1000,dat$b-dat$a+1,0) > > dat >abcd > 1 1 1001 1001 1001 > 2 2 100100 > 3 3 100100 > 4 4 1001

Re: [R] function for "two-part" or "two-condition" models

2005-06-27 Thread Andrew Robinson
Hi Richard, I'm not sure that I can imagine how data can have too many zeros to be fit well with zero-inflated Poisson models. Won't the excess zeros be accommodated by increasing the the inflation? In any case, if you want a model that separates the zeros from the occurrences before fitting a Po

Re: [R] simplifying the code

2005-06-27 Thread Spencer Graves
Have you considered a generalization of the following: dat <- expand.grid(a=1:2, b=1001:1002); class(dat) Xlate <- array(4:1, dim=c(2,2)) dat$c. <- Xlate[cbind(dat$a, dat$b-1000)] spencer graves Jim Brennan wrote: > This gives the same answer for what you have supplied so fa

[R] ks.test() output interpretation

2005-06-27 Thread kapo coulibaly
I'm using ks.test() to compare two different measurement methods. I don't really know how to interpret the output in the absence of critical value table of the D statistic. I guess I could use the p-value when available. But I also get the message "cannot compute correct p-values with ties ..." doe

Re: [R] simplifying the code

2005-06-27 Thread Jim Brennan
This gives the same answer for what you have supplied so far... > dat$d<-ifelse((dat$b-dat$a)>=1000,dat$b-dat$a+1,0) > dat abcd 1 1 1001 1001 1001 2 2 100100 3 3 100100 4 4 100100 5 1 1002 1002 1002 6 2 1002 1001 1001 7 3 100200 8 4 10020

[R] simplifying the code

2005-06-27 Thread alex diaz
dear list: I made some corrections in the previous post that had some mistakes. I need help to achieve a simpler code to complete a task I'm performing. here is an example: dat<-expand.grid(a=seq(1,4),b=seq(1001,1004)) #I want to add a new column dat$c in that: t1<-ifelse(dat$a==1&dat$b==100

[R] A. Mani : colours in Silhouette

2005-06-27 Thread A. Mani
Hello, In cluster analysis with cluster, how does one colour the silhouette plots ? For example in using pam. There seems to be some problem there. Everything else can be coloured. Thanks, A. Mani Member, Cal. Math. Soc __ R-help@stat.math.eth

Re: [R] Linear Modeling and Predictions

2005-06-27 Thread Spencer Graves
Have you considered "predict" (including the examples with "?predict.lm")? spencer graves Tony Young wrote: > Hello all, > > I need some help with linear modeling and making predictions using my > model. What I have done is the following: > > -Read my variable data into

[R] function for "two-part" or "two-condition" models

2005-06-27 Thread Richard Chandler
Hello, This is an (hopefully) improved question of one I posted several weeks ago. Does anyone know of a function for fitting "two-part" models? These models are designed to handle count data with so many zeroes that they can't be fit well with zero-inflated Poisson models or other 'typical' GLMs.

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread james . holtman
If you have 'copied' the path from DOS, then you can use 'scan' to read it into a variable with the proper characters. Here is the string that I 'copied' D:\spencerg\statmtds\R\Rnews Here is the results after 'scan': > x.1 <- scan('clipboard', what='', allowEscapes=FALSE) Read 1 item > x.1

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Henrik Bengtsson
Spencer Graves wrote: > Hi, Henrik: > > Several functions, e.g., "grep", "sub", "gsub", and "regexpr", > have an argument "perl", FALSE by default. Moreover, "?regexp" has a > section on "Perl Regular Expressions". If you can do it in perl, might > that transfer to "gsub(..., perl=TRUE)

[R] simplifying the code

2005-06-27 Thread alex diaz
dear list: I need help to achieve a simpler code to complete a task I'm performing. here is an example: dat<-expand.grid(a=seq(1,5),b=seq(1000,1005)) I want to add a new column dat$c in that: t1<-ifelse(dat$a==1&dat$b==1001,1001,0) t2<-ifelse(dat$a==2&dat$b==1002,1001,0) t3<-ifelse(dat$a==3&da

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Spencer Graves
Hi, Henrik: Several functions, e.g., "grep", "sub", "gsub", and "regexpr", have an argument "perl", FALSE by default. Moreover, "?regexp" has a section on "Perl Regular Expressions". If you can do it in perl, might that transfer to "gsub(..., perl=TRUE)"? Thanks,

Re: [R] "Error in contrasts" in step wise regression

2005-06-27 Thread Prof Brian D Ripley
On Mon, 27 Jun 2005, Young Cho wrote: > Thanks for the reply. I created a new dataframe and ran step on it. But, > still it does not work. > > > detach(dat) > > attach(ds) > > dat <- ds[,sapply(ds,nlevels)>=2] > > dat$Y <- Response > > detach(ds) > > attach(dat) > > fmla <- as.formula(paste(" ~

Re: [R] "Error in contrasts" in step wise regression

2005-06-27 Thread Young Cho
Thanks for the reply. I created a new dataframe and ran step on it. But, still it does not work. > detach(dat) > attach(ds) > dat <- ds[,sapply(ds,nlevels)>=2] > dat$Y <- Response > detach(ds) > attach(dat) > fmla <- as.formula(paste(" ~ > ",paste(collist1[sapply(ds,nlevels)>=2],collapse="+"))

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Henrik Bengtsson
Spencer Graves wrote: > Thanks, Dirk, Gabor, Eric: > > You all provided appropriate solutions for the stated problem. > Sadly, I oversimplified the problem I was trying to solve: I copy a > character string giving a DOS path from MS Windows Explorer into an R > script file, and

[R] Linear Modeling and Predictions

2005-06-27 Thread Tony Young
Hello all, I need some help with linear modeling and making predictions using my model. What I have done is the following: -Read my variable data into R using read.table -Assigned the values to variable names so that each variable is a vector from the table -Generated my model using the lm co

[R] test of hazard ratios

2005-06-27 Thread Steve Adams
Hi, Is there a R test available that tests whether 2 hazard ratios obtained from Cox regressions on the same patient sample by 2 different classifiers are significantly different? Thanks Steve __ R-help@stat.math.ethz.ch mailing list https://stat.ethz

Re: [R] Mixed model

2005-06-27 Thread Spencer Graves
I often think carefully about what I want and store only that. For example, I might do something like the following: b1 <- coef(lme(...)) kb <- length(b1) B <- array(NA, dim=c(nb, kb)) for(i in 1:nb){ B[i, ] <- coef(lme(...))

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-27 Thread Spencer Graves
Thanks, Dirk, Gabor, Eric: You all provided appropriate solutions for the stated problem. Sadly, I oversimplified the problem I was trying to solve: I copy a character string giving a DOS path from MS Windows Explorer into an R script file, and I get something like the foll

Re: [R] problem with postcript() and umlauts

2005-06-27 Thread Prof Brian Ripley
That's the first time I have heard ß called an umlaut! This sounds like an encoding problem, perhaps using Latin-1 in a UTF-8 locale or vice versa. In particular, R 2.0.1 (there is no 2.01) is out of date and has far less support for non-English locales than 2.1.1, and none for UTF-8 locales

[R] SSlogis problem with min(y)==0

2005-06-27 Thread Chris Knight
Hi, I think this is a problem solved but I would be interested to know if there is some good reason why SSlogis() behaves like this (apologies if this has been noticed before- I'm not confident my archive searches were effective): I have been fitting large numbers of regressions using nls with a s

Re: [R] Numerical accuracy

2005-06-27 Thread Tuszynski, Jaroslaw W.
I do not know about details of numerical accuracy of R, it is probable related to numerical accuracy of C compiler that was used to compile it (gcc ?). However I would like to mention that I run into some problems with accuracy of sum and cumsum functions. See: > x = c(1, 1e20, 1e40, -1e40,

Re: [R] Clustered boxplots

2005-06-27 Thread Chuck Cleland
You might consider bwplot() in the lattice package instead. For example: mydata <- data.frame(Y = rnorm(3*1000), INDFACT =rep(c("A", "B", "C"), each=1000), CLUSFACT=factor(rep(c("M","F"), 1500))) library(lattice) trellis.device(new=FALSE, col=FALSE) b

[R] Numerical accuracy

2005-06-27 Thread Talita Perciano Costa Leite
Hi people, I need to prove the good quality of numerical accuracy of R. Anyone knows a paper or anything else comparing R to other statistical softwares in terms of numerical accuracy. I've made a long search about that but I found nothing. Please help me!! Thanx, Talita Leite -

[R] problem with postcript() and umlauts

2005-06-27 Thread Henning Rust
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I am running R 2.01 on SuSE 9.2 and I use GNU-Emacs and ESS. When using umlauts like ä ö ü ß for e.g. plot titles , I enter them directly in the code, like plot(seq(from=-4,to=4,length=100),dnorm(seq(from=-4,to=4,length=100)),main="Gauß-Verteil

[R] Clustered boxplots

2005-06-27 Thread ftorrei2
Hello, Is there a way to obtain clustered boxplots similar to the ones provided by SPSS? I have a dependent variable (y axis), an independent factor (which I intend to represent with different colors, no help needed here) and a grouping factor for the clusters (which I don´t know how to display) I

Re: [R] delta-beta's

2005-06-27 Thread Frank E Harrell Jr
JEB Halliday wrote: > Hi there > > I have created a multivariate logistic regression model looking at the > presence/absence of disease on farms. I would like to plot the diagnostic > plots recommended by Hosmer & Lemeshow to look particularly for any points of > high influence. In order to do t

[R] pca

2005-06-27 Thread saeedeh maleki
Hi Could any one tell me how can I apply PCA for Affy data. i have used prcomp but I get following error: Error in colMeans(x, n, prod(dn), na.rm) : invalid value of n Thanks Saeedeh - [[alternative HTML version deleted]] __

[R] SVM parameters...

2005-06-27 Thread David Meyer
Vivek, I certainly would agree that every help page, including the one of svm(), could be improved, but I think it is not _that_ deficient. In particular, it tells you which parameters are used in the various kernels available. Have you read the corresponding article in R News (basically contain

Re: [R] Reconstructing LD function

2005-06-27 Thread Prof Brian Ripley
On Mon, 27 Jun 2005 [EMAIL PROTECTED] wrote: > in an LDA analysis with n groups n-1 LD functions result. Implicitly this > defines an LD fucntion for the last group. Does there exist code already > to explictly construct this LD function? What `LDA analysis' are our discussing here? (LDA is usua

[R] Reconstructing LD function

2005-06-27 Thread usenet
Dear all, in an LDA analysis with n groups n-1 LD functions result. Implicitly this defines an LD fucntion for the last group. Does there exist code already to explictly construct this LD function? Thanks, Stefan __ R-help@stat.math.ethz.ch mailing lis

Re: [R] Sweave with layout() and loop

2005-06-27 Thread Friedrich . Leisch
> On Sun, 26 Jun 2005 11:36:14 -0700 (PDT), > Mikkel Grum (MG) wrote: > When I try the following code with the Windows > graphics window, a new window is opened for each > multiple of four images I produce. > par(layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE)), > mar = c(2, 3, 2,

Re: [R] graphic window with tabs

2005-06-27 Thread Duncan Murdoch
Marco Zucchelli wrote: > Hi, > > I need to display several plots and I wonder if it is possible to create a > graphic window with tabs so that the plots can be scrolled clicking on the > tabs You don't say what platform you're working on. On Windows, the standard graphics driver doesn't supp

Re: [R] (sans objet)

2005-06-27 Thread Michael Dewey
At 11:12 26/06/05, pir2.jv wrote: >Ma première question: puis-je écrire en français, mon anglais est >pire que pire. J'essaie en français; sinon, j'essaierai une traduction! > >Je sduis débutant. Ma question est donc simple, j'imagine. I think ?merge is your friend here. >Je travaille sur des tab

[R] delta-beta's

2005-06-27 Thread JEB Halliday
Hi there I have created a multivariate logistic regression model looking at the presence/absence of disease on farms. I would like to plot the diagnostic plots recommended by Hosmer & Lemeshow to look particularly for any points of high influence. In order to do this I need to extract values fo

[R] graphic window with tabs

2005-06-27 Thread Marco Zucchelli
Hi, I need to display several plots and I wonder if it is possible to create a graphic window with tabs so that the plots can be scrolled clicking on the tabs Best regards Marco [[alternative HTML version deleted]] __ R-help@stat.math.et

Re: [R] Convert a "by" list into a data frame

2005-06-27 Thread Peter Dalgaard
Gabor Grothendieck <[EMAIL PROTECTED]> writes: > On 6/26/05, Tudor Bodea <[EMAIL PROTECTED]> wrote: > > Dear useRs, > > > > Is there a way to convert a list generated by "by" command into a data > > frame? > > Here is an example which creates a by object whose elements > are the first row of ea

Re: [R] interpreting Weibull survival regression

2005-06-27 Thread Prof Brian Ripley
On Mon, 27 Jun 2005, Göran Broström wrote: On Sun, Jun 26, 2005 at 11:28:04PM +0100, Prof Brian Ripley wrote: Here gamma is the usual gamma function, see ?gamma. (I notice in the R documentation of the Weibull distribution that "E(X) = b Gamma(1+1/a)", which is an error; the G should be g (lowe

Re: [R] chisq.test using amalgamation automatically (possible ?!?)

2005-06-27 Thread Prof Brian Ripley
You have actually used chisq.test to test independence of the cross tabulation of x and y as factors, a table with 1 on the diagonal and 0 elsewhere. I doubt this was your intention, but unfortunately you have not told us your actual intention. Perhaps you intended y to be the expected values,

[R] SVM parameters...

2005-06-27 Thread Vivek Subramanian
hi, i am really sorry to ask this on the list, but i havent been able to find anything on this topic. i would like to know how the various parameters in the svm function call in library e1071 work. all the literature that i was able to find on the internet have been on the mathematics and derivat