Re: [R] Creating tables with std errors beneath estimates

2006-04-07 Thread Dieter Menne
Brian Quinif bquinif at gmail.com writes: What I need to do is make tables with the std. errors beneath the estimates in parentheses (standard econ style). How can I make a dataframe with that format? Best prepare the output in R as strings; there are alternatives in LaTeX, but it can be

Re: [R] for bclust in package e1071

2006-04-07 Thread Uwe Ligges
Linda Lei wrote: Hi All, Could you please help with the error I get from the following codes? Library(cluster) data(iris) bc1 - bclust(iris[,2:5], 3, base.method=clara, base.centers=5) Then I got: Committee Member:

Re: [R] New behavior in estimable(), bug or feature?

2006-04-07 Thread Dieter Menne
CG Pettersson cg.pettersson at evp.slu.se writes: Fitting and reducing a first model for grain yield went smoothly. When I wanted to look at the fixed effects with estimable() I got an error message claiming that I was using the wrong variable names, estimable wanted the variable names in

[R] simple if statement

2006-04-07 Thread Brian Quinif
I am ashamed to be asking this question, but I couldn't find the solution anywhere. Searching for if and R is not very productive... I cannot get a simple if statement to work. I have data on college students. I want to make a string variable that has the names of the years. That is, when the

[R] cclust causes R to crash when using manhattan kmeans

2006-04-07 Thread Timo Becker
Dear R users, When I run the following code, R crashes: require(cclust) x - matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE) cclust(x, centers=x[2:3,], dist=manhattan, method=kmeans) While this works: cclust(x, centers=x[2:3,], dist=euclidean, method=kmeans) I'm posting this here because I am

[R] simple if statement

2006-04-07 Thread Ken Knoblauch
How about the following, if you really want characters or just leave as factor i - round(runif(10, 1, 4)) years - as.character(factor(i, labels = c(Freshman, Sophomore, Junior, Senior))) HTH, ken __ R-help@stat.math.ethz.ch mailing list

Re: [R] R CMD check for packages in a bundle

2006-04-07 Thread Robin Hankin
Hi everyone What you are trying to do does work, I do it all the time, but there are a few details to work out. Because of the above differences I actually generate the DESCRIPTION* files from my Makefile, differently depending on the target. I do too. Having a DESCRIPTION.in is

Re: [R] simple if statement

2006-04-07 Thread Brian Quinif
Hi Ken, Thanks for the help, but I should have mentioned that I want to do this within a loop. Perhaps it would be better for me to explain my exact situation. I am running two loops so that I can calculate estimates for years 1,2,3,4 and a categorical GPA variable that takes on three values

Re: [R] simple if statement

2006-04-07 Thread Prof Brian Ripley
On Fri, 7 Apr 2006, Brian Quinif wrote: I am ashamed to be asking this question, but I couldn't find the solution anywhere. Searching for if and R is not very productive... I cannot get a simple if statement to work. I have data on college students. I want to make a string variable that

Re: [R] cclust causes R to crash when using manhattan kmeans

2006-04-07 Thread Friedrich . Leisch
On Fri, 07 Apr 2006 09:02:46 +0200, Timo Becker (TB) wrote: Dear R users, When I run the following code, R crashes: require(cclust) x - matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE) cclust(x, centers=x[2:3,], dist=manhattan, method=kmeans) While this works: cclust(x,

Re: [R] cclust causes R to crash when using manhattan kmeans

2006-04-07 Thread Uwe Ligges
Timo Becker wrote: Dear R users, When I run the following code, R crashes: require(cclust) x - matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE) cclust(x, centers=x[2:3,], dist=manhattan, method=kmeans) While this works: cclust(x, centers=x[2:3,], dist=euclidean, method=kmeans) I'm

Re: [R] partitioning cluster function

2006-04-07 Thread Friedrich . Leisch
On Wed, 5 Apr 2006 12:58:00 -0700, Linda Lei (LL) wrote: Hi All, For the function bclust(e1071), the argument base.method is explained as must be the name of a partitioning cluster function returning a list with the same components as the return value of 'kmeans'. In my

Re: [R] problem with statetable function in msm

2006-04-07 Thread Uwe Ligges
Vassily Shvets wrote: Just a note to say if you use msm you may find that statetable returns an incorrect statetable: you can then build an incorrect model and not even know that statetable was the villain. shfets __ R-help@stat.math.ethz.ch

