Re: [R] Neural Nets (nnet) - evaluating success rate of predictions

2007-05-08 Thread hadley wickham
On 5/7/07, Bert Gunter [EMAIL PROTECTED] wrote: Folks: If I understand correctly, the following may be pertinent. Note that the procedure: min.nnet = nnet[k] such that error rate of nnet[k] = min[i] {error rate(nnet(training data) from ith random start) } does not guarantee a classifier

Re: [R] creating a new column

2007-05-08 Thread Schmitt, Corinna
Hallo, I just now a solution for da data frame. I'm not sure if this is what you want. Just try if it helps. Here an example of my code where I added a column: df - rbind( c(fred,mary,4),c(fred,mary,7), c(fred,mary,9),c(barney,liz,3), c(barney,liz,5)) df -

Re: [R] Bad optimization solution

2007-05-08 Thread Paul Smith
It seems that there is here a problem of reliability, as one never knows whether the solution provided by R is correct or not. In the case that I reported, it is fairly simple to see that the solution provided by R (without any warning!) is incorrect, but, in general, that is not so simple and one

[R] [R-pkgs] package ltm -- version 0.8-0

2007-05-08 Thread Dimitris Rizopoulos
Dear R-users, I'd like to announce the release of the new version of package `ltm' (i.e., ltm_0.8-0 soon available from CRAN) for Item Response Theory analyses. This package provides a flexible framework for analyzing dichotomous and polytomous data under IRT, including the Rasch model, the

[R] Weighted least squares

2007-05-08 Thread hadley wickham
Dear all, I'm struggling with weighted least squares, where something that I had assumed to be true appears not to be the case. Take the following data set as an example: df - data.frame(x = runif(100, 0, 100)) df$y - df$x + 1 + rnorm(100, sd=15) I had expected that: summary(lm(y ~ x,

Re: [R] Representing a statistic as a colour on a 2d plot

2007-05-08 Thread Jim Lemon
mister_bluesman wrote: Hello. I have a 2d plot which looks like this: http://www.nabble.com/file/8242/1.JPG This plot is derived from a file that holds statistics about each point on the plot and looks like this: abc d e a

[R] How do i calculate emp Returns

2007-05-08 Thread Soare Marcian-Alin
Hello, I want to build empirical Returns of stockfonds, but I cant find a function in R, which calculate this. Alin [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] creating a new column

