Re: [R] R² for non-linear model

2011-03-16 Thread Joshua Wiley
On Wed, Mar 16, 2011 at 10:54 AM, Bert Gunter gunter.ber...@gene.com wrote: Is there any way that this could be made into a fortune -- perhaps by omitting the poster's identity? yes there are threads concidering this topic but they are all about the theory not about how to get the value of

Re: [R] R² for non-linear model

2011-03-16 Thread Alexx Hardt
Am 16.03.2011 19:11, schrieb Joshua Wiley: (Are fortunes determined by voting? There is precedence for seconding desired fortunes at least) Wait, what do you mean by fortune? Is there a statistics-quote-package-something for the unix shell program 'fortune' ? If so, I want want want!

Re: [R] R² for non-linear model + comparing linear + non-linear models

2011-03-16 Thread Anna Gretschel
Am 16.03.2011 19:29, schrieb Heiman, Thomas J.: Hi Anna, AIC and BIC are good criteria for determining degree of model fit.. Sincerely, tom Thomas Heiman, PhD Info Systems Eng, Sr The MITRE Corporation | Center for Enterprise Modernization Office: 703-983-2951 | thei...@mitre.org

Re: [R] export list to csv

2011-03-16 Thread Kenn Konstabel
The optimal way of doing it depends on how you want to use the result. An easy way has been recommended - if you have boo - list(first=data.frame(a=1:5, b=2:6), second=data.frame(a=6:10, b=7:11)) .. then sink(boo.txt) boo # or: print(boo) sink() ... will put it all in the same file, the same

Re: [R] R² for non-linear model

2011-03-16 Thread Alexx Hardt
Am 16.03.2011 19:34, schrieb Anna Gretschel: Am 16.03.2011 19:21, schrieb Alexx Hardt: And to be on-topic: Anna, as far as I know anova's are only useful to compare a submodel (e.g. with one less regressor) to another model. thanks! i don't get it either what they mean by fortune... It's an

Re: [R] Reorganize data frame

2011-03-16 Thread Henrique Dallazuanna
Try this: xtabs(Return ~ Date + Ticker, stock.returns) On Wed, Mar 16, 2011 at 11:37 AM, chris99 chea...@hotmail.com wrote: Hi group, I am trying to convert the organization of a data frame so I can do some correlations between stocks, I have something like this: stock.returns -

Re: [R] graph lines don;t appear

2011-03-16 Thread Sara Szeremeta
Thanks a lot!! It helped! 2011/3/15 Sara Szeremeta sara.szerem...@gmail.com Hi I am trying to plot two simple graphs with a grid in background. The axis and grid appears in correct position, but the actual data are not there Can somebody provide me a hint what is missing? The code

Re: [R] a question

2011-03-16 Thread Greg Snow
If you do ?Startup then you get the help page that describes all that R does as it starts up and there are a few places in there that it describes where you can put things to be run automatically. I have done this for a doctor before who wanted to show the demonstration I showed him to others,

Re: [R] read.table() with \t as seperator, all other programs report equal fields each row, read.table() returns unequal row length error

2011-03-16 Thread peter dalgaard
On Mar 16, 2011, at 17:37 , Yong Wang wrote: hi, list R is undoudtedly my favorite statistic tool, however, the data inputnpart has long been a pain. most data I have to deal with are irregular and contains special character. Recently I get a tab delimited data,

Re: [R] export list to csv

2011-03-16 Thread andrija djurovic
Thanks everyone for different solutions. Every solution works very well. For my purpose, this function sink does what I was looking for. Andrija On Wed, Mar 16, 2011 at 4:23 PM, Roman Luštrik roman.lust...@gmail.comwrote: How about? sink(andrija.csv) l sink() -- View this message in

Re: [R] fetch uneven

