Re: [R] a quick Q: a function in R, equivalent to atoi functionin C?

2003-07-30 Thread Thomas W Blackwell
On Wed, 30 Jul 2003, Yan Yu wrote: I wonder is there a function in R, which can achieve the functionality of atoi in C, i.e., convert from a character string to a number? as.numeric() I use Sys.getenv(), it returns a character string, e.g., 12, but i need a number, e.g., 12, to fit into

Re: [R] Plot ticks and tick labels: thickness, colour?

2003-08-14 Thread Thomas W Blackwell
Dirk - You can certainly make tickmarks thinner than the axis line by multiple calls to axis() with different values for lwd. MAYBE you can overwrite an earlier call by setting col.axis=white (and no tickmarks) but I've never tried this. mtext() allows building custom tick labels. In

Re: [R] A question on orthogonal basis vectors

2003-08-14 Thread Thomas W Blackwell
The answer is certainly not unique. Your email doesn't say whether you are asking about principal components or simply Gram-Schmidt orthogonalization. - tom blackwell - u michigan medical school - ann arbor - On Wed, 13 Aug 2003, Feng Zhang wrote: I have a question about determining

Re: [R] Standard error of standard deviation: bootstrap or theoreticalresults?

2003-08-14 Thread Thomas W Blackwell
Huan - The difference between the empirical (bootstrap') result and the theoretical results shows evidence for autocorrelation in the time series data. - tom blackwell - u michigan medical school - ann arbor - On Wed, 6 Aug 2003 [EMAIL PROTECTED] wrote: This is more a statistical

Re: [R] leave-one-out

2003-08-14 Thread Thomas W Blackwell
help.search(cross validation) returns 'cv.glm(boot)' and the boot package provides many other utilities for this. - tom blackwell - u michigan medical school - ann arbor - On Thu, 14 Aug 2003, array chip wrote: Hi, is there a package for performing leave-one-out cross validation in

Re: [R] help with Tukey Mean-Difference Plot

2003-08-15 Thread Thomas W Blackwell
Frank - help(tmd) says that in R, the Tudkey Mean Difference plot is constructed by: x=(x+y)/2, y=y-x. That's different from what you quote below, but it agrees with my memory of it. Not sure I understand your question. - tom blackwell - u michigan medical school - ann arbor - On

Re: [R] type I and type III sums of squares

2003-08-18 Thread Thomas W Blackwell
Paul - Your question is best answered by a textbook reference, because that will supply all the context needed to fully answer your question. A good, basic reference is: George W. Snedecor and William G. Cochran (1980) Statistical Methods, 7th edition. Iowa State Univ. Press. ISBN:

Re: [R] glmmPQL() and memory limitations

2003-08-18 Thread Thomas W Blackwell
Elliott - I don't know if you've had any other responses off-list yet; none have shown up on the r-help mailing list during the day today. I'm really NOT the most expert person to answer this, but I'll give it a try. Your option (1) seems entirely possible to me. Let me do some thinking out

Re: [R] Command line R / PHP?

2003-08-19 Thread Thomas W Blackwell
On Wed, 20 Aug 2003, Zitan Broth wrote: . . . What I am trying to do is use R as part of a web-based system and call R from PHP. The common method of interfacing from PHP to many systems is via the command line (although I could use swig to access R directly but that is phase 2 ;-) ). I

Re: [R] R-1.7.1 gets installed without default packages withoutreadline

2003-08-19 Thread Thomas W Blackwell
Laurent - I had no trouble with configuring, compiling and running R under Redhat 8.0. My system now gives uname -a Linux host 2.4.18-14smp #1 SMP Wed Sep4 12:34:47 EDT 2002 i686 i686 i386 GNU/Linux rpm -qa | grep readline readline41-4.1-14 readline-4.3-4 readline-devel-4.3-3 The

Re: [R] Variance Computing - HELP

2003-08-19 Thread Thomas W Blackwell
The variance of Xbar decreases as 1/n; the sample variance of X does not. - tom blackwell - u michigan medical school - ann arbor - On Tue, 19 Aug 2003, Padmanabhan, Sudharsha wrote: I am running a few simulations for clinical trial anlysis. I want some help regarding the following.

Re: [R] comparing segments of a time series

2003-08-21 Thread Thomas W Blackwell
Tony - I happen to have a copy of Erich L. Lehmann and H.J.M D'Abrera (1975) Nonparametrics: Statistical Methods based on Ranks. Holden-Day, SF, sitting beside me on my desk this afternoon. What you want is covered in Section 2.7L on pp. 104-105, titled Scale tests with unknown location.

