Re: [R] Histogram problem

2009-08-21 Thread Petr PIKAL
Hi R does what you said to it it shall do! Without **reproducible** code and explanation what you did, what you get and what you **expect** to get it would be quite complicated task to understand what your code actually do. e.g. this for (i in 1:Count){ for (j in 1:Count2){

Re: [R] Principle components analysis on a large dataset

2009-08-21 Thread Jari Oksanen
Moshe Olshansky m_olshansky at yahoo.com writes: Hi Misha, Since PCA is a linear procedure and you have only 6000 observations, you do not need 68000 variables. Using any 6000 of your variables so that the resulting 6000x6000 matrix is non-singular will do. You can choose these 6000

Re: [R] a --no-save option for Rprofile.site?

2009-08-21 Thread Barry Rowlingson
On Fri, Aug 21, 2009 at 4:33 AM, Scott Hydehy...@byuh.edu wrote: I've found that I can use --no-save after the RCMDR=TRUE above that will do what I want -- don't save any data after exiting.  However, this isn't the most secure -- a student only has to delete the option, or start R a

Re: [R] definition of AIC and BIC in gls

2009-08-21 Thread Gavin Simpson
On Thu, 2009-08-20 at 09:08 -0400, Bond, Stephen wrote: Hello everybody, Please help with connecting the AIC and BIC numbers printed by summary.gls to the logLik number. 1. is the logLik number the true ML or density scaling constants have been omitted? I'm not sure, sorry, but the

Re: [R] PowerCut Killed R - is my code retrievable?

2009-08-21 Thread Gavin Simpson
On Thu, 2009-08-20 at 20:46 +0100, Polwart Calum (County Durham and snip / A half-decent text editor should be saving things to disk as you go. For example, in emacs, if your emacs dies while editing a file then when you restart it, it will notice and offer to restore it from its restore

[R] A question on List

2009-08-21 Thread RON70
Suppose I have following list : mat - vector(list) for (i in 1:4) mat[[i]] - matrix(rnorm(25),5) mat mat [[1]] [,1] [,2] [,3] [,4] [,5] [1,] -1.27171814 -0.8087277 -0.4771356 0.6001265 0.9842248 [2,] -1.37337445 1.0754536 -1.6304287 -0.6854075 -0.6029390

[R] multiple linear regression

2009-08-21 Thread Inchallah Yarab
Good morning, I want to make a linear regression of a variable fuction of  two variables y = a1 x1 + a2 x2 + c I found the function lm (y ~ x)  but it used  for a simple linear regression, but for  multiple regression i do not know which function do this!!  Can you help me please!!  Thank

Re: [R] Video demo of using svSocket with data.table

2009-08-21 Thread Philippe Grosjean
Hello Matthew and all R-UseRs, You video demo is very nice. This suggests various uses of svSocket that I had not think about! The primary goal was to make it: - flexible (I think it is clear from the demo), - running in the background while not blocking the CLI (Rgui, R.app, or the terminal,

[R] [Hmisc] latex() with ctable=T inserting unwanted empty line in .tex file when used on summary.formula(method=reverse) object

2009-08-21 Thread vincent chouraki
Vincent Chouraki wrote: When I'm using Hmisc's latex() function with ctable=TRUE on a summary.formula with method=reverse object and saving in a .tex file, the latter contains an unwanted empty line which makes compilation fail. ... Example removed Vincent, I checked it and think

Re: [R] multiple linear regression

2009-08-21 Thread Ronggui Huang
pls use lm(y ~ x1+x2) 2009/8/21 Inchallah Yarab inchallahya...@yahoo.fr: Good morning, I want to make a linear regression of a variable fuction of  two variables y = a1 x1 + a2 x2 + c I found the function lm (y ~ x)  but it used  for a simple linear regression, but for  multiple

[R] Orthogonal Complement

2009-08-21 Thread Bogaso
A matrix B with dimension mx[m-n] is said to be orthogonal complement of A with dimension mxn (mn) if A'B = 0 Is there any any inbuild function in R which calculates the orthogonal complement of a given matrix? Thanks -- View this message in context:

[R] Odp: A question on List

2009-08-21 Thread Petr PIKAL
Hi mapply(*, vect, mat, SIMPLIFY=F) Regards Petr r-help-boun...@r-project.org napsal dne 21.08.2009 10:53:19: Suppose I have following list : mat - vector(list) for (i in 1:4) mat[[i]] - matrix(rnorm(25),5) mat mat [[1]] [,1] [,2] [,3] [,4]

Re: [R] how to draw pentagon?

2009-08-21 Thread Hemavathi Ramulu
hi, Thanks alot for the idea. I managed to draw few diagrams. On Tue, Aug 18, 2009 at 9:02 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 18.08.2009 06:13:09: Hi everyone, I want you all help me to give an idea, how to draw pentagon with points?

Re: [R] Video demo of using svSocket with data.table

2009-08-21 Thread Romain Francois
Hi Philippe, When Matthew brought this up the first time on this list, there were several replies to warn about potential problems related to R not being thread safe, and that this might cause trouble. Since you were on holidays, we did not get your viewpoint. Could you elaborate on how you

[R] Function nsl() missing in package utils

2009-08-21 Thread Janko Thyson
Dear list, today I stumbled across the function „nsl()” for the first time in order to perform a hostname lookup. According to the R Reference Index (Version 2.9.1, page 1522), the function should be part of the utils package. However, I cannot find it in the utils package of my installation(s).

Re: [R] change default measurement unit to millimetre

2009-08-21 Thread e-letter
On 20/08/2009, Patrick Connolly p_conno...@slingshot.co.nz wrote: On Thu, 20-Aug-2009 at 10:25PM +1000, Jim Lemon wrote: e-letter wrote: Readers, How do I configure R so that all units of measurement are in millimetres? For example if I want to set the width of a graph, I want to write:

Re: [R] Orthogonal Complement

2009-08-21 Thread Bogaso
Please ignore my previous mail as it already replied at http://www.nabble.com/Orthogonal-Complement-td21406355.html#a21406355 Bogaso wrote: A matrix B with dimension mx[m-n] is said to be orthogonal complement of A with dimension mxn (mn) if A'B = 0 Is there any any inbuild function in

Re: [R] A question on List

2009-08-21 Thread baptiste auguie
Try this, mat - replicate(4, matrix(rnorm(25), 5), simpl=F) mat vect - rnorm(4) mapply( `*` , mat, vect, SIMPLIFY=F) HTH, baptiste PS: I see someone replied already, but you might find replicate useful too 2009/8/21 RON70 ron_michae...@yahoo.com: Suppose I have following list : mat -

[R] Where to put source code?

2009-08-21 Thread Peter Meilstrup
I'm trying to move from Matlab to R, and I'm stuck even getting started. This sounds to me like the dumbest question in the world but... how does one put R source code in files? Over the last three days I've gone front to back through the Introduction to R and the R Language Definition, and while

[R] supression of ongoing print command (outputted in chunks)

2009-08-21 Thread john.gelburg
Hi, It looks like print command window output is suppressed sometimes and from time to time it is outputted in chunks. Is there any way to make R enforce some flush of its waiting output? Thanks -- View this message in context:

[R] 2d color coded line plot

2009-08-21 Thread Gonçalo Graça
Hi! I'm not experienced very experienced with R and i'm looking for a way doing plots like in this example http://www.mathworks.de/matlabcentral/fx_files/23566/2/color_line3.png, which basically it is a 2d plot in which the 3rd dimension (variable) is color coded. I have only seen elsewhere

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Renaud Gaujoux
Thanks Duncan, I agree that touching the environments is risky and not robust. I rather go for another solution. But the function solution still require to pass an extra object to the user's function. I'd like the user to simply be able to call function setVar as if it was a standard R function

Re: [R] extra .

2009-08-21 Thread Gabor Grothendieck
It has no effect. Both 6 and 6. represent the number six as a double: identical(6, 6.) [1] TRUE typeof(6.) [1] double On Thu, Aug 20, 2009 at 10:34 PM, kfcnhlzhengchenj...@hotmail.com wrote: sigma0 - sqrt((6. * var(maxima))/pi) What does the '.' do here? -- View this message in context:

Re: [R] Where to put source code?

2009-08-21 Thread baptiste auguie
Hi, Say you have the following data and functions that you want to reuse, d = data.frame(1:10) foo = function(x,y , ...){ plot(x,y, type=l, ...) } You may save the code in a file testing.r, noting that in general data may find a convenient storage format using save(d, file=

Re: [R] Where to put source code?

2009-08-21 Thread Romain Francois
Hi, You might be interested in : - this (out of date) page : http://www.sciviews.org/_rgui/ - this (not yet filled) page : http://wiki.r-project.org/rwiki/doku.php?id=guis:projects for a list of potential guis/text editor you can use to write your R code. Romain On 08/21/2009 12:06 PM,

Re: [R] 2d color coded line plot

2009-08-21 Thread ONKELINX, Thierry
Have a look at the ggplot2 package. You will find a lot of examples at http://had.co.nz/ggplot2/ library(ggplot2) dataset - data.frame(x = seq(-1, 1, length = 101)) dataset$y - dataset$x + dataset$x^2 dataset$z - 10 * dataset$x + 1 ggplot(dataset, aes(x = x, y = y, colour = z)) + geom_point()

Re: [R] Where to put source code?

2009-08-21 Thread Barry Rowlingson
On Fri, Aug 21, 2009 at 11:06 AM, Peter Meilstruppeter.meilst...@gmail.com wrote: I'm just looking for the local equivalent of (in matlab) writing a function, saving it as functionName.m and then being able to call functionName(). Or in Python of writing a module.py and then typing import

Re: [R] categorized barplot

2009-08-21 Thread Jim Lemon
Rafael Moral wrote: Dear useRs, I can't seem to find out how to categorize my histogram. I have the following dataset: TimeFirst.day Second.day 08:00-10:009 8 10:00-12:00 13 15 12:00-14:009 9 14:00-16:00 10

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Gabor Grothendieck
Another possibility is that you could inject setVar into fun.global's environment. First save any existing setVar in fun.global's environment to tmp and then assign our own setVar there. We then run fun.global() and reverse the changes we made in fun.global's environment setting everything back

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Renaud Gaujoux
Ah! It looks interesting and seems more conservative than changing the actual environment. I could do the restore within an on.exit to deal with the error eventuality. Do you think could define a dummy setVar function in my package namespace, and change its behaviour on runtime? This way, as

Re: [R] Wind-data analysis with R?

2009-08-21 Thread Jim Lemon
Oliver Bandel wrote: Hello, are there people outside who use R for analysis of wind-measurement data (meteorological or for planning of wind power stations)? Are there already scripts/modules available for analysing and displaying/plotting wind data in the way it is done in projection/planning

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Gabor Grothendieck
Certainly its possible to dynamically write to the package's namespace. For example, lattice does that. It stores various lattice options there. Injecting setVar is not really more conservative though. Consider that when you modify the environment of a function in main: environment(fun.global)

Re: [R] 2d color coded line plot

2009-08-21 Thread Jim Lemon
Gonçalo Graça wrote: Hi! I'm not experienced very experienced with R and i'm looking for a way doing plots like in this example http://www.mathworks.de/matlabcentral/fx_files/23566/2/color_line3.png, which basically it is a 2d plot in which the 3rd dimension (variable) is color coded. I have

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Renaud Gaujoux
And to make things a bit more difficult: I also use the multicore package. So I guess that naively modifying setVar in my package namespace would not be appropriate as each process needs to define its own setVar function. Unless setVar is implemented so that it knows which process is calling

Re: [R] Orthogonal Complement

2009-08-21 Thread Gabor Grothendieck
Check out ?Null in MASS. On Fri, Aug 21, 2009 at 5:52 AM, Bogasobogaso.christo...@gmail.com wrote: Please ignore my previous mail as it already replied at http://www.nabble.com/Orthogonal-Complement-td21406355.html#a21406355 Bogaso wrote: A matrix B with dimension mx[m-n] is said to be

Re: [R] supression of ongoing print command (outputted in chunks)

2009-08-21 Thread jim holtman
?flush.console If you are using the Windows RGUI (you did not specify the system you are on), you can set the output to non-buffered. On Fri, Aug 21, 2009 at 4:49 AM, john.gelburgjohn.gelb...@gmail.com wrote: Hi, It looks like print command window output is suppressed sometimes and from

[R] how to plot 95% confidential interval as vertical lines to x axe in density plot

2009-08-21 Thread Mao Jianfeng
Dear R-help listers, Under the helps from the ggplot2 list, I have set up method of drawing a graph with multiple density plots arranged one by one in one page. Now, I want to add 95% confidential interval as vertical lines to x axe in density plot. I have found the library(hdrcde) can do this

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Gabor Grothendieck
I think you need to consider particular scenarios in which this is used and the characteristics of the user since there are going to be tradeoffs in the design. It may be that by examining typical usage cases that you find that the fun.global2 situation (i.e. fun.global calls fun.global2 calls

[R] creating gantt chart

2009-08-21 Thread rajclinasia
Hi every one, I have a R dataset like this. labels starts ends first task 2004-01-01 2004-03-03 second task 2004-02-02 2004-05-05 third task 2004-03-03 2004-06-06 fourth task 2004-04-04 2004-08-08 fifth task 2004-05-05 2004-09-09 now i

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Duncan Murdoch
On 8/21/2009 6:33 AM, Renaud Gaujoux wrote: Thanks Duncan, I agree that touching the environments is risky and not robust. I rather go for another solution. But the function solution still require to pass an extra object to the user's function. I'd like the user to simply be able to call

Re: [R] creating gantt chart

2009-08-21 Thread Gabor Grothendieck
Go to rseek.org and enter: gantt chart On Fri, Aug 21, 2009 at 8:35 AM, rajclinasiar...@clinasia.com wrote: Hi every one, I have a R dataset like this. labels      starts                     ends first task         2004-01-01   2004-03-03 second task 2004-02-02  2004-05-05 third task      

Re: [R] creating gantt chart

2009-08-21 Thread Paul Hiemstra
rajclinasia wrote: Hi every one, I have a R dataset like this. labels starts ends first task 2004-01-01 2004-03-03 second task 2004-02-02 2004-05-05 third task 2004-03-03 2004-06-06 fourth task 2004-04-04 2004-08-08 fifth task 2004-05-05

Re: [R] multiple linear regression

2009-08-21 Thread Peter Ehlers
Ronggui Huang wrote: pls use lm(y ~ x1+x2) and perhaps have a look at chapter 11 in the Introduction to R manual which you will probably find right there already on your computer. Peter Ehlers 2009/8/21 Inchallah Yarab inchallahya...@yahoo.fr: Good morning, I want to make a linear

Re: [R] 2d color coded line plot

2009-08-21 Thread baptiste auguie
geom_path in ggplot2 is another option, see two examples on this page: http://had.co.nz/ggplot2/geom_path.html HTH, baptiste 2009/8/21 Jim Lemon j...@bitwrit.com.au: Gonçalo Graça wrote: Hi! I'm not experienced very experienced with R and i'm looking for a way doing plots like in this

Re: [R] Possible bug with lrm.fit in Design Library

2009-08-21 Thread Frank E Harrell Jr
Noah to use predict, nomogram, summary, anova, etc. you need the fit object to be from the high level function (e.g., lrm). Frank Noah Silverman wrote: Hi, I've come across a strange error when using the lrm.fit function and the subsequent predict function. The model is created very

Re: [R] Video demo of using svSocket with data.table

2009-08-21 Thread Philippe Grosjean
Romain Francois wrote: Hi Philippe, When Matthew brought this up the first time on this list, there were several replies to warn about potential problems related to R not being thread safe, and that this might cause trouble. Well, that is true, R is not thread safe. What happens, basically,

[R] gantt chart for dataset

2009-08-21 Thread rajclinasia
hi, Thanks for responding of gantt charts. but i have some problem regarding with gantt charts. i.e. Ymd.format - %Y/%m/%d Ymd - function(x){ as.POSIXct(strptime(x, format=Ymd.format))} gantt.info - list( labels =c(First task,Second task,Third task,Fourth task,Fifth task), starts

Re: [R] gantt chart for dataset

2009-08-21 Thread Stefan Grosse
On Fri, 21 Aug 2009 06:19:53 -0700 (PDT) rajclinasia r...@clinasia.com wrote: R but my question is assume that above data stored in a excel file R 'sample'. now i want gantt chart for the 'sample' dataset. As a list is expected you need to convert your data frame into a list... hth Stefan

[R] optimization free software

2009-08-21 Thread Prof. John C Nash
There are also several projects on r-forge.r-project.org that deal with optimization, including one I'm involved with that has been putting up a number of new or reworked methods so that they can be tested, evaluated and improved. These all deal with unconstrained or box-constrained

Re: [R] gantt chart for dataset

2009-08-21 Thread David Winsemius
On Aug 21, 2009, at 9:19 AM, rajclinasia wrote: hi, Thanks for responding of gantt charts. but i have some problem regarding with gantt charts. i.e. Ymd.format - %Y/%m/%d Ymd - function(x){ as.POSIXct(strptime(x, format=Ymd.format))} gantt.info - list( labels =c(First task,Second

[R] Principle components analysis on a large dataset

2009-08-21 Thread Prof. John C Nash
The essential issue is that the matrix you need to manipulate is very large. This is not a new problem, and about a year ago I exchanged ideas with the Rff package developers (things have been on the back burner since due to recession woes and illness issues). These ideas were based on some

[R] LASSO: glmpath and cv.glmpath

2009-08-21 Thread Peter Schüffler
Hi, perhaps you can help me to find out, how to find the best Lambda in a LASSO-model. I have a feature selection problem with 150 proteins potentially predicting Cancer or Noncancer. With a lasso model fit.glm - glmpath(x=as.matrix(X), y=target, family=binomial) (target is 0, 1 - Cancer

Re: [R] LASSO: glmpath and cv.glmpath

2009-08-21 Thread Steve Lianoglou
Hi, On Aug 21, 2009, at 9:47 AM, Peter Schüffler wrote: Hi, perhaps you can help me to find out, how to find the best Lambda in a LASSO-model. I have a feature selection problem with 150 proteins potentially predicting Cancer or Noncancer. With a lasso model fit.glm -

Re: [R] Convert list to data frame while controlling column types

2009-08-21 Thread Steve Lianoglou
Hi Allie, On Aug 21, 2009, at 11:47 AM, Alexander Shenkin wrote: Hello all, I have a list which I'd like to convert to a data frame, while maintaining control of the columns' data types (akin to the colClasses argument in read.table). My numeric columns, for example, are getting converted to

Re: [R] extra .

2009-08-21 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of kfcnhl Sent: Thursday, August 20, 2009 7:34 PM To: r-help@r-project.org Subject: [R] extra . sigma0 - sqrt((6. * var(maxima))/pi) What does the '.' do here? In R it

[R] Convert list to data frame while controlling column types

2009-08-21 Thread Alexander Shenkin
Hello all, I have a list which I'd like to convert to a data frame, while maintaining control of the columns' data types (akin to the colClasses argument in read.table). My numeric columns, for example, are getting converted to factors by as.data.frame. Is there a way to do this, or will I have

Re: [R] Is there a construct for conditional comment?

2009-08-21 Thread Stavros Macrakis
On Thu, Aug 20, 2009 at 1:27 PM, David Winsemiusdwinsem...@comcast.net wrote: ... But an extremely simple modification succeeds:  if ( 0 ) {  commented with zero  } else {  commented with one  } Returns: [1] \ncommented with one\n Yes, but of course that executes neither one nor the

Re: [R] extra .

2009-08-21 Thread Steve Lianoglou
Hi, This is somehow unrelated, but your answer brings up a question that I've been curious about: On Aug 21, 2009, at 11:48 AM, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of kfcnhl Sent: Thursday,

[R] Repost - Calculating loess value

2009-08-21 Thread Noah Silverman
Hello, I'm attempting to evaluate the accuracy of the probability predictions for my model. As previously discussed here, the AUC is not a good measure as I'm not concerned with classification accuracy but probability accurcy. It was suggested to me that the loess function would be a good

[R] Repost - Possible bug with lrm.fit in Design Library

2009-08-21 Thread Noah Silverman
Hi, I've come across a strange error when using the lrm.fit function and the subsequent predict function. The model is created very quickly and can be verified by printing it on the console. Everything looks good. (In fact, the performance measures are rather nice.) Then, I want to use

[R] Query on Error : subscript out of bounds in Rclimdex

2009-08-21 Thread Bin1aya
Dear All, I am trying for indices calculation in Rclimdex but I get following error In addition: Warning messages: 1: In function () : NAs introduced by coercion 2: In function () : NAs introduced by coercion How can I overcome this problem? http://www.nabble.com/file/p25082608/GODAVARI.txt

Re: [R] Repost - Possible bug with lrm.fit in Design Library

2009-08-21 Thread Marc Schwartz
On Aug 21, 2009, at 11:02 AM, Noah Silverman wrote: Hi, I've come across a strange error when using the lrm.fit function and the subsequent predict function. The model is created very quickly and can be verified by printing it on the console. Everything looks good. (In fact, the

Re: [R] eval and evironments: call local function in a global function

2009-08-21 Thread Gabor Grothendieck
Just one correction. The line environment(fun.global) - environment() line below should be deleted. It was needed in a prior example but in this one we use parent.frame()$setVar(4) in the call so that line is not needed in main. On Fri, Aug 21, 2009 at 7:09 AM, Gabor

Re: [R] extra .

2009-08-21 Thread William Dunlap
-Original Message- From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com] Sent: Friday, August 21, 2009 9:02 AM To: William Dunlap Cc: kfcnhl; r-help@r-project.org Subject: Re: [R] extra . Hi, This is somehow unrelated, but your answer brings up a question that I've

[R] Special LS estimation problem

2009-08-21 Thread megh
Hi, I have following kind of model : Y = X1 * a1 + X2 * a2 + error Here sampled data for Y, X1, X2 are like that : Y - replicate(10, matrix(rnorm(2),2), simplify = F) X1 - replicate(10, matrix(rnorm(4),2), simplify = F) X2 - replicate(10, matrix(rnorm(4),2), simplify = F) My goal is to

Re: [R] Repost - Possible bug with lrm.fit in Design Library

2009-08-21 Thread Noah Silverman
Thanks Marc, My apologies to all for the unnecessary re-posting. -Noah On 8/21/09 9:13 AM, Marc Schwartz wrote: On Aug 21, 2009, at 11:02 AM, Noah Silverman wrote: Hi, I've come across a strange error when using the lrm.fit function and the subsequent predict function. The model is

[R] help with median for each row

2009-08-21 Thread Edward Chen
Hi, I tried looking through google search on whether there's a way to computer the median for each row of a nxn matrix and return the medians for each row for further computation. And also if the number of columns in the matrix are even, how could I specify which median to use? Thank you very

Re: [R] help with median for each row

2009-08-21 Thread stephen sefick
?apply specifically the MARGINS argument On Fri, Aug 21, 2009 at 11:50 AM, Edward Chenedche...@gmail.com wrote: Hi, I tried looking through google search on whether there's a way to computer the median for each row of a nxn matrix and return the medians for each row for further computation.

Re: [R] help with median for each row

2009-08-21 Thread Erik Iverson
Edward, In general, if you have an nxn matrix, you can use the apply function to apply a function to each row of the matrix, and return the result. So, as a start, you could do, apply(your.mat, 1, median) or apply(your.mat, 1, median, na.rm = TRUE) if you want to pass further arguments

Re: [R] help with median for each row

2009-08-21 Thread Greg Hirson
Edward, See ?apply x = matrix(rnorm(100), ncol = 10) apply(x, 1, median) Hope this helps, Greg Edward Chen wrote: Hi, I tried looking through google search on whether there's a way to computer the median for each row of a nxn matrix and return the medians for each row for further

[R] applying summary() to an object created with ols()

2009-08-21 Thread Benjamin Volland
Hello R-list, I am trying to calculate a ridge regression using first the *lm.ridge()* function from the MASS package and then applying the obtained Hoerl Kennard Baldwin (HKB) estimator as a penalty scalar to the *ols()* function provided by Frank Harrell in his Design package. It looks

Re: [R] help with median for each row

2009-08-21 Thread Matthias Kohl
if your matrix has many rows you might want to consider rowMedians from Bioconductor package Biobase. hth, Matthias Greg Hirson schrieb: Edward, See ?apply x = matrix(rnorm(100), ncol = 10) apply(x, 1, median) Hope this helps, Greg Edward Chen wrote: Hi, I tried looking through google

[R] how to plot a gains chart in R?

2009-08-21 Thread clue_less
I have 1000 oberved binary reponses Y, and I also have 1000 predictited probabilities predicted_prob (between 0 and 1) for those observed reponses. How can I plot a gain chart in R? Thanks. -- View this message in context:

[R] help with pmvnorm function

2009-08-21 Thread Vaupo
Hi, I´ve got a problem with using the pmvnorm function. For example ,if i assume a bivariate normal distribution with mean=(0,0) and sigma=(1,0.5,0.5,1) how do i generate the probability for X1=2 and X2=3 ? -- View this message in context:

[R] survival analysis: time-variant covariates, right censored, re-current events

2009-08-21 Thread clue_less
I have a data set for survival analysis in R. The data have time-variant covariates, and right-censored outcomes, which could also be re-current events. What R package should I use? Thanks! -- View this message in context:

Re: [R] survival analysis: time-variant covariates, right censored, re-current events

2009-08-21 Thread David Winsemius
On Aug 21, 2009, at 1:16 PM, clue_less wrote: I have a data set for survival analysis in R. The data have time- variant covariates, and right-censored outcomes, which could also be re- current events. What R package should I use? Have you considered recasting the data into

[R] Help with residuals function.

2009-08-21 Thread rkevinburton
I have a misunderstanding on the residuals function in 'R'. In the stats package the residuals for the output of a HoltWinters fit is residuals.HoltWinters and the source looks like: stats:::residuals.HoltWinters function (object, ...) object$x - object$fitted[, 1] environment:

[R] Problem with RHEL 5 repo and the latest R RPMs

2009-08-21 Thread Hugh Brown
Hi everyone -- I have a number of systems here running CentOS 5.2 and 5.3. Recently, I tried adding a package unrelated to R and found that yum is complaining about the R repo. Here's the error I get when running yum update: $ sudo yum update [snip]

Re: [R] Special LS estimation problem

2009-08-21 Thread Ted Harding
On 21-Aug-09 16:28:26, megh wrote: Hi, I have following kind of model : Y = X1 * a1 + X2 * a2 + error Here sampled data for Y, X1, X2 are like that : Y - replicate(10, matrix(rnorm(2),2), simplify = F) X1 - replicate(10, matrix(rnorm(4),2), simplify = F) X2 - replicate(10,

Re: [R] how to compute this summation...

2009-08-21 Thread Vitalie S.
On Thu, 20 Aug 2009 02:36:38 +0200, kathie kathryn.lord2...@gmail.com wrote: Dear R users, I try to compute this summation, http://www.nabble.com/file/p25054272/dd.jpg where f(y|x) = Negative Binomial(y, mu=exp(x' beta), size=1/alp) http://www.nabble.com/file/p25054272/aa.jpg

Re: [R] Special LS estimation problem

2009-08-21 Thread megh
Y is 2 dimensional vector, X1 and X2 are 2x2 matrices. Ted.Harding-2 wrote: On 21-Aug-09 16:28:26, megh wrote: Hi, I have following kind of model : Y = X1 * a1 + X2 * a2 + error Here sampled data for Y, X1, X2 are like that : Y - replicate(10, matrix(rnorm(2),2), simplify = F) X1 -

Re: [R] Convert list to data frame while controlling column types

2009-08-21 Thread David Winsemius
On Aug 21, 2009, at 11:47 AM, Alexander Shenkin wrote: Hello all, I have a list which I'd like to convert to a data frame, while maintaining control of the columns' data types (akin to the colClasses argument in read.table). My numeric columns, for example, are getting converted to factors

Re: [R] Special LS estimation problem

2009-08-21 Thread Ted Harding
On 21-Aug-09 18:12:45, megh wrote: Y is 2 dimensional vector, X1 and X2 are 2x2 matrices. Sorry -- I mis-read your code! I will think about your problem. Apologies. Ted. Ted.Harding-2 wrote: On 21-Aug-09 16:28:26, megh wrote: Hi, I have following kind of model : Y = X1 * a1 + X2 * a2 +

[R] discriminant analysis

2009-08-21 Thread Beatriz Yannicelli
Dear all: Is it possible to conduct a discriminant analysis in R with categorical and continuous variables as predictors? Beatriz [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] ROC curve and gains/lift chart

2009-08-21 Thread clue_less
What is the difference between ROC curve and gains/lift chart? how to do them in R? Thanks. -- View this message in context: http://www.nabble.com/ROC-curve-and-gains-lift-chart-tp25083979p25083979.html Sent from the R help mailing list archive at Nabble.com.

[R] unable to connect to 'cran.r-project.org' on port 80.

2009-08-21 Thread clue_less
I tried to select a mirror site from R, but got the following error - chooseCRANmirror() Warning message: In open.connection(con, r) : unable to connect to 'cran.r-project.org' on port 80. The consequence is that i have to install R-packages by downloading zip files one by one, and then

Re: [R] unable to connect to 'cran.r-project.org' on port 80.

2009-08-21 Thread David Winsemius
On Aug 21, 2009, at 1:31 PM, clue_less wrote: I tried to select a mirror site from R, but got the following error - chooseCRANmirror() Warning message: In open.connection(con, r) : unable to connect to 'cran.r-project.org' on port 80. The consequence is that i have to install

Re: [R] Principle components analysis on a large dataset

2009-08-21 Thread misha680
Hi Moshe, Your idea sounds reasonable to me. It seems analogous to have a system of linear equations with more unknowns that equations - there should be several solutions so there is no exact PCA solution. My plan (* = dot product) 1. Pick first nice vector to be longest - that is x1 * x1 is

Re: [R] Problem with RHEL 5 repo and the latest R RPMs

2009-08-21 Thread Marc Schwartz
On Aug 21, 2009, at 1:00 PM, Hugh Brown wrote: Hi everyone -- I have a number of systems here running CentOS 5.2 and 5.3. Recently, I tried adding a package unrelated to R and found that yum is complaining about the R repo. Here's the error I get when running yum update: $ sudo

Re: [R] ROC curve and gains/lift chart

2009-08-21 Thread Christian Schulz
Have look in the ROCR package and Example's. HTH Christian What is the difference between ROC curve and gains/lift chart? how to do them in R? Thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Question about validating predicted probabilities

2009-08-21 Thread Noah Silverman
Hello, Frank was nice enough to point me to the val.prob function of the Design library. It creates a beautiful graph that really helps me visualize how well my model is predicting probabilities. By default, there are two lines on the graph 1) fitted logistic calibration curve 2)

Re: [R] Convert list to data frame while controlling column types

2009-08-21 Thread Alexander Shenkin
Thanks everyone for their replies, both on- and off-list. I should clarify, since I left out some important information. My original dataframe has some numeric columns, which get changed to character by gsub when I replace spaces with NAs. Thus, in going back to a dataframe, those (now

[R] data layout for crossed factors w/interaction in linear mix models

2009-08-21 Thread Rafael Diaz
Dear All, I am trying to fit a simple linear mixed model (see below this paragraph) arising from a crossed factorial design with 2 factors and ubalanced number of replicates (from two to five) in each cell, but I keep getting an error message (see bottom of message). The model is: yijk =

[R] splitting a string up

2009-08-21 Thread stephen sefick
x - 1041281__2009_08_20_.lev I would like to split this string up and only extract the leading numbers. 1041281 to use as a label for a data column in a bigger for loop function to read in data. regards, -- Stephen Sefick Let's not spend our time and resources thinking about things that are

Re: [R] splitting a string up

2009-08-21 Thread Doran, Harold
x - 1041281__2009_08_20_.lev strsplit(x, '_')[[1]][1] [1] 1041281 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of stephen sefick Sent: Friday, August 21, 2009 3:51 PM To: r-help@r-project.org Subject: [R] splitting a

Re: [R] splitting a string up

2009-08-21 Thread Bert Gunter
gsub(\\_.*,,x) This assume _ if the first character following the numbers. You may need a character class if it can be one of several. ?gsub ?regex for further (terse for the latter) details. Bert Gunter Genentech Nonclinical Biostatisics -Original Message- From:

Re: [R] splitting a string up

2009-08-21 Thread Henrique Dallazuanna
Try this: gsub(__.*, , 1041281__2009_08_20_.lev) On Fri, Aug 21, 2009 at 4:50 PM, stephen sefick ssef...@gmail.com wrote: x - 1041281__2009_08_20_.lev I would like to split this string up and only extract the leading numbers. 1041281 to use as a label for a data column in a bigger for

Re: [R] splitting a string up

2009-08-21 Thread Bert Gunter
Actually _ is not a metacharacter so, gsub(_.*,,x) will do. Bert Gunter Genentech Nonclinical Biostatisics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: Friday, August 21, 2009 12:55 PM To: stephen sefick;

Re: [R] Convert list to data frame while controlling column types

2009-08-21 Thread David Winsemius
On Aug 21, 2009, at 3:41 PM, Alexander Shenkin wrote: Thanks everyone for their replies, both on- and off-list. I should clarify, since I left out some important information. My original dataframe has some numeric columns, which get changed to character by gsub when I replace spaces with

Re: [R] splitting a string up

2009-08-21 Thread Marc Schwartz
On Aug 21, 2009, at 2:50 PM, stephen sefick wrote: x - 1041281__2009_08_20_.lev I would like to split this string up and only extract the leading numbers. 1041281 to use as a label for a data column in a bigger for loop function to read in data. regards, At least four options:

  1   2   >