2011-03-16 Thread David Winsemius
On Mar 16, 2011, at 1:21 PM, Henrik Bengtsson wrote: See ?seq for generating index vectors of different kinds. /Henrik Most people will probably understand seq(...) better than they understand modulo arithmetic, but logical indexing could also be used for the task: ((1:12) %/% 2) ==

Re: [R] Singularity problem

2011-03-16 Thread David Winsemius
On Mar 16, 2011, at 1:32 PM, Berend Hasselman wrote: Peter Langfelder wrote: On Wed, Mar 16, 2011 at 8:28 AM, Feng Li lt;m...@feng.ligt; wrote: Dear R, If I have remembered correctly, a square matrix is singular if and only if its determinant is zero. I am a bit confused by the

Re: [R] Reorganize data frame

2011-03-16 Thread Scott Chamberlain
require(reshape2) dcast(stock.returns, Date ~ Ticker) The numbers were changed from their original values, but if you originally created the values Return as.numeric they should stay the same On Wednesday, March 16, 2011 at 9:37 AM, chris99 wrote: Hi group, I am trying to convert the

Re: [R] adding linear regression data to plot

2011-03-16 Thread derek
Thank you that is very helpful. -- View this message in context: http://r.789695.n4.nabble.com/adding-linear-regression-data-to-plot-tp3357946p3382615.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Speed up sum of outer products?