Re: [R] graphic widow overwrite

2003-08-21 Thread Thomas W Blackwell
No, I don't think so. That's a feature not implemented in R. - tom blackwell - u michigan medical school - ann arbor - On Thu, 21 Aug 2003, array chip wrote: I am running a loop to plot multiple plots. In s-plus, it shows multiple pages in the graphic window to allow checking on each

Re: [R] converting factor to numeric

2003-08-21 Thread Thomas W Blackwell
Kjetil - EdadC seems to have only five levels, anyway. What are those five levels ? Are they strings which it would make sense to interpret as numeric ? as.numeric() obviously thinks they are not. - tom blackwell - u michigan medical school - ann arbor - On Thu, 21 Aug 2003, kjetil

Re: [R] subscript out of range message

2003-08-21 Thread Thomas W Blackwell
On Thu, 21 Aug 2003 [EMAIL PROTECTED] wrote: I was recently working with a dataset on arsenic poisoning. Among the variables in the dataset, I used the following three variables to produce crosstabulations (variable names: FOLSTAT, GENDER, ASBIN; all three were categorical variables, FOLSTAT

Re: [R] Reducing matrix dimension

2003-08-21 Thread Thomas W Blackwell
help(Subscript) On Fri, 22 Aug 2003 [EMAIL PROTECTED] wrote: Hi, I wonder whether someone can help me with this query. I have a 12(cols) by 9(rows) matrix X. I need to reduce this matrix so that it contains 'n' columns (eg. reduce X into a 3 by 9 matrix). What is the best method to do

Re: [R] means comparison with seasonal time series?

2003-08-22 Thread Thomas W Blackwell
Douglas - Your question is a bit beyond the scope of this list. It's really at a level appropriate for an advanced graduate student who is already doing a thesis in the area of time series data. Best thing is to see whether you can find some consulting help from a local statistics department.

Re: [R] Book recommendations: Multilevel longitudinal analysis

2003-08-25 Thread Thomas W Blackwell
Jose C. Pinheiro and Douglas M. Bates (2000) Mixed effects models in S and S-PLUS. NY, Springer, 2000. ISBN: 0-387-98957-9, LC: QA 76.73 .S15 P561 2000 (locally) - tom blackwell - u michigan medical school - ann arbor - On Mon, 25 Aug 2003, Peter Muhlberger wrote: Hi, does anyone out

Re: [R] Problem and Question regarding R

2003-08-31 Thread Thomas W Blackwell
Bernhard - 1) DO try building from source. For me it works painlessly (Redhat 8.0 linux) and ./configure seems to be very good at locating the resources it needs. 2) The very easiest, dumbest interface between Perl and R is for Perl to write an ascii file of R commands - exactly what one

Re: [R] How to free memory used by R.

2003-09-01 Thread Thomas W Blackwell
On Mon, 1 Sep 2003, Lariani,Sofiane,LAUSANNE,NRC/BAS wrote: I want to free memory used by R. The usage of rm and gc give no result. I'm running an algorithm consuming a huge memory and I need to recover the memory used by R between 2 call of my algorithm. Thank you in advance for your help.

Re: [R] error message in nlm()

2003-09-01 Thread Thomas W Blackwell
Johannes - There's something special about the way control parameters are accepted by nlm() and nlme(). Try searching very recent help archives for nlme() or control. Try duplicating exactly one of the examples at the bottom of the help page help(nlm). My recollection is that the parameter

Re: [R] Error in dyn.load

2003-09-01 Thread Thomas W Blackwell
Philip - Why not compile and load using the unix command line: R CMD SHLIB files rather than try to write your own compiler flags ? See help(SHLIB), help(COMPILE) inside R. You may have a good reason for NOT going the ordinary route, but you need to tell us what it is. And do try the

Re: [R] stack overflow

2003-09-05 Thread Thomas W Blackwell
Bill - Here's what I would do, starting after your display of anovaresults[[1]]. temp.1 - unlist(lapply(anovaresults, function(x) { x[Pr(F)][1:3],] })) temp.2 - matrix(temp.1, length(anovaresults), 3, byrow=T) dimnames(temp.2) - list(names(anovaresults),

Re: [R] How do I coerce numeric factor columns of data frame to vector?