Re: [R] simple if statement

2006-04-07 Thread Philipp Pagel
On Fri, Apr 07, 2006 at 02:58:00AM -0400, Brian Quinif wrote: I have data on college students. I want to make a string variable that has the names of the years. That is, when the year variable i is equal to 1, I want to have a variable called years equal to Freshmen. I tried this years

Re: [R] simple if statement

2006-04-07 Thread Philipp Pagel
On Fri, Apr 07, 2006 at 09:55:47AM +0200, Philipp Pagel wrote: On Fri, Apr 07, 2006 at 02:58:00AM -0400, Brian Quinif wrote: I tried this years - Freshmen if i==1 years - Sophomores if i==2 What you are looking for is not an if clause but logical indexing: years[years==Freshmen] - 1

Re: [R] rpart.predict error--subscript out of bounds

2006-04-07 Thread Uwe Ligges
Leon wrote: Hi, I am using rpart to do leave one out cross validation, but met some problem, Data is a data frame, the first column is the subject id, the second column is the group id, and the rest columns are numerical variables, Data[1:5,1:10] sub.id group.id X3262.345 X3277.402

Re: [R] cclust causes R to crash when using manhattan kmeans

2006-04-07 Thread Timo Becker
Uwe Ligges schrieb: Timo Becker wrote: Dear R users, When I run the following code, R crashes: require(cclust) x - matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE) cclust(x, centers=x[2:3,], dist=manhattan, method=kmeans) While this works: cclust(x, centers=x[2:3,], dist=euclidean,

Re: [R] documenting s4 methods in package

2006-04-07 Thread Steven Lacey
Why do some functions build chm help and others do not? Is there something in the .Rd file that specifies this? Thanks, Steve -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 04, 2006 2:22 PM To: Steven Lacey Cc: 'Thomas Lumley';

Re: [R] documenting s4 methods in package

2006-04-07 Thread Duncan Murdoch
On 4/7/2006 6:03 AM, Steven Lacey wrote: Why do some functions build chm help and others do not? Is there something in the .Rd file that specifies this? They all build it (if you have the appropriate variable defined in the makefile). The difference is that other formats are redone with every

[R] fuzzy classification and dissimilarity matrix

2006-04-07 Thread Jeanne Vallet
Hello, I want to make a fuzzy classification from a dissimilarity matrix (calculated with daisy from package 'cluster'). I have tried to use fanny (package cluster) but I have the same problems than described in a previous message (http://tolstoy.newcastle.edu.au/R/help/05/05/4546.html) i.e. it

Re: [R] creating files using for loop

2006-04-07 Thread Gabor Grothendieck
On 4/7/06, Brian Quinif [EMAIL PROTECTED] wrote: I tried that, and the problem seems to be that the results of the 'paste'ing are enclosed in quotes...that is the paste yields '101.tex'. Of course, that is what I said I wanted above, and it should work for that particular instance, but I also

[R] strange matrix behaviour: is there a matrix with one row?

2006-04-07 Thread ryszard . czerminski
Consider this: y - matrix(1:8, ncol=2) is.matrix(y[-c(1,2),]) [1] TRUE is.matrix(y[-c(1,2,3),]) [1] FALSE is.matrix(y[-c(1,2,3,4),]) [1] TRUE It seems like an inconsistent behaviour: - with 2 or more rows we have a matrix - with 1 row we do not have a matrix and - with 0 rows we have a

[R] fdim package questions

2006-04-07 Thread James R. Milks
I have a basic question on the mechanics of fdim. I am calculating the information dimension of tree distributions. What I have are positions of trees within a plot (x data in one column, y data in another). My question is this: how does fdim combine the data from both columns to

[R] Why is transform=km the default for cox.zph?

2006-04-07 Thread Kevin E. Thorpe
To enhance my understanding, and that of my students, I have a question about cox.zph in the survival package. If I have correctly gleaned the high-level point from the 1994 Biometrika paper of Grambsch and Therneau, it looks to me like cox.zph provides a mechanism to test for a simple trend in

Re: [R] strange matrix behaviour: is there a matrix with one row?

2006-04-07 Thread Dimitris Rizopoulos
this is documented: check ?[. You need to specify drop = FALSE, i.e., is.matrix(y[-c(1,2,3), , drop = FALSE]) Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel:

Re: [R] strange matrix behaviour: is there a matrix with one row?

2006-04-07 Thread François Pinard
[EMAIL PROTECTED] y - matrix(1:8, ncol=2) is.matrix(y[-c(1,2),]) [1] TRUE is.matrix(y[-c(1,2,3),]) [1] FALSE is.matrix(y[-c(1,2,3,4),]) [1] TRUE It seems like an inconsistent behaviour: - with 2 or more rows we have a matrix - with 1 row we do not have a matrix and - with 0 rows we have a

Re: [R] strange matrix behaviour: is there a matrix with one row?

2006-04-07 Thread Wiener, Matthew
Use drop = FALSE in your subscripting calls. That will retain matrixness. For example: y - matrix(1:8, ncol = 2) is.matrix(y[-c(1,2,3),,drop = FALSE] More info is on the help page for [. You can type: ?[ to get it from the command line. Hope this helps, Matt Wiener -Original

Re: [R] Command line support tools - suggestions?

2006-04-07 Thread Larry Howe
I'm interested in any thoughts that people have about this idea - what errors do you commonly see, and how can they be dealt with? Another (selfish) idea: a guide for programmers coming from other languages that highlights the differences between languages. For example, a perl to R guide or C

Re: [R] strange matrix behaviour: is there a matrix with one row?

2006-04-07 Thread Thomas Lumley
On Fri, 7 Apr 2006, Dimitris Rizopoulos wrote: this is documented: check ?[. You need to specify drop = FALSE, i.e., is.matrix(y[-c(1,2,3), , drop = FALSE]) It's not only documented, it's a FAQ. -thomas Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical

[R] [Q] Format of a plot axis label

2006-04-07 Thread Young-Jin Lee
Dear R-users Can anyone please tell me how to format a label of a plot? I found that R uses a floating point number (e.g. 2.0) sometimes and an integer number (e.g. 2) other times in lables of a plot even though no floating number is needed to show the lables. How can I get R to use only integer

[R] Dealing with missing values in HeatMap generation

2006-04-07 Thread Himanshu Ardawatia
Hi, I want to generate a heatmap for my data (in a matrix). However, the data has some missing values (represented as blank). I get the following errors (with the blanks and with blanks replaced by NA and including the option rm.na = TURE): filename = input_heatmap.txt g -

Re: [R] Why is transform=km the default for cox.zph?

2006-04-07 Thread Thomas Lumley
On Fri, 7 Apr 2006, Kevin E. Thorpe wrote: To enhance my understanding, and that of my students, I have a question about cox.zph in the survival package. If I have correctly gleaned the high-level point from the 1994 Biometrika paper of Grambsch and Therneau, it looks to me like cox.zph

[R] a statistics question

2006-04-07 Thread Weiwei Shi
Hi there, I have a statistics question on a classification problem: Suppose I have 1000 binary variables and one binary dependent variable. I want to find a way similar to PCA, in which I can find a couple of combinations of those variables to discriminate best according to the dependent

Re: [R] [Q] Format of a plot axis label

2006-04-07 Thread Prof Brian Ripley
Do you mean the axis tick annotations, the xlab, the ylab or what? (It is the xlab and ylab that are quite explicitly called 'axis label' in the documentation.) If you mean the axis tick annotations, please show us an example where R uses an unnecessary (in your view) '.0'. The internal code

[R] Aggregating an its series

2006-04-07 Thread Vittorio
I'm using a very long irregular time-series of air temperature and relative humidity of this kind (this is an extract only) its.format(% Y%d%m %X) base T H 20020601 12.00.00 27.1 47 20020601 15.00.00 29.1 39 20020601 18.00.00 27.4 39 20020601 21.00.00 24.0 40

Re: [R] Dealing with missing values in HeatMap generation

2006-04-07 Thread Sean Davis
On 4/7/06 11:54 AM, Himanshu Ardawatia [EMAIL PROTECTED] wrote: Sean Davis wrote: On 4/7/06 11:01 AM, Himanshu Ardawatia [EMAIL PROTECTED] wrote: Hi, I want to generate a heatmap for my data (in a matrix). However, the data has some missing values (represented as blank). I

Re: [R] Dealing with missing values in HeatMap generation

2006-04-07 Thread Michael Dondrup
Hi, 'g' must be a numeric matrix and obviously it's not (suspect it's character?). If 'g' is numeric in your example depends on how you read data into 'filedata' and this step is missing in your code (maybe you just forgot to use read.table?). See ?read.table for that, and use argument

Re: [R] Aggregating an its series

2006-04-07 Thread Whit Armstrong
aggregate(base,by=list(as.factor(format(dates(base),%Y%m%d))),mean,na. rm=T) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vittorio Sent: Friday, April 07, 2006 11:38 AM To: r-help@stat.math.ethz.ch Subject: [R] Aggregating an its series I'm using a

Re: [R] a statistics question

2006-04-07 Thread Peter Ehlers
It sounds as though 'logic regression' might help. See Ruczinski I, Kooperberg C, LeBlanc ML (2003). Logic Regression, Journal of Computational and Graphical Statistics, 12, 475-511. and the LogicReg package. Peter Ehlers Weiwei Shi wrote: Hi there, I have a statistics question on a

Re: [R] a statistics question

2006-04-07 Thread Sean Davis
Weiwei, You could also look into using one of several methods of classification that calculate the weight of individual predictors in producing a correct result based on some version of cross-validation. One that I use relatively often is randomForest (in the randomForest package). Sean On

Re: [R] fuzzy classification and dissimilarity matrix

2006-04-07 Thread Martin Maechler
Jeanne == Jeanne Vallet [EMAIL PROTECTED] on Fri, 7 Apr 2006 12:43:59 +0200 writes: Jeanne Hello, I want to make a fuzzy classification from a Jeanne dissimilarity matrix (calculated with daisy from Jeanne package 'cluster'). I have tried to use fanny Jeanne (package

[R] more documentation on lmer?

2006-04-07 Thread Bill Shipley
Hello. Is there any documentation on the lmer function in the lme4 package beyond what was published in the May 2005 R News (vol.5/1)? As well, has the nonlinear version of lmer appeared yet? Bill Shipley North American Editor, Annals of Botany Editor, Population and Community Biology

[R] documentation for lmer?

2006-04-07 Thread Bill Shipley
Hello. Besides the short paper in the May 2005 edition of R News, I have not found any documentation concerning the lmer function in the lme4 package. Does anyone know of anything more substatial? Also, does anyone know if the nonlinear equivalent of lmer exists yet? Thanks. Bill Shipley

Re: [R] a statistics question

2006-04-07 Thread Weiwei Shi
The goal of logic regression is to find predictors that are Boolean (logical) combinations of the original predictors, which might be more like what I need. The rf's variable importance evaluations and oob might help feature selection but not feature construction, which is more of my concern.

[R] finding common elements in a list

2006-04-07 Thread Andy Bunn
Suppose I have a list where I want to extract only the elements that occur in every component. For instance in the list foo I want to know that the numbers 2 and 3 occur in every component. The solution I have seems unnecessarily clunky. TIA, Andy foo - list(x = 1:10, y=2:11, z=1:3) bar

Re: [R] a statistics question

2006-04-07 Thread Liaw, Andy
Jerry Friedman's RuleFit finds important rules, which I guess can be thought of as features... Andy From: Weiwei Shi The goal of logic regression is to find predictors that are Boolean (logical) combinations of the original predictors, which might be more like what I need. The rf's

Re: [R] documentation for lmer?

2006-04-07 Thread Liaw, Andy
The vignette in the mlmRev package might be of some help. Andy From: Bill Shipley Hello. Besides the short paper in the May 2005 edition of R News, I have not found any documentation concerning the lmer function in the lme4 package. Does anyone know of anything more substatial? Also,

[R] how to run stepAIC starting with NULL model?

2006-04-07 Thread Joshua B Robins
Hello, I'm trying to figure out how to run the stepAIC function starting with the NULL model. I can call the null model (e.g., lm(y ~ NULL)), but using this object in stepAIC doesn't seem to work. The objective is to calculate AICc. This can be done if stepAIC can be run starting with the NULL

Re: [R] how to run stepAIC starting with NULL model?

2006-04-07 Thread Peter Ehlers
Joshua B Robins wrote: Hello, I'm trying to figure out how to run the stepAIC function starting with the NULL model. I can call the null model (e.g., lm(y ~ NULL)), but using this object in stepAIC doesn't seem to work. I don't know what doesn't seem to work means here, but your null

Re: [R] finding common elements in a list

2006-04-07 Thread Patrick Burns
Here is one solution: all(unlist(lapply(foo, function(x) c(2,3) %in% x))) [1] TRUE This doesn't have the restriction of assuming that the components of the list have unique elements, as the original solution does. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com

[R] Multiple ablines

2006-04-07 Thread G. Alex Janevski
Thanks in advance, I have searched and read the archives extensively and have been unable to find a question (solution) exactly mimicking my problem. I have created a scatterplot simulation of data through which I have drawn a linear regression in this manner: points(y~x, pch=*, col=black)

[R] saving estimates from a for loop for later use

2006-04-07 Thread Brian Quinif
Thanks to the help of many on this list, I am now an R user and have been able to write some functioning code to do matching estimation. I have two for loops (i in 1:3, and j in 0:2). Within the loops, I had been creating matrices of relevant estimation coefficents in order to make lots of LaTeX

[R] CLI Issue

2006-04-07 Thread A Mani
Hello, I have a script that must be executed by R at the CLI completely ... without halting execution on encountering an error (object not found). Rcmdr works fine, but source behaves strangely in R-2.1... Thanks, -- A. Mani Member, Cal. Math. Soc [[alternative HTML version

Re: [R] saving estimates from a for loop for later use

2006-04-07 Thread jim holtman
use a 'list'; x - list() for (i in 1:3) for (j in 0:2) { .your calculations. x[[as.character(i)]][[as.character(j)]] - yourResults } On 4/7/06, Brian Quinif [EMAIL PROTECTED] wrote: Thanks to the help of many on this list, I am now an R user and have been able to write

Re: [R] saving estimates from a for loop for later use

2006-04-07 Thread Brian Quinif
I kind of understand this recommendation, but I can't figure out how to work with x once I have created it. Here is some fully reproducible code. It creates a 4x1 matrices within the loops. Once done with the looping, I want to cbind these matrices together. I know it's a simple question, but

Re: [R] Time Series Objects/ MC Simulation

2006-04-07 Thread Spencer Graves
I don't have a direct answer to your question, but in case you are interested in a general introduction to time series capabilties in R, I will suggest the following: 1. Ch. 14 in Venables and Ripley (2002) Modern Applied Statistics with S, 4th ed. (Springer) 2.

Re: [R] saving estimates from a for loop for later use

2006-04-07 Thread Liaw, Andy
If the matrices you're storing inside the loop are all the same dimension (as in your example), it's probably better to store them in an array; e.g.: i1 - 2:3 i2 - 11:12 x - array(0, c(4, 1, length(i1), length(i2))) for (i in seq(along=i1)) { for (j in seq(along=i2)) { x[, , i, j] -

Re: [R] saving estimates from a for loop for later use

2006-04-07 Thread Brian Quinif
Thanks for the suggestion, but I do not know how to get it to work for the actual matrix I want to create. This is not reproducible, but here is the form of the matrix I want: #above I compute satt.yr.hrs and satt.full.load using Match() Estimates - matrix(c(satt.yr.hrs$est,

Re: [R] saving estimates from a for loop for later use

2006-04-07 Thread Gabor Grothendieck
Another possibility is to create a data.frame. I've just put one statistic, sum, in it but you could put in as many as you like: g - expand.grid(i = 1:2, j = 1:2, k = 1:3) f - function(x) with(x, c(i = i, j = j, k = k, sum = i+j+k)) do.call(rbind, lapply(split(g, rownames(g)), f)) i j k

Re: [R] CLI Issue

2006-04-07 Thread ronggui
Maybe clt.examp() in TeachingDemos is what you want. 2006/4/8, A Mani [EMAIL PROTECTED]: Hello, I have a script that must be executed by R at the CLI completely ... without halting execution on encountering an error (object not found). Rcmdr works fine, but source behaves strangely

Re: [R] saving estimates from a for loop for later use

2006-04-07 Thread Brian Quinif
Hi Andy, I apologize for the flat structure of my code. I do not know much about programming conventions. I think your solution will work quite well, but could you clarify a couple of things? In the line x - array('', c(4, 1, 6, 2, 3)) where do the numbers 4, 1, 6, 2, 3 come from. Here are