2011-03-16 Thread AjayT
Hi Stefan, thats really interesting - I never though of trying to benchmark Linux-64 against OSX (a friend who works on large databases, says OSX performs better than Linux in his work!). Thanks for posting your comparison, and your hints :) i) I guess you have a very fast CPU (Core i7 or so, I

[R] Quantmod getSymbol.MySQL

2011-03-16 Thread priyadarshee sukhwal
I am trying to read a table from MySQL, I have loaded the file in ts database, in table name ACC. but i am unable to read it in R through getSymbol function. mysql show databases; ++ | Database | ++ |

Re: [R] Cox model, model averaging and survival curve

2011-03-16 Thread Martin Patenaude-Monette
Thanks a lot for your answer. Martin Patenaude-Monette MSc. Candidate Département de biologie Université du Québec à Montréal 2011/3/15 Terry Therneau thern...@mayo.edu --- included text -- I have done model selection between candidate Cox models, using AICc calculated with penalized log

[R] linear regression in a data.frame using recast

2011-03-16 Thread Justin Haynes
I have a very large dataset with columns of id number, actual value, predicted value. This used to be a time series but I have dropped the time component. So I now have a data.frame where the id number is repeated but each value in the actual and predicted columns are unique. I assume I need to

Re: [R] File Save As...

2011-03-16 Thread Gene Leynes
Thanks for showing me the link to the code / your response / your work in general. It seems that the real magic is happening in the call to the function attributes, via the line attr(x, srcref) I'm guessing that attributes must be defined somewhere deep inside the R machinery (since I didn't find

[R] Strange R squared, possible error

2011-03-16 Thread derek
k=lm(y~x) summary(k) returns R^2=0.9994 lm(y~x) is supposed to find coef. a anb b in y=a*x+b l=lm(y~x+0) summary(l) returns R^2=0.9998 lm(y~x+0) is supposed to find coef. a in y=a*x+b while setting b=0 The question is why do I get better R^2, when it should be otherwise? Im sorry to use the

Re: [R] Singularity problem

2011-03-16 Thread rex.dwyer
Feng, Your matrix is *not* (practically) singular; its inverse is. The message said that the *system* was singular, not the matrix. Remember Cramer's Rule: xi = |Ai| / |A| The really, really large determinant of your matrix is going to appear in the denominator of your solutions, so,

Re: [R] Strange R squared, possible error

2011-03-16 Thread Ista Zahn
Hi Derek, R^2 doesn't mean the same thing when you omit the intercept, as has been discussed on this list before. See http://r.789695.n4.nabble.com/lm-without-intercept-td3312429.html Best, Ista On Wed, Mar 16, 2011 at 3:49 PM, derek jan.kac...@gmail.com wrote: k=lm(y~x) summary(k) returns

Re: [R] Strange R squared, possible error

2011-03-16 Thread Bert Gunter
?summary.lm The R^2 section explains that R^2 is computed differently depending on whether or not an intercept is in the model. -- Bert On Wed, Mar 16, 2011 at 12:49 PM, derek jan.kac...@gmail.com wrote: k=lm(y~x) summary(k) returns R^2=0.9994 lm(y~x) is supposed to find coef. a anb b in

Re: [R] calculating AUCs for each of the 1000 boot strap samples

2011-03-16 Thread Brian Diggs
On 3/16/2011 8:04 AM, taby gathoni wrote: data-data.frame(id=1:(165+42),main_samp$SCORE, x=rep(c(BAD,GOOD),c(42,165))) f-function(x) { + str.sample-list() + for (i in 1:length(levels(x$x))) + { + str.sample[[i]]-x[x$x==levels(x$x)[i] ,][sample(tapply(x$x,x$x,length)[i],20,rep=T),] + } +

Re: [R] Strange R squared, possible error

2011-03-16 Thread JLucke
lm(y~x+0) yields the regression on x without the constant, i.e., y=bx+e, not y = a +e derek jan.kac...@gmail.com Sent by: r-help-boun...@r-project.org 03/16/2011 03:49 PM To r-help@r-project.org cc Subject [R] Strange R squared, possible error k=lm(y~x) summary(k) returns R^2=0.9994

Re: [R] fetch uneven

2011-03-16 Thread Henrique Dallazuanna
Try this: a - m[c(TRUE, FALSE)] On Wed, Mar 16, 2011 at 11:43 AM, rens picca...@hotmail.com wrote: Hi I have a vector m:  m  [1] ABC transporters  [2] 2  [3] Acetyl-CoA  [4] 1  [5] Energie  [6] 1  [7] FAD Biosynthese  [8] 1  [9] Glyoxylate and dicarboxylate metabolism [10] 1 [11]

Re: [R] Singularity problem

2011-03-16 Thread William Dunlap
You can get fairly bad results from solve() and other linear algebra routines without warning. E.g., the following function makes a 2 by 2 matrix which would have determinate 1.0 if we had infinite precision arithmetic and actually will produce one of determinant 1 on a computer if you use the

Re: [R] Singularity problem

2011-03-16 Thread Berend Hasselman
On 16-03-2011, at 21:11, David Winsemius wrote: On Mar 16, 2011, at 1:32 PM, Berend Hasselman wrote: . svd(a) indicates the problem. largest singular value / smallest singular value=1e17 (condition number) -- reciprocal condition number=1e-17 and the standard solve can't handle

Re: [R] linear regression in a data.frame using recast

2011-03-16 Thread David Winsemius
On Mar 16, 2011, at 3:19 PM, Justin Haynes wrote: I have a very large dataset with columns of id number, actual value, predicted value. This used to be a time series but I have dropped the time component. So I now have a data.frame where the id number is repeated but each value in the actual

Re: [R] Strange R squared, possible error

2011-03-16 Thread derek
It states summary.lm: r.squared R^2, the ‘fraction of variance explained by the model’, R^2 = 1 - Sum(R[i]^2) / Sum((y[i]- y*)^2), where y* is the mean of y[i] if there is an intercept and zero otherwise. Why to use different formula when intercept is set to zero? I tried to compute R^2

[R] plotting multiple figures on one page

2011-03-16 Thread scarlet
I am new to the R language. I am trying to plot multiple figures on one page through a loop, but the code just produce one graph on one page. Can someone show some light on what's wrong? Here is my code: library(quantreg) tcdata-read.table(mydata.txt,header=TRUE) postscript(myfigure.ps) basins-

Re: [R] linear regression in a data.frame using recast -- A fortunes candidate??

2011-03-16 Thread Bert Gunter
Ha! -- A fortunes candidate? -- Bert If this is really a time series, then you will have serious validity problems due to auto-correlation among non-independent units. (But if you are just searching for a way to pull the wool over the eyes of the statistically uninformed, then I guess

Re: [R] How to make sure R's g++ compiler uses certain C++ flags when making a package

2011-03-16 Thread solomon.mess...@gmail.com
Looks like the problem may be that R is automatically passing this flag to the g++ compiler: -arch x86_64 which appears to be causing trouble for opencv. Does anyone know how to suppress this flag? -- View this message in context:

Re: [R] Does R have a const object?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 1:12 PM, luke-tier...@uiowa.edu wrote: On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 12:16 PM,  luke-tier...@uiowa.edu wrote: On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 11:49 AM,  luke-tier...@uiowa.edu wrote:

Re: [R] Strange R squared, possible error

2011-03-16 Thread Thomas Lumley
On Thu, Mar 17, 2011 at 10:01 AM, derek jan.kac...@gmail.com wrote: It states summary.lm: r.squared       R^2, the ‘fraction of variance explained by the model’, R^2 = 1 - Sum(R[i]^2) / Sum((y[i]- y*)^2), where y* is the mean of y[i] if there is an intercept and zero otherwise. Why to use

Re: [R] Strange R squared, possible error

2011-03-16 Thread Ben Bolker
JLucke at ria.buffalo.edu writes: lm(y~x+0) yields the regression on x without the constant, i.e., y=bx+e, not y = a +e derek jan.kacaba at gmail.com Sent by: r-help-bounces at r-project.org 03/16/2011 03:49 PM Would someone like to (please!) write this up and submit it to Kurt

Re: [R] Singularity problem

2011-03-16 Thread Feng Li
Thanks all of you for the very interesting discussion. I think I get it now. Feng On 03/16/2011 09:25 PM, rex.dw...@syngenta.com wrote: Feng, Your matrix is *not* (practically) singular; its inverse is. The message said that the *system* was singular, not the matrix. Remember Cramer's Rule:

[R] Regex query (Apache logs)

2011-03-16 Thread Saptarshi Guha
Hello R users, I have this regex see [1] for apache log lines. I tried using R to parse some data (only because I wanted to stay in R). A sample line is [2] (a) I saved the line in [1] into ~/tmp/a.txt and [2] into /tmp/a.txt pat - readLines(~/tmp/a.txt) test - readLines(/tmp/a.txt) test

[R] limited number of graphs in Quartz window

2011-03-16 Thread Nick Matzke
Hi all, I'm using the R GUI on a Mac. It is easy to produce a number of plots and put them into a Quartz window, and then use Command-left or Command-right to flip between them. However, Quartz seems to hold a maximum of about 15 plots, and then discards anything plotted before that.

Re: [R] making dataframes

2011-03-16 Thread Bill.Venables
Firstly, the way you have constructed your data frame in the example will convert everything to factors. What you need to do is actually a bit simpler: ### dum - data.frame(date, col1, col2) ### One way to turn this into the kind of data frame you want is to convert the main part of

Re: [R] R² for non-linear model

2011-03-16 Thread Changbin Du
How about using the prediction accuracy or ROC curve if you have validation data set? On Wed, Mar 16, 2011 at 11:42 AM, Alexx Hardt mikrowelle1...@gmx.de wrote: Am 16.03.2011 19:34, schrieb Anna Gretschel: Am 16.03.2011 19:21, schrieb Alexx Hardt: And to be on-topic: Anna, as far as I

Re: [R] Strange R squared, possible error

2011-03-16 Thread Peter Ehlers
On 2011-03-16 15:02, Ben Bolker wrote: JLuckeat ria.buffalo.edu writes: lm(y~x+0) yields the regression on x without the constant, i.e., y=bx+e, not y = a +e derekjan.kacabaat gmail.com Sent by: r-help-bouncesat r-project.org 03/16/2011 03:49 PM Would someone like to (please!)

[R] Need to abstract changing name of column within loop

2011-03-16 Thread jctoll
Hi, I'm struggling to figure out the way to change the name of a column from within a loop. The problem is I can't refer to the object by its actual variable name, since that will change each time through the loop. My xts object is A. head(A) A.Open A.High A.Low A.Close A.Volume

Re: [R] graph lines don;t appear

2011-03-16 Thread Sara Szeremeta
The values appear, indeed, however the grid has now shifted so that it is not aligned with the ticks on the axes. I'm using grid(nx=NULL, ny=NULL) that should do the trick to follow the axes' ticks, but it does not. I would appreciate any sugestions how to solve it. Regards, Sara pln -

[R] Autocorrelation in linear models

2011-03-16 Thread Arni Magnusson
I have been reading about autocorrelation in linear models over the last couple of days, and I have to say the more I read, the more confused I get. Beyond confusion lies enlightenment, so I'm tempted to ask R-Help for guidance. Most authors are mainly worried about autocorrelation in the

Re: [R] Strange R squared, possible error

2011-03-16 Thread derek
1) In my very humble opinion R^2 can't be negative, at least for data for which it sound to use linear model. Or the data would have to be utterly wrong to fit them with linear model. 2) I don't want to fit data with linear model of zero intercept. 3) I dont know if I understand correctly. Im

[R] Specify feature weights in model prediction (CARET)

2011-03-16 Thread Kendric Wang
Using the 'CARET' package, is it possible to specify weights for features used in model prediction? And for the 'knn' implementation, is there a way to choose a distance metric (i.e. Mahalanobis distance)? Thanks, ~Kendric [[alternative HTML version deleted]]

[R] Numeric vector converted mysteriously to characters in data frame?

2011-03-16 Thread Martin Ralphs
Dear R Help, I would be very grateful if somebody could explain why this is happening. I am trying to plot a lattice barchart of a vector of numbers with age bandings that I have brought together into a data frame. When I plot the variables in their raw vector form, it works. When I try to

Re: [R] Saving summary outputs in a table form

2011-03-16 Thread Haillie
Thank you very much! I will check out help page for extraction operator. Many thanks, Haillie -- View this message in context: http://r.789695.n4.nabble.com/Saving-summary-outputs-in-a-table-form-tp3381959p3383316.html Sent from the R help mailing list archive at Nabble.com.

[R] rJava software

2011-03-16 Thread LCOG1
Hey everyone, I just saw a demonstration of a model that is built entirely in R that allows for transportation greenhouse gas related scenario testing and it used an awesome GUI utilizing iplots, rJava and gWidgets libraries. Very cool stuff. I am a somewhat seasoned R user but cannot seem

Re: [R] How to read Cumulative proportion in using princomp?

2011-03-16 Thread ian_zhangty
THANK U VERY MUCH!! -- View this message in context: http://r.789695.n4.nabble.com/How-to-read-Cumulative-proportion-in-using-princomp-tp3381881p3383396.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] linear regression in a data.frame using recast -- A fortunes candidate??

2011-03-16 Thread Abhijit Dasgupta, PhD
Seconded On 03/16/2011 05:37 PM, Bert Gunter wrote: Ha! -- A fortunes candidate? -- Bert If this is really a time series, then you will have serious validity problems due to auto-correlation among non-independent units. (But if you are just searching for a way to pull the wool over the eyes

Re: [R] Specify feature weights in model prediction (CARET)

2011-03-16 Thread Max Kuhn
Using the 'CARET' package, is it possible to specify weights for features used in model prediction? For what model? And for the 'knn' implementation, is there a way to choose a distance metric (i.e. Mahalanobis distance)? No, sorry. Max __

Re: [R] Need to abstract changing name of column within loop

2011-03-16 Thread David Winsemius
On Mar 16, 2011, at 7:58 PM, jctoll wrote: Hi, I'm struggling to figure out the way to change the name of a column from within a loop. The problem is I can't refer to the object by its actual variable name, since that will change each time through the loop. My xts object is A. head(A)

Re: [R] Need to abstract changing name of column within loop

2011-03-16 Thread jctoll
On Wed, Mar 16, 2011 at 8:20 PM, David Winsemius dwinsem...@comcast.net wrote: On Mar 16, 2011, at 7:58 PM, jctoll wrote: Hi, I'm struggling to figure out the way to change the name of a column from within a loop.  The problem is I can't refer to the object by its actual variable name,

Re: [R] Strange R squared, possible error

2011-03-16 Thread Ben Bolker
On 11-03-16 07:55 PM, Peter Ehlers wrote: On 2011-03-16 15:02, Ben Bolker wrote: JLuckeat ria.buffalo.edu writes: lm(y~x+0) yields the regression on x without the constant, i.e., y=bx+e, not y = a +e derekjan.kacabaat gmail.com Sent by: r-help-bouncesat r-project.org 03/16/2011

[R] date conversion

2011-03-16 Thread Erin Hodgess
Dear R People: I have a monthly time series which runs from January 1998 to December 2010. When I use tsp I get the following: tsp(ibm$ts) [1] 1998.000 2010.917 12.000 Is there an easy way to convert this to a seq.Date object, please? I would like to have something to the effect of

Re: [R] date conversion

2011-03-16 Thread Joshua Wiley
Hi Erin, I am not sure what a seq.Date object is. My first thought is that you are talking about the date method for seq(), but there are hundreds of packages I do not know. In any case, here is what I think you want. Josh ## A small example is always nice dat - ts(1:12, frequency = 12,

Re: [R] Numeric vector converted mysteriously to characters in data frame?

2011-03-16 Thread Jim Holtman
take a look at what the output of your cbind is; my guess is that it is a character matrix. you probably want to do data.frame(...,...,...) without the cbind. Sent from my iPad On Mar 16, 2011, at 18:12, Martin Ralphs martin.ral...@gmail.com wrote: Dear R Help, I would be very grateful

Re: [R] Strange R squared, possible error

2011-03-16 Thread Bert Gunter
On Wed, Mar 16, 2011 at 4:00 PM, derek jan.kac...@gmail.com wrote: 1) In my very humble opinion R^2 can't be negative, at least for data for which it sound to use linear model. !!! Your opinion, humble or not, counts for nothing. Thomas stated a mathematical fact. I suggest you make an effort

Re: [R] date conversion

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 10:22 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: I have a monthly time series which runs from January 1998 to December 2010. When I use tsp I get the following: tsp(ibm$ts) [1] 1998.000 2010.917   12.000 Is there an easy way to convert this to

Re: [R] date conversion

2011-03-16 Thread David Winsemius
On Mar 16, 2011, at 10:22 PM, Erin Hodgess wrote: Dear R People: I have a monthly time series which runs from January 1998 to December 2010. When I use tsp I get the following: tsp(ibm$ts) [1] 1998.000 2010.917 12.000 Is there an easy way to convert this to a seq.Date object,

Re: [R] Subset using grepl

2011-03-16 Thread Kang Min
I have a new question, also regarding grepl. I would like to subset rows with numbers from 1 to 5 in the section column, so I used subset(data, grepl([1:5], section)) but this gave me rows with 10, 1 and 5. (Why is this so?) So I tried subset(data, grepl([1,2,3,4,5], section)) which worked.

[R] Why doesn't this work ?

2011-03-16 Thread eric
Why doesn't this work and is there a better way ? z -ifelse(t==1 || 2 || 3, 1,0) t -3 z [1] 1 t -4 z [1] 1 trying to say ...if t == 1 or if t== 2 or if t ==3 then true, otherwise false -- View this message in context: http://r.789695.n4.nabble.com/Why-doesn-t-this-work-tp3383656p3383656.html

Re: [R] Why doesn't this work ?

2011-03-16 Thread Bill.Venables
It doesn't work (in R) because it is not written in R. It's written in some other language that looks a bit like R. t - 3 z - t %in% 1:3 z [1] TRUE t - 4 z - t %in% 1:3 z [1] FALSE -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

Re: [R] Why doesn't this work ?

2011-03-16 Thread Phil Spector
Eric - What you mean to say is t - 3 z - ifelse(t %in% c(1,2,3),1,0) z [1] 1 t - 4 z - ifelse(t %in% c(1,2,3),1,0) [1] 0 Expressions don't recalculate themselves when you change the value of a variable that they use. For that, you would need a function: makez = function(t)ifelse(t

Re: [R] Subset using grepl

2011-03-16 Thread Bill.Venables
subset(data, grepl([1-5], section) !grepl(0, section)) BTW grepl([1:5], section) does work. It checks for the characters 1, :, or 5. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Kang Min Sent: Thursday, 17 March 2011

Re: [R] help files for a function

2011-03-16 Thread Joshua Wiley
Hi Erin, There is no appropriate directory until you have a package. Until the package is built, R will not access and use the help documentation. So I guess the answer is, wherever it is convenient for you to find and edit as your function develops until the time when you put it in one of your

Re: [R] model fine, predict gives an error

2011-03-16 Thread Antje Niederlein
Anybody who can help me with this issue? On 15 March 2011 14:15, Antje Niederlein niederlein-rs...@yahoo.de wrote: Hi there, I try to model some dose response curves (drc-package). In most cases it is fine but now I got some data which produces me the following error:

Re: [R] adding linear regression data to plot

2011-03-16 Thread Mohamed Lajnef
Hi Jan, If you want to plot the fitted values of lm function, you can use abline function ? abline ( te get help) Regrads M Le 15/03/11 23:26, derek a écrit : Hello R, I would like to print regression data in graph. I mean the output from: k=lm(formula,data) summary(k) Or somehow

[R] Fitting / Distributions

2011-03-16 Thread Rahul Kaura
    I have the following : a sequence of security returns and their probabilities e.g.   Security Returns / Probability of Event :  10% Return with 50% probability -5% Return with 10% probability 3% return with 10% probability 15% return with 10% probability   I can calculate the mean and the

[R] how do we read netcdf / hdf files in R?

2011-03-16 Thread Yogesh Tiwari
Dear R Users, How do we read netcdf / hdf format files in R ? Also, can we convert netcdf to hdf format in R? Great Thanks, Best Regards, Yogesh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Removing Bad Data

2011-03-16 Thread Rahul Kaura
    I created a couple of timeSeries objects - when I was merging them , I got an error. Looking at the data , I see that one of the time series has   06/30/2007  0.0028   0.0183  0.0122  0.0042  0.0095    -  07/31/2007 -0.0111   0.0255  0.0096 -0.0069 -0.0024  0.0043 

Re: [R] Reporting odds ratios or risk ratios from GLM

2011-03-16 Thread lafadnes
Thanks a lot! The following strategy as you suggested worked fine: OR - exp(coef(GLM.2)[-1]) OR.ci - exp(confint(GLM.2)[-1,]) OR OR.ci -- View this message in context: http://r.789695.n4.nabble.com/Reporting-odds-ratios-or-risk-ratios-from-GLM-tp3357209p3381020.html Sent from the R help

Re: [R] how do we read netcdf / hdf files in R?

2011-03-16 Thread Allan Engelhardt
Try the ncdf, ncdf4, and hdf5 packages from CRAN. (I have never used the hdf format, but the ncdf4? packages seem to work well.) Allan On 16/03/11 07:25, Yogesh Tiwari wrote: Dear R Users, How do we read netcdf / hdf format files in R ? Also, can we convert netcdf to hdf format in R?

Re: [R] Removing Bad Data

2011-03-16 Thread Mario Valle
s - read.table('d.dat', na.strings='-') On 16-Mar-11 06:45, Rahul Kaura wrote: 06/30/2007 0.0028 0.0183 0.0122 0.0042 0.0095- 07/31/2007 -0.0111 0.0255 0.0096 -0.0069 -0.0024 0.0043 08/31/2007 -0.0108 -0.0237 -0.0062 -0.0138 -0.0173

Re: [R] how do we read netcdf / hdf files in R?

2011-03-16 Thread Allan Engelhardt
(For hdf5 you might want to try the development version at http://xweb.geos.ed.ac.uk/~hcp/Rhdf5 which improves error handling, cf. this thread: https://stat.ethz.ch/pipermail/r-devel/2011-March/060111.html .) Allan On 16/03/11 08:53, Allan Engelhardt wrote: Try the ncdf, ncdf4, and hdf5

Re: [R] Removing Bad Data

2011-03-16 Thread Mario Valle
To recover also the date: x- read.table('d.dat', na.strings='-') x$V1- as.Date(x$V1, %m/%d/%Y) Hope it helps mario On 16-Mar-11 06:45, Rahul Kaura wrote: I created a couple of timeSeries objects - when I was merging them , I got an error. Looking at the data

[R] One to One Matching multiple vectors

2011-03-16 Thread Vincy Pyne
Dear R helpers Suppose, x = c(0,  1,  2,  3) y = c(A, B, C, D) z = c(1, 3) For given values of z, I need to the values of y. So I should get B and D. I tried doing y[x][z] but it gives y[x][z] [1] A C Kindly guide. Regards Vincy [[alternative HTML version deleted]]

Re: [R] One to One Matching multiple vectors

2011-03-16 Thread Nick Sabbe
Hello Vincy. You probably want y[match(z,x)] Or, more instructional: whereAreZInX-match(z, x) y[whereAreZInX] HTH, Nick Sabbe -- ping: nick.sa...@ugent.be link: http://biomath.ugent.be wink: A1.056, Coupure Links 653, 9000 Gent ring: 09/264.59.36 -- Do Not Disapprove -Original

Re: [R] One to One Matching multiple vectors

2011-03-16 Thread Erich Neuwirth
y[which(x %in% z)] On 3/16/2011 10:42 AM, Vincy Pyne wrote: Dear R helpers Suppose, x = c(0, 1, 2, 3) y = c(A, B, C, D) z = c(1, 3) For given values of z, I need to the values of y. So I should get B and D. I tried doing y[x][z] but it gives y[x][z] [1] A C

Re: [R] Serial Date

2011-03-16 Thread Gabor Grothendieck
On Tue, Mar 15, 2011 at 11:42 PM, Raoni Rosa Rodrigues raonir...@yahoo.com.br wrote: Hello Mr. Grothendieck, thanks for your reply! Text book that I use (Spector, 2008) dind't comment about this feature of chron function... I just don't understand why we have 10957 days of difference

Re: [R] Does R have a const object?

2011-03-16 Thread Allan Kamau
On Wed, Mar 16, 2011 at 6:47 AM, Thomas Lumley tlum...@uw.edu wrote: Actually, you can do this using locked bindings.  Look at ?lockBinding Locked bindings are how namespaces get const function definitions, and active bindings (on the same help page) are how R CMD check notices that you are

Re: [R] how to set the starting value in lme

2011-03-16 Thread Daniel Kaschek
Hi Jia, in order to test if the failing parameter estimation really has to do with wrong initial values, you could first simulate data with your mixed effects model. Just assume parameters, produce a data set with these parameters, add noise and look if you can estimate the parameters correctly

Re: [R] How to read only specified columns from a data file

2011-03-16 Thread Luis Ridao
David, Thanks for your tip but it seems I'm having problems with the number of columns R manages to read in. Below it s an example of the data read in: inp[1:20,] V1 V2V3 V4 V5 V6 V7 V8 V9 1 1. log_fy_coff -1.007600 0.119520 1. NA

<    1   2