2007-05-08 Thread Schmitt, Corinna
Hallo, I just tried, if my solution might be possible for you. Here is the result: s=2 while(s!=0){ n=20 + m-matrix(nrow=n,ncol=4) + colnames(m)=c(treatmentgrp,strata,censoringTime,survivalTime) + for(i in 1:20)

[R] trouble with help

2007-05-08 Thread Schmitt, Corinna
Hallo, I just updated to the new version of R by installing everything new. Now I have a problem with the help command: help.start() updating HTML package listing updating HTML search index If nothing happens, you should open 'Z:\Software\R\R-2.5.0\doc\html\index.html' yourself The browser was

[R] Piecewise cubic Hermite interpolation

2007-05-08 Thread Vladimir Eremeev
Which function implements the piecewise cubic Hermite interpolation? I am looking for equivalent of matlab's interp1 with the method = 'pchip' Here is the reference http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/interp1.html; -- View this

[R] sample() and memory usage

2007-05-08 Thread Victor Gravenholt
As a part of a simulation, I need to sample from a large vector repeatedly. For some reason sample() builds up the memory usage ( 500 MB for this example) when used inside a for loop as illustrated here: X - 1:10 P - runif(10) for(i in 1:500) Xsamp - sample(X,3,replace=TRUE,prob=P)

Re: [R] creating a new column

2007-05-08 Thread Schmitt, Corinna
Hallo, if you work with matrix you can use cbind to add columns. Corinna -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von raymond chiruka Gesendet: Montag, 7. Mai 2007 16:28 An: r Betreff: [R] creating a new column hie l would like to

Re: [R] trouble with help

2007-05-08 Thread Vladimir Eremeev
Did you try manually opening the file mentioned in the browser (Z:\Software\R\R-2.5.0\doc\html\index.html) ? Does this file exist? Was the html help installed? Schmitt, Corinna wrote: Hallo, I just updated to the new version of R by installing everything new. Now I have a problem with

Re: [R] Bad optimization solution

2007-05-08 Thread Jasjeet Singh Sekhon
The issue is that you are using a derivative based optimizer for a problem for which it is well known that such optimizers will not perform well. You should consider using a global optimizer. For example, rgenoud combines a genetic search algorithm with a BFGS optimizer and it works well for

[R] sample() and memory usage

2007-05-08 Thread Victor Gravenholt
As a part of a simulation, I need to sample from a large vector repeatedly. For some reason sample() builds up the memory usage ( 500 MB for this example) when used inside a for loop as illustrated here: X - 1:10 P - runif(10) for(i in 1:500) Xsamp - sample(X,3,replace=TRUE,prob=P)

Re: [R] trouble with help

2007-05-08 Thread Schmitt, Corinna
How can I install the html help? Corinna .de http://www.igb.fraunhofer.de -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Vladimir Eremeev Gesendet: Dienstag, 8. Mai 2007 12:22 An: r-help@stat.math.ethz.ch Betreff: Re: [R] trouble with

Re: [R] trouble with help

2007-05-08 Thread Vladimir Eremeev
You should select it in the list of components to install, when the installer asks. It happens after you 3rd time press Next in the installation wizard window. Choose Custom installation and select all you need. Schmitt, Corinna wrote: How can I install the html help? Corinna

Re: [R] trouble with help

2007-05-08 Thread Schmitt, Corinna
Hallo, I found the solution. I installed everything new and in the setup I choose Changing Startoptions and there I could mark html help. It now works, Corinna -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Schmitt, Corinna Gesendet:

Re: [R] Neural Nets (nnet) - evaluating success rate of predictions

2007-05-08 Thread Antti Arppe
Nathaniel, On Mon, 7 May 2007, [EMAIL PROTECTED] wrote: Date: Sun, 6 May 2007 12:02:31 + (GMT) From: nathaniel Grey [EMAIL PROTECTED] However what I really want to know is how well my nueral net is doing at classifying my binary output variable. I am new to R and I can't figure out how

[R] minimum from matrix

2007-05-08 Thread oarabile
I have a very large matrix with columns that have some of their entries as zero A small example if a= [,1] [,2] [,3] [,4] [,1] 0 2 0 0 [,2] 1 3 0 3 [,3] 2 0 3 5 [,4] 0 4 0 0 and what to get the minimum number

Re: [R] minimum from matrix

2007-05-08 Thread Gabor Csardi
apply(a, 2, function(x) min(x[x!=0]) ) should do it. Might need some improvement if all numbers in a column can be zero, try it. Gabor On Tue, May 08, 2007 at 09:50:43AM +0100, [EMAIL PROTECTED] wrote: I have a very large matrix with columns that have some of their entries as zero A

[R] [R-pkgs] irtoys

2007-05-08 Thread Ivailo Partchev
I have just submitted irtoys_0.1.0, a package potentially useful for those working with IRT models. It can fit the 1PL, 2PL, and 3PL models through a simple and unified syntax, using either the R package ltm, Brad Hanson's ICL program, or the commercially available BILOG-MG. The purpose is

Re: [R] minimum from matrix

2007-05-08 Thread Dimitris Rizopoulos
try this: apply(a, 2, function(x) min(x[x 0])) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web:

Re: [R] Weighted least squares

2007-05-08 Thread Adaikalavan Ramasamy
See below. hadley wickham wrote: Dear all, I'm struggling with weighted least squares, where something that I had assumed to be true appears not to be the case. Take the following data set as an example: df - data.frame(x = runif(100, 0, 100)) df$y - df$x + 1 + rnorm(100, sd=15) I

[R] sample function and memory usage

2007-05-08 Thread Victor Gravenholt
As a part of a simulation, I need to sample from a large vector repeatedly. For some reason sample() builds up the memory usage ( 500 MB for this example) when used inside a for loop as illustrated here: X - 1:10 P - runif(10) for(i in 1:500) Xsamp - sample(X,3,replace=TRUE,prob=P)

Re: [R] Weighted least squares

2007-05-08 Thread hadley wickham
On 5/8/07, Adaikalavan Ramasamy [EMAIL PROTECTED] wrote: See below. hadley wickham wrote: Dear all, I'm struggling with weighted least squares, where something that I had assumed to be true appears not to be the case. Take the following data set as an example: df - data.frame(x =

Re: [R] minimum from matrix

2007-05-08 Thread Schmitt, Corinna
Hallo, I added one row: a=rbind(a,1:4) a [,1] [,2] [,3] [,4] [1,]0120 [2,]2304 [3,]0030 [4,]0350 [5,]1234 And how looks like the command for the minimum of the rows? The result should be minOfRows = 0 0 0 0

Re: [R] minimum from matrix

2007-05-08 Thread Gabor Csardi
Corinna, what is going on here? I've answered Oarabile's question, and then you reply to me with this. I'm completely lost. 1. What is your question? Minimum of every row? This was written in the original mail along with Oarabile's question. Ok it wasn't rows but columns. For rows it

Re: [R] A function for raising a matrix to a power?

2007-05-08 Thread Paul Gilbert
Ravi Varadhan wrote: Paul, Your solution based on SVD does not work Ooops. I really am getting rusty. The idea is based on eigenvalues which, of course, are not always the same as singular values. Paul even for the matrix in your example (the reason it worked for e=3, was that it is an

[R] minimum of each row in a matrix

2007-05-08 Thread Schmitt, Corinna
Hallo, I just followed the discussion of the title: minimum from matrix. I have a similar problem. a=matrix(c(0,2, 0, 0, 1, 3, 0, 3, 2, 0, 3, 5, 0, 4, 0, 0),ncol=4) a=rbind(a,1:4) a [,1] [,2] [,3] [,4] [1,]0120 [2,]2304 [3,]0030 [4,]0

Re: [R] minimum of each row in a matrix

2007-05-08 Thread Sarah Goslee
Check out the help for apply, particularly the MARGIN argument: minOfRows=apply(a, 1, function(x) min(x[x!=0]) ) maxOfRows=apply(a, 1, function(x) max(x) ) Sarah On 5/8/07, Schmitt, Corinna [EMAIL PROTECTED] wrote: Hallo, I just followed the discussion of the title: minimum from matrix. I

Re: [R] minimum of each row in a matrix

2007-05-08 Thread Vladimir Eremeev
Looks like you are reading manuals and these mailings insufficiently carefully. ?apply says that if its second argument is 1, it gives you what you want. Gabor Csardi has also written you this. If you have several vectors, not a single matrix, you can use pmin:

Re: [R] minimum of each row in a matrix

2007-05-08 Thread Gabor Csardi
Corinna, what about reading my previous mail, which you suggested to forget? Gabor ps. it is apply(a, 1, min) On Tue, May 08, 2007 at 03:21:26PM +0200, Schmitt, Corinna wrote: Hallo, I just followed the discussion of the title: minimum from matrix. I have a similar problem.

[R] plots - scatterplots - find index of a point in a list

2007-05-08 Thread gatemaze
Hi, is it possible to find the index of a point of a plot (e.g. scatterplot) in an easy way? Eg. x - c(1:5); y - c(1:5); plot(x, y); On the plot if I move my cursor on top of a point or click on it is it possible to have its index printed or its exact value? Any clues? Thanks.

Re: [R] minimum of each row in a matrix

2007-05-08 Thread Schmitt, Corinna
Hi Peter, thanks for the quick help. Yes it does what I want. Thanks, Corinna Von: Peter Konings [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 8. Mai 2007 15:29 An: Schmitt, Corinna Betreff: Re: [R] minimum of each row in a matrix Hi Corinna, does

[R] plot time series

2007-05-08 Thread jessica . gervais
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] plots - scatterplots - find index of a point in a list

2007-05-08 Thread John Kane
Try ?locator --- [EMAIL PROTECTED] wrote: Hi, is it possible to find the index of a point of a plot (e.g. scatterplot) in an easy way? Eg. x - c(1:5); y - c(1:5); plot(x, y); On the plot if I move my cursor on top of a point or click on it is it possible to have its index printed

Re: [R] plot time series

2007-05-08 Thread Roland Rau
Hi Jessica [EMAIL PROTECTED] wrote: __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] Weighted least squares

2007-05-08 Thread Adaikalavan Ramasamy
Sorry, you did not explain that your weights correspond to your frequency in the original post. I assumed they were repeated measurements with within group variation. I was merely responding to your query why the following differed. summary(lm(y ~ x, data=df, weights=rep(2, 100)))

Re: [R] getting informative error messages

2007-05-08 Thread Spencer Graves
Hi, Tony: Are you familiar with the 'debug' command? I agree that more informative error messages and 'traceback' would be nice, but I've found the 'debug' facility quite useful. [I even sometimes prepare a shell of a function 'fn', then say debug(fn) and fn(), and complete writing

Re: [R] Bad optimization solution

2007-05-08 Thread RAVI VARADHAN
Paul, The problem lies neither with R nor with numercial methods. The onus is always on the user to understand what the numerical schemes can do and what they can't do. One should never blindly take the results given by a numerical scheme and run with it. In your example, the optimization

[R] strange behavior in data frames with duplicated column names

2007-05-08 Thread William Revelle
Dear R gurus, There is an interesting problem with accessing specific items in a column of data frame that has incorrectly been given a duplicate name, even though addressing the item by row and column number. Although the column is correctly listed, an item addressed by row and column number

[R] Looking for a comprehensive descriptive statistics package

2007-05-08 Thread David Kaplan
Hi all, I'm looking for a package that will give me comprehensive set of descriptive statistics, including skew and kurtosis. Also, is there a similar package that will provide multivariate descriptive statistics as well? Thanks in advance, David --

Re: [R] Weighted least squares

2007-05-08 Thread John Fox
Dear Hadley, I think that the problem is that the term weights has different meanings, which, although they are related, are not quite the same. The weights used by lm() are (inverse-)variance weights, reflecting the variances of the errors, with observations that have low-variance errors

Re: [R] plots - scatterplots - find index of a point in a list

2007-05-08 Thread gatemaze
On 08/05/07, John Kane [EMAIL PROTECTED] wrote: Try ?locator Thanks. Your tip also lead to another function: ?identify to add my two cents. --- [EMAIL PROTECTED] wrote: Hi, is it possible to find the index of a point of a plot (e.g. scatterplot) in an easy way? Eg. x -

Re: [R] Bad optimization solution

2007-05-08 Thread S Ellison
Paul, You have picked a function that is not smoothly differentiable and also started at one of many 'stationary' points in a system with multiple solutions. In practice, I think it'll get a zero gradient as the algorithm does things numerically and you have a symmetric function. It probably

Re: [R] Bad optimization solution

2007-05-08 Thread Paul Smith
Thanks, Ravi, for your clear explanation! Paul On 5/8/07, RAVI VARADHAN [EMAIL PROTECTED] wrote: Paul, The problem lies neither with R nor with numercial methods. The onus is always on the user to understand what the numerical schemes can do and what they can't do. One should never

Re: [R] Weighted least squares

2007-05-08 Thread S Ellison
Doubling the length of the data doubles the apparent number of observations. You would expect the standard error to reduce by sqrt(2) (which it just about does, though I'm not clear on why its not exact here) Weights are not as simple as they look. You have given all your data the same weight,

Re: [R] getting informative error messages

2007-05-08 Thread Prof Brian Ripley
It is not clear to me what you want here. Errors are tagged by a 'call', and f(1:3) is the innermost 'call' (special primitives do not set a context and so do not count if you consider '[' to be a function). The message could tell you what the type was, but it does not and we have lost the

[R] The match of ave() for FUN=SD

2007-05-08 Thread Felix Wave
Hello, I have many subsets of x. I want to get the standard deviation for each subset with the same factor levels. For FUN=mean and FUN=median I am using ave(). Can anybody tell me the match of ave() for using FUN=SD? At the beginning I used aggregate(), also for mean and median. But

[R] Question on bivariate GEE fit

2007-05-08 Thread souvik banerjee
Hi, I have a bivariate longitudinal dataset. As an example say, i have the data frame with column names var1 var2 Unit time trt (trt represents the treatment) Now suppose I want to fit a joint model of the form for the *i* th unit var1jk = alpha1 + beta1*timejk + gamma1* trtjk +

Re: [R] plot time series

2007-05-08 Thread jessica . gervais
Dear All, I sended my first mail as HTML by accident. It has probably been stripped off... (see first mail below) During that time, I was actually able to find a solution to my problem : I wanted to plot times on a graph representing precipitation=f(time) here is an example: time-c(2004-10-18

[R] Help with systemfit

2007-05-08 Thread adschai
Hi - I encounter two problems with SystemFit. I have a matrix of 20 variables (38 observations each). I am trying to fit using 2SLS in Systemfit because I want to be able to simulate new observations with the resulting model. The first problem I found is that it ran out of memory given that I

Re: [R] minimum from matrix

2007-05-08 Thread Oarabile Molaodi
Thanks it worked. Oarabile Gabor Csardi wrote: apply(a, 2, function(x) min(x[x!=0]) ) should do it. Might need some improvement if all numbers in a column can be zero, try it. Gabor On Tue, May 08, 2007 at 09:50:43AM +0100, [EMAIL PROTECTED] wrote: I have a very large matrix with columns

Re: [R] minimum from matrix

2007-05-08 Thread Oarabile Molaodi
Thanks it worked Oarabile Dimitris Rizopoulos wrote: try this: apply(a, 2, function(x) min(x[x 0])) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35,

[R] help with memory problem in SystemFit

2007-05-08 Thread adschai
Hi - I encounter two problems with SystemFit. I have a matrix of 20 variables (38 observations each). I am trying to fit using 2SLS in Systemfit because I want to be able to simulate new observations with the resulting model. The first problem I found is that it ran out of memory given that

Re: [R] ordered logistic regression with random effects. Howto?

2007-05-08 Thread Cody_Hamilton
Paul, I believe the model you describe below can be fitted in GENMOD and GLIMMIX in SAS. Alternatively, as Brian Ripley suggests, you could use MCMC. BUGS has a nice example of a multinomial logit model in the second example manual. While this example considers only fixed effects, it's not

Re: [R] creating a new column

2007-05-08 Thread raymond chiruka
thanks for the help But l ened up using act.surv.time-pmin(m[,censoringTime],m[,survivalTime]) m-cbind(m,act.surv.time) which seems to work thanks Schmitt, Corinna [EMAIL PROTECTED] wrote: Hallo, I just tried, if my solution might be possible for you. Here is the result: s=2

Re: [R] plot time series

2007-05-08 Thread jessica . gervais
Dear all, I actually would like to improve the label orientation on the x-axis (turn them to 45 degrees) I tried the par(las=2) ... but doesn't work... Do anyone knows how to do ? Jessica __ R-help@stat.math.ethz.ch mailing list

Re: [R] Weighted least squares

2007-05-08 Thread S Ellison
Hadley, You asked .. what is the usual way to do a linear regression when you have aggregated data? Least squares generally uses inverse variance weighting. For aggregated data fitted as mean values, you just need the variances for the _means_. So if you have individual means x_i and sd's

[R] statistics/correlation question NOT R question

2007-05-08 Thread Leeds, Mark \(IED\)
This is not an R question but if anyone can help me, it's much appreciated. Suppose I have a series ( stationary ) y_t and a series x_t ( stationary )and x_t has variance sigma^2_x and epsilon is normal (0, sigma^2_epsilon ) and the two series have the relation

Re: [R] getting informative error messages

2007-05-08 Thread Spencer Graves
Dear Prof. Ripley: 1. I very much appreciate your contributions to the R project. 2. Whether with release 2.4.0 or earlier, I noticed that 'traceback()' had become less informative. This loss was more than offset when I learned to use the 'debug' function in the 'base'

[R] censoring

2007-05-08 Thread raymond chiruka
in R when carring out the log rank test is the censored variable denoted by 1 or 0 or its of no consequence. thanks - always stay connected to friends. [[alternative HTML version deleted]] __

Re: [R] strange behavior in data frames with duplicated column names

2007-05-08 Thread Prof Brian Ripley
First, you should not be using colnames-, which is for a matrix, on a data frame. Use names- for data frames (and as.data.frame to convert to a data frame). Second, whereas duplicate row names are not allowed in a data frame, duplicate column names are but at your own risk. Third, there is a

Re: [R] statistics/correlation question NOT R question

2007-05-08 Thread Horace Tso
Mark, I suppose you make the usual assumptions, ie. E[x]=0, E[x*epsilon]=0, the correlation is just simply, corr(x,y) = beta * ( var(x) / var(y) ) And you could get var(y) from var(x) and var(epsilon). HTH. Horace Leeds, Mark (IED) [EMAIL PROTECTED] 5/8/2007 10:25:11 AM This is not an R

Re: [R] censoring

2007-05-08 Thread Roland Rau
Well, I guess it makes quite a difference in survival analysis whether you know that a person was alive/censored or experienced the event of interest at a certain point of time/age. You could have tried it easily for yourself by slightly modifying the example on the help page of 'survdiff'.

Re: [R] Looking for a comprehensive descriptive statistics package

2007-05-08 Thread Roland Rau
Hi, summary(yourdata) is often a very good starting point for descriptive data statistics. Or you can write your own little function which returns what you actually like to see (the code below was written very quickly. No care is taken for the presence of missing values or anything else).

Re: [R] creating a new column

2007-05-08 Thread Bos, Roger
I haven't been following your discussion, but based on your method, the following should also work and would be the one-line equivalent: m$act.surv.time-pmin(m[,censoringTime],m[,survivalTime]) In other words, you can add a column by just assigning a value to a new column name. You can also

[R] Separate x-axis ticks for panels in xyplot()?

2007-05-08 Thread Michael Kubovy
Dear r-helpers, In an xyplot I have xyplot(y ~ x | c, groups = g, scales = list( x = list( at = v1, labels = c('A', 'B', 'C', 'D'), rot = 45 ) ) ) g consists of two groups.

Re: [R] Representing a statistic as a colour on a 2d plot

2007-05-08 Thread mister_bluesman
Thanks people! Sorry to sound thick but after I download the poltrix package, how do i install it? Thank you! -- View this message in context: http://www.nabble.com/Representing-a-statistic-as-a-colour-on-a-2d-plot-tf3703885.html#a10383035 Sent from the R help mailing list archive at

Re: [R] plot time series

2007-05-08 Thread John Kane
The short answer is that you can't. The longer answer is that you need to replace them with text. Have a look at the FAQ 7.27 How can I create rotated axis labels? It provides a pretty good example. --- [EMAIL PROTECTED] wrote: Dear all, I actually would like to improve the label

Re: [R] Representing a statistic as a colour on a 2d plot

2007-05-08 Thread John Kane
How did you download it? In Windows if you used the Packages Install packages route it is installed. Just type library(plotrix) to load it. No idea for Linux or Mac. --- mister_bluesman [EMAIL PROTECTED] wrote: Thanks people! Sorry to sound thick but after I download the poltrix package,

Re: [R] Representing a statistic as a colour on a 2d plot

2007-05-08 Thread Roland Rau
mister_bluesman wrote: Thanks people! Sorry to sound thick but after I download the poltrix package, how do i install it? Thank you! which platform are you on? On Windows I would suggest you use the Menu of the GUI Install packages from local zip files in the main category 'packages' On

Re: [R] Representing a statistic as a colour on a 2d plot

2007-05-08 Thread mister_bluesman
Thanks for you all your help guys. Much appreciated. -- View this message in context: http://www.nabble.com/Representing-a-statistic-as-a-colour-on-a-2d-plot-tf3703885.html#a10383998 Sent from the R help mailing list archive at Nabble.com. __

[R] Looking for a cleaner way to implement a setting certain indices of a matrix to 1 function

2007-05-08 Thread Leeds, Mark \(IED\)
I wrote an ugly algorithm to set certain elements of a matrix to 1 without looping and below works and you can see what The output is below the code. K-6 lagnum-2 restrictmat-matrix(0,nrow=K,ncol=K*3) restrictmat[((col(restrictmat) - row(restrictmat) = 0 ) (col(restrictmat)-row(restrictmat)) %%

[R] Skipping rows and columns in large matrix

2007-05-08 Thread Silvia Lomascolo
I work on Windows, R version 2.4.1 I need to leave out many rows and columns when reading a matrix. The 'skip' commands in read.table, seem to be just for skipping rows, if I understand well, but I need to skip many columns as well. I tried something very simple and left one row and one column

Re: [R] Looking for a cleaner way to implement a setting certainindices of a matrix to 1 function

2007-05-08 Thread Bert Gunter
Suggestion: You might make it easier for folks to help if you explained in clear and simple terms what you are trying to do. Code is hard to deconstruct. Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

[R] Mantel-Haenszel relative risk with Greenland-Robins variance estimate

2007-05-08 Thread Frank E Harrell Jr
Does anyone know of an R function for computing the Greenland-Robins variance for Mantel-Haenszel relative risks? Thanks Frank -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University

Re: [R] to draw a smooth arc

2007-05-08 Thread Paulo Barata
Prof. Ripley, Maybe the fact that few R plot regions have a 1:1 aspect ratio is not a major problem here. One has to deal with the same issue when drawing a circle parametrically. Depending on the window size, a (cos(t),sin(t)) plot appears as an ellipse. To get a circle parametrically, one has

Re: [R] Looking for a cleaner way to implement a setting certainindices of a matrix to 1 function

2007-05-08 Thread Leeds, Mark \(IED\)
That's a good idea : I didn't realize that my matrices would look so bad in the final email. All I want To do is output 1's in the diagonal elements and zero's everywhere else but the matrix is not square so by diagonals I Really mean if Lagnum = 1 then the elements are (1,1), (2,2),

Re: [R] Skipping rows and columns in large matrix

2007-05-08 Thread jim holtman
zzz - zzz[-c(1,45,23,321), -c(23,34,45,67)] On 5/8/07, Silvia Lomascolo [EMAIL PROTECTED] wrote: I work on Windows, R version 2.4.1 I need to leave out many rows and columns when reading a matrix. The 'skip' commands in read.table, seem to be just for skipping rows, if I understand well,

Re: [R] Looking for a cleaner way to implement a setting certain indices of a matrix to 1 function

2007-05-08 Thread Anders Nielsen
Hi Mark, Is this of any help? resMat-function(K=6,lag=2,ncol=3*K){ X-matrix(0,K,ncol) X[,1:(K*lag)]-diag(K) return(X) } Cheers, Anders. On Tuesday 08 May 2007 11:21 am, Leeds, Mark (IED) wrote: I wrote an ugly algorithm to set certain elements of a matrix to 1 without

Re: [R] Looking for a cleaner way to implement a setting certainindices of a matrix to 1 function

2007-05-08 Thread jim holtman
Is this what you want? n - 6 lagnum - 2 result - NULL for (i in 1:lagnum) result - cbind(result, diag(n)) result [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,]100000100 0 0 0 [2,]0100000

Re: [R] Mantel-Haenszel relative risk with Greenland-Robins variance estimate

2007-05-08 Thread Cody_Hamilton
Would this function help: http://www.csm.ornl.gov/~frome/ES/RRMHex/MHanalysis.txt ? Regards, -Cody Frank E Harrell Jr

[R] plotting a point graph with data in X-axis

2007-05-08 Thread Milton Cezar Ribeiro
Dear all, I have two data frame, on with a complete list of my field survey with frequency data of a sample species. This data frame looks like: simulation-data.frame(cbind(my.year=c(rep(2000,8),rep(2001,12),rep(2002,12)),my.month=c(5:12,1:12,1:12)))

Re: [R] Looking for a cleaner way to implement a setting certain indices of a matrix to 1 function

2007-05-08 Thread Leeds, Mark \(IED\)
thanks anders : that works perfectly. I'll have to study it better to understand but it's much appreciated. -Original Message- From: Anders Nielsen [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 5:55 PM To: Leeds, Mark (IED) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Looking

Re: [R] Mantel-Haenszel relative risk with Greenland-Robins variance estimate

2007-05-08 Thread Frank E Harrell Jr
[EMAIL PROTECTED] wrote: Would this function help: http://www.csm.ornl.gov/~frome/ES/RRMHex/MHanalysis.txt ? Regards, -Cody I think so. Thank you Cody. If you have time would you mind defining, probably offline, the input data elements? I assume that one of them is a stratification

Re: [R] Skipping rows and columns in large matrix

2007-05-08 Thread Silvia Lomascolo
yes, this works. It didn't think of concatenating... thanks! jim holtman wrote: zzz - zzz[-c(1,45,23,321), -c(23,34,45,67)] On 5/8/07, Silvia Lomascolo [EMAIL PROTECTED] wrote: I work on Windows, R version 2.4.1 I need to leave out many rows and columns when reading a matrix. The

[R] draw two plots on a single panel

2007-05-08 Thread Patrick Wang
Hi, I have 2 dataset, plot(data1) plot(data2), but it comes as two graphs, can I draw both on a single panel so I can compare them? Thanks Pat __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] draw two plots on a single panel

2007-05-08 Thread Gabor Csardi
See ?points and ?lines for a simple solution. Eg: plot(data1) points(data2) if mean this by 'panel'. Gabor On Tue, May 08, 2007 at 04:49:47PM -0700, Patrick Wang wrote: Hi, I have 2 dataset, plot(data1) plot(data2), but it comes as two graphs, can I draw both on a single panel so I

Re: [R] plotting a point graph with data in X-axis

2007-05-08 Thread jim holtman
You have to have a valid 'date' object on the x-axis. Try this: simulation-data.frame(cbind(my.year=c(rep(2000,8),rep(2001,12),rep(2002,12)),my.month=c(5:12,1:12,1:12)))

Re: [R] Weighted least squares

2007-05-08 Thread Adaikalavan Ramasamy
http://en.wikipedia.org/wiki/Weighted_least_squares gives a formulaic description of what you have said. I believe the original poster has converted something like this y x 0 1.1 0 2.2 0 2.2 0 2.2 1 3.3

Re: [R] plotting a point graph with data in X-axis

2007-05-08 Thread Gabor Grothendieck
- use proper spacing to make it easier to read - start off with set.seed to make it reproducible - omit cbind and combine all the rep's into one rep in first line - make the date column a known date class (here Date), set.seed(1) sim - data.frame( my.year = rep(2000:2002, c(8, 12, 12)),

Re: [R] Skipping rows and columns in large matrix

2007-05-08 Thread Gabor Grothendieck
Columns that correspond to NULLs in the colClasses arg of read.table are ignored. ?read.table On 5/8/07, Silvia Lomascolo [EMAIL PROTECTED] wrote: I work on Windows, R version 2.4.1 I need to leave out many rows and columns when reading a matrix. The 'skip' commands in read.table, seem to

Re: [R] plotting a point graph with data in X-axis

2007-05-08 Thread Adaikalavan Ramasamy
R understands only numerical and Date class values for axis. So either a) plot them using the sequence 1, ..., 32 and then explicitly label them. Here is an example: n - length(year.month) plot( 1:n, freq, xaxt=n) mtext( text=year.month, side=1, at=1:n, las=2 ) b) or create the dates

Re: [R] Looking for a cleaner way to implement a setting certainindices of a matrix to 1 function

2007-05-08 Thread Gabor Grothendieck
Try this: kronecker(t(rep(1:0, c(lagnum, 3-lagnum))), diag(K)) On 5/8/07, Leeds, Mark (IED) [EMAIL PROTECTED] wrote: That's a good idea : I didn't realize that my matrices would look so bad in the final email. All I want To do is output 1's in the diagonal elements and zero's everywhere else

Re: [R] plotting a point graph with data in X-axis

2007-05-08 Thread Gabor Grothendieck
One other idea. If your dates are continguous, as they are here, you might want to use a ts series for this. Using the same sim as in my prior post: set.seed(1) x - with(sim, ts(freq, start = c(my.year[1], my.month[1]), freq = 12)) x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 2000

Re: [R] Separate x-axis ticks for panels in xyplot()?

2007-05-08 Thread Richard M. Heiberger
This will get you started. Rich tmp - data.frame(y=rnorm(20), x=rnorm(20), c=factor(rep(letters[1:5], 4)), g=factor(rep(1:2, each=10))) v1 - seq(-1.5, 0, .5) v2 - 0:2 xyplot(y ~ x | c, groups = g, data=tmp, scales = list(x = list(

[R] voronoi.mosaic chokes?

2007-05-08 Thread Andrew Pierce
Hi all, I am running R 2.5.0 under Windows XP Media Center Edition. Here's a problem that's been stumping me for a few days now, and I can't find anything useful in the archives. I am using voronoi.mosaic (tripack package) to create proximity polygons for a study of vegetation competition

Re: [R] voronoi.mosaic chokes?

2007-05-08 Thread Christos Hatzis
Have you tried 'debug'? With one of the datasets that crashes your system, run the first voronoi.mosaic, then the torus function and then debug(voronoi.mosaic) and run through the second call of voronoi.mosaic. You can step though the code and at least will you find the point where it bombs.

  1   2   >