2003-09-08 Thread Thomas W Blackwell
Murray - Suppose your data frame is called mydata. If ALL of the columns were factors with numeric levels, you could do: newdata - as.data.frame(lapply(mydata, function(x) as.numeric(as.character(x (Sorry about the nested functions. I didn't invent these complications.) When only the

Re: [R] How do I coerce numeric factor columns of data frame to vector?

2003-09-08 Thread Thomas W Blackwell
Michael - Because these columns are factors to begin with, using as.numeric() alone will have unexpected results. See the section Warning: in help(factor). However, it is worth Murray asking himself WHY these columns are factors to start with, rather than the expected numeric values. One

Re: [R] Need your help-SOS

2003-09-10 Thread Thomas W Blackwell
WeiQiang - As I read it, both difficulties arise on the DCOM side, not in the R syntax. Problem 1, and I'm just guessing, could arise if you are not allowed to overwrite the value of Result in the DCOM environment. Try again, using two different variable names in the two successive lines.

Re: [R] what does this error mean?

2003-09-13 Thread Thomas W Blackwell
Josh - See the example run a simulation in help(try). This won't be able to tell you the Spearman correlation when there are fewer than two pairs of non-missing values, but it will allow the loop to keep running. Caution: the return value from try() will be a string with the error message,

Re: [R] Retrieve ... argument values

2003-09-16 Thread Thomas W Blackwell
Huan - Look at the function code for order(). To show the function definition, type just order at the command line (no quotes, no parentheses). This example is what I found most useful when I had a similar question. The green book is also useful. - tom blackwell - u michigan medical

[R] help(print) seems truncated

2003-09-16 Thread Thomas W Blackwell
Dear r-help - I just noticed that in my R-1.7.1 on i386-pc-linux-gnu, the page displayed by help(print) ends with the line ## Printing of factors illustrated for ex and then no more. It looks as though something got truncated here. I think this is an R that I compiled from source off

Re: [R] can predict ignore rows with insufficient info

2003-09-16 Thread Thomas W Blackwell
Peter - Your subsequent email seems just right. You have to determine ahead of time which rows can be estimated. Here's a strategy, and possibly some code to implement it. Let supported(i,y,d) be a user-written function which returns a logical vector indicating rows which should be omitted

Re: [R] can predict ignore rows with insufficient info

2003-09-16 Thread Thomas W Blackwell
Peter - Error !! I forgot a not in the third line inside the function supported(). And, my mail editor doesn't balance parentheses, so I don't guarantee that my code is even syntatically correct. Corrected and re-named version of function: unsupported - function(i,y,d) { result - rep(F,

Re: [R] can predict ignore rows with insufficient info

2003-09-16 Thread Thomas W Blackwell
On Tue, 16 Sep 2003, Peter Whiting wrote: It seems that predict removes rows with insufficient information (ie, if I replace ALBANY with NA and refactor everything works) - I wonder why it doesn't exhibit the same behavior when it encounters a new level - just eliminate the row and go on...

Re: [R] 3D plot/surface rotation

2003-09-17 Thread Thomas W Blackwell
Perhaps MZodet wants the interactive, mouse controlled rotation capability offered by ggobi www.ggobi.org ? Designed for linux but advertises better portability to Microsoft Windows. I have no experience myself either installing or using this. - tom blackwell - u michigan medical school -

Re: [R] list subsets passing parameters question.

2003-09-19 Thread Thomas W Blackwell
Eryk - Question 1: Square brackets work, just the same as for vectors, and return a (smaller or larger) list object. The new thing with lists, not available (or needed) with vectors, is double square brackets, which return one list element as itself, not enclosed in a list. See

Re: [R] Saving with tkgetSaveFile

2003-09-19 Thread Thomas W Blackwell
Ruben - Why not simply save(x, file=new.file.name) ? See help(save), help(files). The file name must be quoted, and it must be passed as a named argument to save(). - tom blackwell - u michigan medical school - ann arbor - On Fri, 19 Sep 2003 [EMAIL PROTECTED] wrote: HI, i'm

Re: [R] discretization method

2003-09-23 Thread Thomas W Blackwell
On Tue, 23 Sep 2003, Jaime Lopez Carvajal wrote: I need to apply discretization to my continuous data. Is there a method in R to do this? See help(cut). - tom blackwell - u michigan medical school - ann arbor - __ [EMAIL PROTECTED] mailing

Re: [R] using assign on save?

2003-09-24 Thread Thomas W Blackwell
Andy - help(assign) says: Value: This function is invoked for its side effect, which is assigning `value' to the variable `x'. ... Gosh. The help page isn't very specific about what the return value of assign() IS, but it's not a named object. Your basic strategy of assigning, writing,

Re: [R] ungrouping grouped data

2003-09-25 Thread Thomas W Blackwell
Michael - new - as.data.frame(lapply(data, function(x,p) rep(x,p), data[[frequency]])) This should do it. The first paragraph under Details in help(rep) says what rep(x,p) is doing above. The rest is just hardware to apply that to every column in your existing data frame, and turn the

Re: [R] apply on a 4D array

2003-09-25 Thread Thomas W Blackwell
Ben - I think you want something like new - array(prod(hiaAry, probAry[,,,1], probAry[,,,2], probAry[,,,3], probAry[,,,4]), dim(hiaAry)) But I'm just guessing. - tom blackwell - u michigan medical school - ann arbor - On Thu, 25 Sep 2003 [EMAIL PROTECTED] wrote: I am

Re: [R] empty postscript output of figures

2003-09-26 Thread Thomas W Blackwell
Andreas - help(postscript) says: Arguments: file: ... For use with 'onefile=FALSE' give a 'printf' format such as `Rplot%03d.ps' (the default in that case). The %03d will be replaced with a three digit number in the actual file name. This allows postscript() to generate a distinct file

Re: [R] performance question

2003-09-26 Thread Thomas W Blackwell
Axel - I believe that a function argument is not literally copied until the first time it is modified within the function. See email exchanges on this list from/to Ross Boylan within the month of September for a more authoritative answer to this question. (Do you know about the R-help archives

Re: [R] frustration with ave()

2003-09-28 Thread Thomas W Blackwell
Ed - You seem to have encountered a bug. I can reproduce Ed's difficulty in a completely artificial example in which there are unused levels : tmp - factor(rep(seq(10), seq(10))) # length(tmp) # [1] 55 ave(seq(50), tmp[-seq(5)]) # gives NA in rows 32-50 I would consider

Re: [R] frustration with ave()

2003-09-28 Thread Thomas W Blackwell
Maintainers - I should have said I am running R 1.7-1 on RedHat Linux 8.0. - tom blackwell - u michigan medical school - __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] Data frame transpose

2003-09-29 Thread Thomas W Blackwell
Dave - I'm not sure whether there is already a function which does exactly what you want, because this is kind of a special case. The functions I wold look at are: by, aggregate, tapply, mapply, and, in the package nlme one I didn't know about before called gapply. But, in your case, the part

Re: [R] subsetting a matrix

2003-09-30 Thread Thomas W Blackwell
Rajarshi - Why not simply subscript your matrix X to return the rows and columns you want to keep ? For example, new - X[16:176, c(3,5,7,9)] assuming those are the rows and columns you want. See help(Extract). - tom blackwell - u michigan medical school - ann arbor - On Tue, 30 Sep

Re: [R] multi-dimensional hash

2003-10-02 Thread Thomas W Blackwell
Arne - In the past, I've used a data frame for the lookup table and the and of individual logical vectors to select rows from it. Here's a simplified version of the selector function I wrote. My mail editor does not balance parentheses, so I don't guarantee that this version is syntactically

Re: [R] Query: weighting cells in histogram

2003-10-02 Thread Thomas W Blackwell
Marten - I don't know exactly what interpretation you have in mind for weights, but if you assign the value of hist() to a variable tmp, you can then assign the component tmp$counts any value you like, and plot the result as a histogram using plot(tmp). See the section Value: in

Re: [R] (no subject)

2003-10-04 Thread Thomas W Blackwell
Silika - By far the best reference for the nlme package is the book by its authors: J.C. Pinheiro and D.M. Bates. Mixed effects models in S and Splus. Springer, NY, 2000. ISBN (US) 0-387-989579. (There is a different, European, ISBN number but my library catalog doesn't give it.) This

Re: [R] Creating survival object

2003-10-05 Thread Thomas W Blackwell
Jens - After reading Help(Surv), yes, I think you have interpreted the two required arguments to Surv() correctly. I don't know of a ready-made function to do the transformation you illustrate. If I had to program it myself, I would use diff(), rep() and order(). - tom blackwell - u

Re: [R] Apply and its friends

2003-10-06 Thread Thomas W Blackwell
Crispin - This is a familiar problem. The only way I know of to do it is: result - lapply(seq(along=list.a), function(i,a,b) do.it(a[[i]], b[[i]]), list.a, list.b) Here, do.it() is the function which operates on two elements. I use this construction frequently. - tom blackwell - u

Re: [R] polynomial fit

2003-10-06 Thread Thomas W Blackwell
Karim - try function gam() in package mgcv. library(mgcv) help(gam) - tom blackwell - u michigan medical school - ann arbor - On Mon, 6 Oct 2003, Karim Elsawy wrote: I would like to fit a function H = F(x,y,z) but I do not know the analytical expression of H, is there a way to

Re: [R] prcomp or princomp

2003-10-06 Thread Thomas W Blackwell
Ann - Some useful references are given in the help for each function. Please DO READ the help. - tom blackwell - u michigan medical school - ann arbor - On Mon, 6 Oct 2003, Ann Devitt wrote: Hello, is there any documentation on doing principal components analysis with R besides the R

Re: [R] visualizing transition probability matrices

2003-10-06 Thread Thomas W Blackwell
On Mon, 6 Oct 2003, Tamas Papp wrote: I have a couple of (~200) 3x3 transition probability matrices (ie each defines a Markov chain). They are all estimated from the same underlying process, so it ie meaningful to take their elemetwise mean and standard deviation. [1] First question:

Re: [R] installation of R

2003-10-06 Thread Thomas W Blackwell
This is a question you should be able to answer from the R web site, www.r-project.org. - tom blackwell - u michigan medical school - ann arbor - On Mon, 6 Oct 2003, Stefanie Chau wrote: I wish to install R on my computer but I do not know how to do this. I have a Windows ME. Please

RE: [R] Problem getting an ifelse statment to work

2003-10-07 Thread Thomas W Blackwell
Greg - I am puzzled that the total counts in table(qs2) and table(qs9) could be different, if these are in fact two columns from the same data frame. I'm guessing that there are NAs in one or both columns, in addition to the digits 1,2,3,4, and that table() by default does not show them.

Re: [R] Trasparent graphs?

2003-10-14 Thread Thomas W Blackwell
Kenneth - Using base package graphics, use plot() on the first call, then either points() or lines() on subsequent calls to build up a single plot, layer by layer. Each call can use an argument col=... . However, the colors themselves are not transparent, AFAIK, so that where two symbols

Re: Fw: [R] SIMCA algorithm implementation

2003-10-15 Thread Thomas W Blackwell
Mike - For predicting class membership, I would use either lda() or qda() from the MASS package. See the Venables and Ripley book for detailed description of the methods. You'll have to rely on your own references for what the 'SIMCA' algorithm actually does. I've never heard of it. Sounds

Re: [R] nlm, hessian, and derivatives in obj function?

2003-10-18 Thread Thomas W Blackwell
Jeff - The function obj() which you define below is just a bit peculiar, since inside the function it assigns attributes to an object 'obj' with the same name as the *function* but which has not previously been defined inside the function. Is this really what you intended ? I'm not enough of

Re: [R] 2 D non-parametric density estimation

2003-10-22 Thread Thomas W Blackwell
John - My recollection is that Adrian Raftery's contributed package 'mclust' does kernel density estimation as well. Not sure whether it does what you need. Take a look at it on CRAN. Ah..I see that the description which shows up on Jon Baron's search page is not encouraging. Give it a try,

Re: [R] expanding factor with NA

2003-10-27 Thread Thomas W Blackwell
I would re-expand the model matrix by indexing its (nobs) rows with a longer vector (of length n) containing the correspondence. If there is only one term (say Z) in the formula which contains the problematic NAs, I would do (roughly) ff - Y ~ Z# following the example in

Re: [R] expanding factor with NA

2003-10-27 Thread Thomas W Blackwell
Perhaps a much simpler method (just thought of it) would be to set options(na.action=na.pass) before you start. Or use na.action=na.pass() as an argument in the call to model.frame(), since that's where the problem begins. See help(na.omit), help(model.frame). - tom blackwell - u

Re: [R] outer function problems

2003-10-28 Thread Thomas W Blackwell
Scott - I agree with Spencer Graves that there's a scoping issue here: Where does function Dk() pick up the values for n0 and w, and does it get them from the SAME place when it's called from inside FindLikelihood() as from outside ? But more important is this one: All arithmetic on

Re: [R] error message in simulation

2003-10-28 Thread Thomas W Blackwell
Yu-Kang - Simulations by their nature use randomly generated data. Sometimes the random data doesn't contain enough information to fully determine the parameter estimates for one iteration or another. It seems likely that that is what happened here. The design matrix is singular for one

Re: [R] constrained OLS on coefficient

2003-10-29 Thread Thomas W Blackwell
Use lm() or glm() with argument 'offset' set to the value of the column whose coefficient must be 1. See help(lm). - tom blackwell - u michigan medical school - ann arbor - On Wed, 29 Oct 2003, umeno wrote: Hi, I would like to know if anyone has any idea of how to run an OLS with

[R] cannot have a function argument named 'break'

2003-11-02 Thread Thomas W Blackwell
Dear list - I just discovered to my surprise that I cannot define a function with an argument named 'break' or 'while'! 'breaks' is okay. Maybe this is no surprise to the R developers. R-1.7.1, 2003-06-16, i686-pc-linux-gnu. - tom blackwell - u michigan medical school - ann arbor -

Re: [R] hclust doesn't return merge details

2003-11-03 Thread Thomas W Blackwell
Arne - I have carried out exactly your example below, and I get hc$merge as a matrix with two columns and 15 rows. Do str(hc) to see a useful representation of the contents of the returned list. help(hclust) describes this list in the section Value:. help(Subscript) shows the various

Re: AW: [R] R function help arranged in categorical order ?

2003-11-04 Thread Thomas W Blackwell
Neil - Maybe also the Function and variable index, pages 94-96, and the Concept index, pages 97-98 in An Introduction to R, cran.r-project.org/doc/manuals/R-intro.pdf. - tom blackwell - u michigan medical school - ann arbor - On Tue, 4 Nov 2003, RINNER Heinrich wrote: There is

Re: [R] How to define a function to be smooth?

2003-11-04 Thread Thomas W Blackwell
Is this a homework assignment ? - tom blackwell - u michigan medical school - ann arbor - On Tue, 4 Nov 2003, Feng Zhang wrote: Hey, R-listers When we say a function f(t) is smooth, does this mean that f has infinite differentials with respect to t? Or any other formal definition

Re: [R] read.spss Error reading system-file header

2003-11-04 Thread Thomas W Blackwell
Jake - The error message and warnign message shown below say something is wrong with this file's SPSS system-file header. If you are really able to open this one in SPSS, do so, change maybe a column name or row name or two, and save it again under a different file name. See if read.spss()

Re: [R] read.spss Error reading system-file header

2003-11-04 Thread Thomas W Blackwell
read.spss needs, though! Thanks again Jake On Tue, 4 Nov 2003, Thomas W Blackwell wrote: Jake - The error message and warnign message shown below say something is wrong with this file's SPSS system-file header. If you are really able to open this one in SPSS, do so, change maybe

Re: [R] Ignoring Errors in Simulations

2003-11-05 Thread Thomas W Blackwell
Ken - Either test each simulated data set explicitly for the condition which causes factanal() to fail (perhaps rank deficiency ?), or else use try(). Which is quicker, using try() or restarting your simulation from the beginning each time there's a failure ? - tom blackwell - u michigan

Re: [R] newbie's additional (probably to some extent OT) questions

2003-11-06 Thread Thomas W Blackwell
JB and Michael - I'm coming into this without having reviewed the earlier emails (if there are any) in this thread. But I will guess that the data come from a high school physics experiment on gravitational acceleration which drops a weight dragging a paper tape through a buzzer with a piece of

Re: [R] plot w/o axes [was: predict.lm with (logical) NA vector]

2003-11-10 Thread Thomas W Blackwell
Ann - Maybe you are looking for plot( ..., xlab=, ylab=) followed by title(xlab=the real x axis label) title(ylab=the real y axis label, mgp=c(2.5,0.5,0)) This is a construction that I use all, all, all the time. - tom blackwell - u michigan medical

Re: [R] boot package question: sampling on factor, not row

2003-11-10 Thread Thomas W Blackwell
Scott - The second argument to boot(), called 'statistic', can be any user-written function you want to cook up, with additional arguments being passed to it through the '...' mechanism after all of the named arguments. (See: `R-intro `Writing your own functions `The ellipsis argument for

Re: [R] relationship between two discrete variables

2003-11-10 Thread Thomas W Blackwell
Paul - This situation seems like an obvious candidate for a log-linear model. See the book MASS for details. They're beyond the scope of this list. Or try help.search(log-linear). (and ... can you find a way to break lines when sending your email ?) - tom blackwell - u michigan medical

Re: [R] Reading an upper triangular matrix

2003-11-10 Thread Thomas W Blackwell
Kjetil - Frankly, your file would be much, much easier to read if it didn't have a row name at the beginning of each line. Any chance you can edit it to remove those ? Then, I think you could read in the numeric data with just one call to scan: mat - matrix(0, 21, 21) mat[row(mat) =

Re: [R] boot package question: sampling on factor, not row

2003-11-11 Thread Thomas W Blackwell
On Mon, 10 Nov 2003, Thomas W Blackwell wrote: The second argument to boot(), called 'statistic', can be any user-written function you want to cook up, with additional arguments being passed to it through the '...' mechanism after all of the named arguments. (See: `R-intro `Writing

RE: [R] Memory issues..

2003-11-12 Thread Thomas W Blackwell
Jesper - (off-list) Jim MacDonald reports seeing different memory-management behavior between Windows and Linux operating systems on the same, dual boot machine. Unfortunately, this is happening at the operating system level, so the R code cannot do anything about it. I have cc'ed Jim on this

Re: [R] question about matrix

2003-11-12 Thread Thomas W Blackwell
Mikyoung - All answers are yes, but IMHO you are trying to be too clever with your data structure. Programming is *much* easier if you keep things simple. Specifically: (1) The function matrix() will happily build you a matrix of type list, with each element of the list occupying one cell

Re: [R] Vector indices and minus sign

2003-11-14 Thread Thomas W Blackwell
David - I had to try your example verbatim before I understood what is happening. index - numeric() creates a vector with no entries. Therefore the subscript is neither positive or negative, rather it contains no numeric values, so the return contains no entries either. Works the same in

Re: [R] gradient option in nlm function

2003-11-17 Thread Thomas W Blackwell
On Mon, 17 Nov 2003 [EMAIL PROTECTED] wrote: Dear list members, I am trying to use nlm function to maximize a mixture likelihood of beta densities. There are five unknown parameters in the likelihood. Since I can get the analytic gradient, I attach the gradient attribute in my target

Re: [R] sampling without repetition

2003-11-17 Thread Thomas W Blackwell
Rajarshi - Do you want three sets, three disjoint sets, or sets of size three ? It's not clear what you are attempting to do. - tom blackwell - u michigan medical school - ann arbor - On Mon, 17 Nov 2003, Rajarshi Guha wrote: Hi, I'm trying to write a function that will divide a

Re: [R] sampling without repetition

2003-11-17 Thread Thomas W Blackwell
). - tom blackwell - u michigan medical school - ann arbor - On Mon, 17 Nov 2003, Rajarshi Guha wrote: On Mon, 2003-11-17 at 20:01, Thomas W Blackwell wrote: Rajarshi - Do you want three sets, three disjoint sets, or sets of size three ? It's not clear what you are attempting to do

Re: [R] file not found?

2003-11-19 Thread Thomas W Blackwell
Kenneth - I recall a message on the [r-pkgs] list from Ray Brownrigg on November 1 this year that may be relevant. At that time he was announcing the availability of maps_2.0-8.zip and some other packages. Therefore, 2.0-10 must be *very* recent and might still be going through the CRAN

Re: [R] Problem with Trellis graphics in nlme

2003-11-20 Thread Thomas W Blackwell
Anthony - It seems just possible that the difficulty may have nothing to do with nlme() or any other data analysis. The graph you describe could result if one of the y-values was five time as large as any of the others. This could result from an error in reading the data input file, a missing

Re: [R] kruskal wallis for manova?

2003-11-21 Thread Thomas W Blackwell
Nicolaas - help.search(kruskal) returns: kruskal.test(ctest) Kruskal-Wallis Rank Sum Test This means that the function is kruskal.test() in the ctest package. In order to run it, you must do library(ctest) first. HTH - tom blackwell - u michigan medical school - ann arbor -

Re: [R] kruskal wallis for manova?

2003-11-21 Thread Thomas W Blackwell
. - tom blackwell - u michigan medical school - ann arbor - On Fri, 21 Nov 2003, Thomas W Blackwell wrote: Nicolaas - help.search(kruskal) returns: kruskal.test(ctest) Kruskal-Wallis Rank Sum Test This means that the function is kruskal.test() in the ctest package. In order

Re: [R] statistical prediction for glm()

2003-11-24 Thread Thomas W Blackwell
Martin - I can't figure out what question you are asking. Does either predict.glm() in the base package or cv.glm() in the boot package do what you want ? The theory for all of this is given in the references listed in the help pages for glm and cv.glm. - tom blackwell - u michigan

Re: [R] Vector Assignments

2003-12-01 Thread Thomas W Blackwell
Arend - Here is a sequence of commands which will do it. These first build a vector of (4+1) cutpoints, then cut() returns a factor whose labels are the colors and codes are determined by x. Last, as.character() turns the factor into the character vector which you ask for. Or, perhaps the

Re: [R] smoothing functions

2003-12-01 Thread Thomas W Blackwell
Eugene - Is the estimand in your problem (the parameter which you seek to estimate) discrete-valued or continuous-valued ? If it is discrete-valued, then you are heading in the wrong direction, because no matter how smooth you make the objective function, you will not be able to differentiate

Re: [R] Help with this topic

2003-12-01 Thread Thomas W Blackwell
Stephen - If the four columns shown below are in this order in a data frame named 'data', then use covariances - by(data[ ,-1], data$Class, cov) to get the covariance matrices within each of the four classes. Alternative functions would be tapply() or aggregate(), but the syntax for by()

Re: [R] reason for Factors -- was -- Vector Assignments

2003-12-03 Thread Thomas W Blackwell
On Wed, 3 Dec 2003, Arend P. van der Veen wrote: Your recommendations have worked great. I have found both cut and ifelse to be useful. I have one more question. When should I use factors over a character vector. I know that they have different uses. However, I am still trying to figure

Re: [R] non-uniqueness in cluster analysis

2003-12-03 Thread Thomas W Blackwell
Bruno - Many people add a tiny random number to each of the distances, or deliberately randomize the input order. This means that any clustering is not reproducible, unless you go back to the original randoms, but it forces you not to pay attention to minor differences. Ah, I think you're

Re: [R] histogram density division

2003-12-09 Thread Thomas W Blackwell
Mathieu - That's easy. Assign the return value of hist() to some variable, say fixed, then go in and hack the value of fixed$counts however you like, and re-plot using plot(fixed). Example code: fixed - hist(rnorm(2000)) fixed$counts - fixed$counts / 5 plot(fixed) I confess I didn't quite

Re: [R] Scatterplot axes

2003-12-10 Thread Thomas W Blackwell
Ellen - plot(my.x.vector, my.y.vector, xlim=c(-3,3), ylim=c(-3,3)) It's the named arguments xlim and ylim that you were looking for. I frequently set them as xlim = 3 * c(-1,1), ylim = 3 * c(-1,1) so that I can change the range by editing just one number rather than two. For an added fillip,

Re: [R] an eval/parse trivia

2003-12-10 Thread Thomas W Blackwell
Vincent - From the values shown, this looks like a Bioconductor question, rather than base R. You might try the maintainers of whatever package the function comes from. Is 2287 the index in levels for one of the character strings shown ? - tom blackwell - u michigan medical school - ann

Re: [R] CLEDITOR

2003-12-12 Thread Thomas W Blackwell
Stephen - If command line editing does not work as it should, I would look first into providing a patched readline. See Graeme Ambler's patched version in On Fri, 12 Dec 2003, Stephen Dicey wrote: How can I set up the CLEDITOR (command line) variable in R if there is one? I am on a Solaris

Re: [R] CLEDITOR

2003-12-12 Thread Thomas W Blackwell
(oops, wrong keystroke) ... in the unix source directories (at least for Redhat linux) on CRAN. - tom blackwell - u michigan medical school - ann arbor - On Fri, 12 Dec 2003, Stephen Dicey wrote: How can I set up the CLEDITOR (command line) variable in R if there is one? I am on a

Re: [R] NUMERIC DERIVATE

2003-12-17 Thread Thomas W Blackwell
On Wed, 17 Dec 2003, Savano S. Pereira wrote: UseRs, I used the optim function valor.optim - optim(c(1,1,1),logexp1,method =BFGS,control=list(fnscale=-1),hessian=T); and I want to calculate the derivates, [ ... snip ... ] but I found, [ ... snip ... ] The derivates are zero. Why?

Re: [R] number plot symbol in scatterplot?

2003-01-03 Thread Thomas W Blackwell
Bill - The behavior of the old-S function printer() was to count overstrikes in the way you describe. This was a non-graphics output device which would make a crude scatterplot using ascii characters (spaces and asterisks, for example) in response to plot() commands. I've looked for printer

  1   2   >