Re: [R] Convert COLON separated format

2012-10-08 Thread Rui Barradas
Hello, Here's a function that doesn't do it all but might help. fun <- function(x){ x1 <- unlist(strsplit(x, " ")) x2 <- x1[nchar(x1) > 0] i <- as.integer(x2[1]) x3 <- unlist(strsplit(x2[-1], ":")) j <- as.integer(x3[rep(c(TRUE, FALSE), length(x3)/2)]) y <- numeric(max(j)

Re: [R] System/SUR equations and panel

2012-10-08 Thread Arne Henningsen
Hi Alok On 3 October 2012 17:28, Alok K Bohara, PhD wrote: > I was wondering if there is any R package to estimate a two-or three > equation system in a panel setting. > > Say, I have 100 firms and their expenditure on wind generated power and > solar-generated power. > > S_i = X1_i*b1 + u1_i > W

Re: [R] How to create a table with borders?

2012-10-08 Thread Duncan Mackay
Hi I just had a look at the latex component - \toprule I think is from the booktabs package so you may need \usepackage{booktabs} in the latex preamble to use \toprule and \bottomrule Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NS

Re: [R] Convert COLON separated format

2012-10-08 Thread Hasan Diwan
Mr Silverman, On 9 October 2012 00:56, Noah Silverman wrote: > I have a bunch of data sets that were created for the libsvm tool. They > are in "colon separated sparse format". > Is there a simple way to do this? > Use read.table with a sep of ':' and let me know how you get on. -- H -- Sent

Re: [R] How to create a table with borders?

2012-10-08 Thread arun
HI, Saw your reply in Nabble. For Windows, you can install "MiKTeX" (http://miktex.org/).  Please go through this link (http://educ.jmu.edu/~taalmala/245_2005post/miktex/miktex_setup.html) for setting up MiKTeX .  You can compile the code either from command line or directly from TeXworks

[R] Convert COLON separated format

2012-10-08 Thread Noah Silverman
I have a bunch of data sets that were created for the libsvm tool. They are in "colon separated sparse format". i.e. 1 5:1 27:3 345:10 Is a row with the label of "1" and only has values in columns 5, 27, and 345. I want to read these into a data.frame in R. Is there a simple way to do t

Re: [R] Modern Symbolic debugger for R programmes?

2012-10-08 Thread Gabor Grothendieck
On Tue, Oct 9, 2012 at 12:12 AM, Worik R wrote: > I think I am whistling in the wind, but is there a modern symbolic > debugger for R programmes? > > I am working through some one else's code, thousands of lines, that > has the occasional bug in it, and a lot in my understanding of it. > > I cann

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of liang@us.pwc.com > Sent: Tuesday, October 09, 2012 2:50 AM > To: r-help@r-project.org > Subject: Re: [R] How to use Lines function to draw the error bars? > > one extra q

[R] Modern Symbolic debugger for R programmes?

2012-10-08 Thread Worik R
I think I am whistling in the wind, but is there a modern symbolic debugger for R programmes? I am working through some one else's code, thousands of lines, that has the occasional bug in it, and a lot in my understanding of it. I cannot make setBreakpoint or findLineNum work. I get "No source

Re: [R] svyhist

2012-10-08 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Thomas, Sorry about my repeat typo in the line () function, which caused the distortion of the line that did not match in the earlier graph. The revised code gives me the graphs that look lot better (please see the attachment). Thank you for catching that mistake and also for providing clarif

Re: [R] Up key is not the previous command

2012-10-08 Thread Peter Langfelder
run capabilities(what="cledit") in your R terminal session. If you get FALSE, your R was compiled without command line editing support which you need for the "up arrow" action. Peter On Mon, Oct 8, 2012 at 8:04 PM, Tjun Kiat Teo wrote: > I am using R on Fedora 17 and the up arrow is not the pr

[R] Up key is not the previous command

2012-10-08 Thread Tjun Kiat Teo
I am using R on Fedora 17 and the up arrow is not the previous command. On my command line on my terminal, the up arrow is the previous command Tjun Kiat __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] PKPD modelling in R

2012-10-08 Thread Ben Bolker
Marc Schwartz me.com> writes: > > On Oct 8, 2012, at 10:04 AM, "Kozielska-Reid MA, Magdalena" pl.hanze.nl> wrote: > > > > > Dear all, > > > > I have two questions: > > > > 1. Does anyone know if nlmeODE package will work once > odesolve is discontinued? If i understand well > nlmeODE depen

Re: [R] converting DOB format to age

2012-10-08 Thread arun
Hi, Try either of these: DOB1<-"08/22/1976"  as.numeric(format(as.Date(Sys.time()),format="%Y"))-as.numeric(format(as.Date(DOB1,format="%m/%d/%Y"),format="%Y")) #[1] 36 library(zoo) as.numeric(gsub(".*\\s","",as.yearmon(Sys.time(-as.numeric(gsub(".*\\s","",as.yearmon(DOB1,format="%m/%d/%Y")))

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 5:49 PM, liang@us.pwc.com wrote: > one extra question > > How do I export the final image (with plots and lines added) into files in > a batch mode for a bunch of regressions? You probably need to review: ?Devices ?BATCH -- David. > > thanks > > > - Forwarded

Re: [R] why does R stepAIC keep unsignificant variables?

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 5:43 PM, liang@us.pwc.com wrote: > Ran a bunch of variables in R and the final result of StepAIC is as below: > Why are the first 5 variables kept in the stepwise result?? Are the last > 4 variables finally chosen after Stepwise? Thanks > > Coefficients: > Estimate Std

Re: [R] 3d polar coordinates in rgl function view3d()

2012-10-08 Thread Duncan Murdoch
On 12-10-08 7:12 PM, Peter Rossi wrote: Dear all: I'm enjoying using rgl and I want to set a specific viewpoint. I understand that view3d() will do so by setting the 3d polar coordinate angles, theta and phi. That's incorrect, see below. In standard polar coordinates, theta is the angle aw

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread liang . che
one extra question How do I export the final image (with plots and lines added) into files in a batch mode for a bunch of regressions? thanks - Forwarded by Liang Che/US/TLS/PwC on 10/08/2012 08:48 PM - From: Liang Che/US/TLS/PwC To: Joseph Clark @INTL Cc: r-help@r-project.o

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread liang . che
thank you all for your answers i have figured out the plot i wanted - it was actually pretty easy lines(x=20:34,prd[,1],col="red",Ity=1) lines(x=20:34,prd[,2],lty=2) lines(x=20:34,prd[,3],lty=2) From: Joseph Clark To: Liang Che/US/TLS/PwC@Americas-US Cc: Date: 10/08/2012 05:30

[R] why does R stepAIC keep unsignificant variables?

2012-10-08 Thread liang . che
Ran a bunch of variables in R and the final result of StepAIC is as below: Why are the first 5 variables kept in the stepwise result?? Are the last 4 variables finally chosen after Stepwise? Thanks Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.315e-01 2.687e-01 0.490 0.6361

Re: [R] svyhist

2012-10-08 Thread Thomas Lumley
The line isn't a theoretical distribution, it's a kernel density estimator and so should match your histogram. It looks as though you use exactly the same call lines (svysmooth(~dthage, bandwidth=5,subset(nhis, xspd2=='No SPD')), lwd=2) for each plot, which gives a smooth curve estimating the a

Re: [R] Need some help reproducing a graph

2012-10-08 Thread Rui Barradas
Hello, Try qq <- qnorm(0.975) x <- 90 + c(-1, 1)*qq*10 f <- function(x) dnorm(x, 90, 10) curve(f, from = 60, to = 120) segments(x, 0, x, f(x)) Hope this helps, Rui Barradas Em 09-10-2012 00:48, dLevy escreveu: Its not homework, it is a seminar exercise that I need to complete in order to l

Re: [R] Robust regression for ordered data

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 5:17 PM, Eiko Fried wrote: >> It **might** also help the OP clarify his intent in >> exactly the way you describe (or not). > > > My intent is to perform a linear regression on a metric dependent variable. What do you mean by "a metric dependent variable"? > Unfortunately,

Re: [R] Missing data (Na) and chi-square tests

2012-10-08 Thread Rui Barradas
Hello, Also, since the values are always 0/1, this should also do it. with( dat, table( Rash, Hypotension ) ) Hope this helps, Rui Barradas Em 09-10-2012 00:36, David Winsemius escreveu: On Oct 8, 2012, at 9:06 AM, Rerda wrote: Dear Rui and David Thank you very much for taking your time to

Re: [R] Missing data (Na) and chi-square tests

2012-10-08 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David Winsemius > Sent: Monday, October 08, 2012 4:37 PM > To: Rerda > Cc: r-help@r-project.org > Subject: Re: [R] Missing data (Na) and chi-square tests > > > On Oct 8, 2012, a

Re: [R] Robust regression for ordered data

2012-10-08 Thread Eiko Fried
> It **might** also help the OP clarify his intent in > exactly the way you describe (or not). My intent is to perform a linear regression on a metric dependent variable. Unfortunately, two key assumptions - normal distribution and homoscedasticity - cannot be met. I read that using a robust reg

Re: [R] Need some help reproducing a graph

2012-10-08 Thread dLevy
Its not homework, it is a seminar exercise that I need to complete in order to learn enough in order to take the home exam next month. There are no lecture slides, just a generic textbook in R for bio statistics. Ive been trying to solve this problem for almost a week now but I am stuck. -- View

Re: [R] How can I write the square root symbol in an axes label?

2012-10-08 Thread William Dunlap
plot(1:10, ylab=bquote(sqrt(abs("Standardized Residuals" Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of 21rosit > Sent: Monday, October 08, 2012 3:42 PM > To: r-h

Re: [R] How can I write the square root symbol in an axes label?

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 3:42 PM, 21rosit wrote: > > > How can I write the square root symbol in an axes label like in the attached > picture? ?plotmath plot(1,1, xlab=expression( sqrt("Square Root Argument")) ) David Winsemius, MD Al

Re: [R] warning in summary(aov())

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 12:29 PM, Jhope wrote: > Hi Michael, > > I am very willing to subscribe to where you think is appropriate but I > thought I was subscribed. > > I have a password that I can log into Nabble with and I receive update > emails from the R-help forum constantly in to my inbox

Re: [R] converting DOB format to age

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 11:26 AM, farnoosh sheikhi wrote: > Hi, > > I have a column of DOB in mm/dd/. I want to convert this format to age. > Thanks a lot. ?strptime ?as.Date -- David Winsemius, MD Alameda, CA, USA __ R-help@r-project.org mailing l

Re: [R] Missing data (Na) and chi-square tests

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 9:06 AM, Rerda wrote: > Dear Rui and David > Thank you very much for taking your time to look at my problem. > However, I still cannot seem to figure it out. > > I think that you David are corect in your assumption of how my data is > structured. The data in the two columns th

Re: [R] Need some help reproducing a graph

2012-10-08 Thread Bert Gunter
Homework? We don't do homework here. Bert Sent from my iPhone -- please excuse typos. On Oct 8, 2012, at 4:20 PM, dLevy wrote: > > > > I need to replicate this graph. It is a simple normal distribution-curve > with mean 90 and sd=10. The

Re: [R] Need some help reproducing a graph

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 2:43 PM, dLevy wrote: > > > > I need to replicate this graph. It is a simple normal distribution-curve > with mean 90 and sd=10. The vertical bars is the 95% confidence limit of the > mean. How on earth do I add those c

[R] 3d polar coordinates in rgl function view3d()

2012-10-08 Thread Peter Rossi
Dear all: I'm enjoying using rgl and I want to set a specific viewpoint. I understand that view3d() will do so by setting the 3d polar coordinate angles, theta and phi. In standard polar coordinates, theta is the angle away from the X axis in the X-Y plane and phi (inclination angle) is the ang

[R] How to create a table with borders?

2012-10-08 Thread killerkarthick
Hi.. I tried to create a table with borders. But I am not able to create. I tried to use *latex()* function but it showing in a different please help me to create tables? the output comes as follows > rdata subject sex condition before afterchange 11 F plac

Re: [R] device error pdf

2012-10-08 Thread Rui Barradas
Hello, Without looking to much at your function pdfc(), it is obvious to me that the error comes not from what the function does or does not, but from not having dots '...' as a formal argument. Simply put, you can only use '...' inside a function if it's a formal argument to that function.

[R] How can I write the square root symbol in an axes label?

2012-10-08 Thread 21rosit
How can I write the square root symbol in an axes label like in the attached picture? Thanks a lot -- View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-square-root-symbol-in-an-axes-label-tp4645497.htm

[R] Need some help reproducing a graph

2012-10-08 Thread dLevy
I need to replicate this graph. It is a simple normal distribution-curve with mean 90 and sd=10. The vertical bars is the 95% confidence limit of the mean. How on earth do I add those confidence limits? Im thinking something that has to d

[R] converting DOB format to age

2012-10-08 Thread farnoosh sheikhi
Hi, I have a column of DOB in mm/dd/. I want to convert this format to age. Thanks a lot.   Best,Farnoosh Sheikhi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] warning in summary(aov())

2012-10-08 Thread Jhope
Hi Michael, I am very willing to subscribe to where you think is appropriate but I thought I was subscribed. I have a password that I can log into Nabble with and I receive update emails from the R-help forum constantly in to my inbox [R] folder. Are you referring to the Quality and Assuran

Re: [R] Missing data (Na) and chi-square tests

2012-10-08 Thread Rerda
Dear Rui and David Thank you very much for taking your time to look at my problem. However, I still cannot seem to figure it out. I think that you David are corect in your assumption of how my data is structured. The data in the two columns that I need to cross-table is either 1 or 0. I made a mi

Re: [R] turn list into dataframe

2012-10-08 Thread arun
Hi, Your output suggests that the list elements have unequal lengths.  The empty spaces will be occupied by NAs.  I am using the first three list elements from the tapply() output: list1<-list(c(2.8546, 4.0778,  5.2983,  6.3863,  7.5141,  8.5498,  9.5839, 10.6933),c(7.6810,  8.7648,  9.8382, 1

Re: [R] turn list into dataframe

2012-10-08 Thread R. Michael Weylandt
On Mon, Oct 8, 2012 at 10:49 PM, Benjamin Caldwell wrote: > Dear R users, > > I'm starting to use 'apply' functions rather than for loops in R, and > sometimes the output is a bit different than what I want. In this case, the > command was > > > tapply(myvector,myindex,cumsum) > > And the output w

[R] turn list into dataframe

2012-10-08 Thread Benjamin Caldwell
Dear R users, I'm starting to use 'apply' functions rather than for loops in R, and sometimes the output is a bit different than what I want. In this case, the command was tapply(myvector,myindex,cumsum) And the output was something like this: $`SNRL1 Core 120` [1] 2.8546 4.0778 5.2983 6.3

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread Joseph Clark
I don't have any experience with "predict", but if it returns a data frame, just capture that data frame and refer to the columns as vectors. mydata <- predict(...)plotCI( 1:nrow(mydata), y=mydata$fit, ui=mydata$upr, li=mydata$lwr ) That seems easier to me. // joseph w. clark , visiting rese

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread David L Carlson
If you had provided reproducible code, you would already have your answer. You should spend a few hours with one or more of the freely available R tutorials. In your original post you have the line: prd<-predict.lm(fit,newdata,interval=c("confidence"),level=0.95) ?predict.lm tells you that the fu

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread liang . che
Thanks since the 'lwr' and 'upr' are produced from the 'predict' function, do I need to convert the table into a data frame, then define the 'lwr' and 'upr' as the objects? upr<-data.frame(prd[,3]) fix(upr) lwr<-data.frame(prd[,2]) fix(lwr) y<-data.frame(prd[,1]) fix(y) plotCI(x=1:15,y=y,uiw=u

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread Joseph Clark
In my example code, 'fit' and 'upr' and 'lwr' are just the names of the data vectors you gave as an example. If those names aren't correct, change them to what you're actually using. You can also assign your x values to x. // joseph w. clark , visiting research associate \\ university of nebr

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread liang . che
thank you all plotCI is probably the closest to what I wanted to do -- draw the Confidence Interval curves around the fitted values (fit) but I got the following wrong message while I tried plotCI? Error in plotCI(x = 1:15, y = fit, ui = upr, li = lwr) : object 'upr' not found From:

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread Joseph Clark
I typically use the function "plotCI" from the "plotrix" package for confidence intervals or error bars.The code would be: library(plotrix)plotCI( x=1:15, y=fit, ui=upr, li=lwr) // joseph w. clark , visiting research associate \\ university of nebraska at omaha - school of IS&T > To: r-help@r

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread Rui Barradas
Hello, Do you want to use the lines function or do you want to draw error bars? The two are not the same, error bars are usualy drawn with function arrows(). The trick is in argument 'angle', set it to 90 degreesand have square arrow heads. dat <- read.table(text=" fit lwr

Re: [R] How to use Lines function to draw the error bars?

2012-10-08 Thread liang . che
Thanks -- I got this message: Error in stripchart.default(x1, ...) : invalid plotting method From: Bita Shams To: Liang Che/US/TLS/PwC@Americas-US Date: 10/08/2012 03:41 PM Subject:Re: [R] How to use Lines function to draw the error bars? try this : plot(new,prd[,3],co

Re: [R] weighted cumulative distribution with ggplot2

2012-10-08 Thread Francesco
thank you very much David, I will have a look at your idea Best, On 8 October 2012 19:24, David Winsemius wrote: > > On Oct 8, 2012, at 10:12 AM, David Winsemius wrote: > >> >> On Oct 8, 2012, at 9:18 AM, David Winsemius wrote: >> >>> >>> On Oct 8, 2012, at 8:01 AM, Francesco wrote: >>> I th

[R] time series data failing ncv test

2012-10-08 Thread liang . che
For a set of data showing seasonality (related to the 4th quarter), ncv test in R shows p-value of 0.008 which rejects the null hypothesis of constant-variance. How to apply White's standard error in R? thanks __ The i

[R] How to use Lines function to draw the error bars?

2012-10-08 Thread liang . che
fit lwrupr 1 218.4332 90.51019 346.3561 2 218.3906 90.46133 346.3198 3 218.3906 90.46133 346.3198 4 161.3982 44.85702 277.9394 5 192.4450 68.39903 316.4909 6 179.8056 56.49540 303.1158 7 219.5406 91.52707 347.5542 8 162.6761 46.65760 278.6945 9 193.8506 70.59

Re: [R] warning in summary(aov())

2012-10-08 Thread R. Michael Weylandt
On Mon, Oct 8, 2012 at 10:03 AM, Jhope wrote: > Thank you for letting me know. It may be where I hit reply but I typically > hit the latest comment. I'm sorry but I only know how to post my Q on > nabble. If there is another way to post, please let me know. > > Thanks, Jean You are strongly rec

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Berend Hasselman
On 08-10-2012, at 18:00, Mike Spam wrote: > Great, works perfekt now! > Thanks for your fast help! See this discussion for a variety of solutions: http://r.789695.n4.nabble.com/matching-a-sequence-in-a-vector-td4389523.html#a4393453 (or here https://stat.ethz.ch/pipermail/r-help/2012-February/3

Re: [R] weighted cumulative distribution with ggplot2

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 10:12 AM, David Winsemius wrote: > > On Oct 8, 2012, at 9:18 AM, David Winsemius wrote: > >> >> On Oct 8, 2012, at 8:01 AM, Francesco wrote: >> >>> I think I have my answer... ggplot2 uses ecdf which does NOT allow >>> weightings... >>> so there is no warning or error, but

Re: [R] weighted cumulative distribution with ggplot2

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 9:18 AM, David Winsemius wrote: > > On Oct 8, 2012, at 8:01 AM, Francesco wrote: > >> I think I have my answer... ggplot2 uses ecdf which does NOT allow >> weightings... >> so there is no warning or error, but still the resulting plot do not >> take into account the command w

Re: [R] weighted cumulative distribution with ggplot2

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 8:01 AM, Francesco wrote: > I think I have my answer... ggplot2 uses ecdf which does NOT allow > weightings... > so there is no warning or error, but still the resulting plot do not > take into account the command weight=weight It was completely unclear why you expected ggplot

Re: [R] PKPD modelling in R

2012-10-08 Thread Marc Schwartz
On Oct 8, 2012, at 10:04 AM, "Kozielska-Reid MA, Magdalena" wrote: > > Dear all, > > I have two questions: > > 1. Does anyone know if nlmeODE package will work once odesolve is > discontinued? If i understand well nlmeODE depends on odesolve. > 2. Can anyone suggest another package I could u

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Mike Spam
Great, works perfekt now! Thanks for your fast help! Nico 2012/10/8 David L Carlson : > Building on Jessica and Steve's use of embed: > >> X <- c(NA, 1, NA, 1, 1, 1, 1, 1, 1, NA, 1) >> Z <- rowSums(embed(X, 3)) >> Z[is.na(Z)] <- 1 >> Z > [1] 1 1 1 3 3 3 3 1 1 > >

Re: [R] Update CSV file content

2012-10-08 Thread Hasan Diwan
Mr Akkara, On 8 October 2012 05:20, Rantony wrote: > > Here i have a csv file, it contain like this > > NAME UPDATED > - -- > ABCINDIA > XYZ UK > > My requirement what is, i need to change the value inside the csv file > (instead of INDIA i need to make it

Re: [R] Graphs using R

2012-10-08 Thread PIKAL Petr
Hi homework? No homewok policy here. You can check e.g. ggplot2 package Regards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Nethal Jajo > Sent: Monday, October 08, 2012 10:27 AM > To: r-help@R-project.org > Subject

[R] Diagnostic testing in a VEC

2012-10-08 Thread Laura Catalina Echeverri Guzmán
Hi everyone, I'm using the Johansen framework to determine a VEC using package urca. I have estimated the corresponding VEC using likelihood ratio test for restrictions on alpha, beta or both and I have generated objects of the class cajo.test. Now I want to diagnostic tests in the model, like het

Re: [R] curve fitting an exponential function

2012-10-08 Thread giuseppe calamita
Hi Waltenegus, you should consider to show us your code and the data you used to fit the curve. If you can't or if you prefer you can simply show the code and some sample data on which the code can be run. You'll find nice and useful tool in nlstools package. Hope this help Giuseppe - Gius

[R] PKPD modelling in R

2012-10-08 Thread Kozielska-Reid MA, Magdalena
Dear all, I have two questions: 1. Does anyone know if nlmeODE package will work once odesolve is discontinued? If i understand well nlmeODE depends on odesolve. 2. Can anyone suggest another package I could use to fit complex PKPD models (described using differential equations) to data? Tha

[R] Best method for comparing rectangles sections of beach

2012-10-08 Thread Jhope
Hi R-listers, I am trying to compare sections of the beach separated from the HTL to the Veg (east to west), separated into indices (-5 to 30m), HTLIndex. Cross parallel (north to south) are major beach sections (Rayos 1, 2, 3, 4 and MNB). I am thinking to do an ANOVA for each independent rectan

Re: [R] gbm package: plotting a single tree

2012-10-08 Thread pcaplat
ElenaC wrote > Is there a method for doing these plots within the gbm package? If not, > can the info for a single tree be converted into a different tree object > with a method for plotting? (i.e., is it possible to convert the data into > an object of class 'rpart'?) Hi Elena and all, I notice n

[R] Update CSV file content

2012-10-08 Thread Rantony
Hi, Here i have a csv file, it contain like this NAME UPDATED - -- ABCINDIA XYZ UK My requirement what is, i need to change the value inside the csv file (instead of INDIA i need to make it USA). NAME UPDATED - -- ABCUSA XY

[R] Mean SD in ANOVA Table

2012-10-08 Thread Jhope
Hi R-listers, Is there a way to get the mean SD value after creating an ANOVA table? This is what I've been using to create an anova table. > summary(aov(HSuccess ~ HTLIndex*Aeventexhumed, data=data.to.analyze)) Best, Jean -- View this message in context: http://r.789695.n4.nabble.com/M

Re: [R] Graphs using R

2012-10-08 Thread FJ M
To start: pdf("Auto_Analysis.pdf) from the R console type: ? hist For the histogram help page. If you show the R code for your data, I'll generate the actual code for the histogram. Thanks. > From: nethal.j...@sydney.edu.au > To: r-help@r-project.org > Date: Mon, 8 Oct 2012 08:26:59 + >

Re: [R] warning in summary(aov())

2012-10-08 Thread Jhope
Thank you for letting me know. It may be where I hit reply but I typically hit the latest comment. I'm sorry but I only know how to post my Q on nabble. If there is another way to post, please let me know. Thanks, Jean -- View this message in context: http://r.789695.n4.nabble.com/warning-i

Re: [R] Calculating the mean in one column with empty cells

2012-10-08 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of William Dunlap > Sent: Saturday, October 06, 2012 6:17 PM > To: David Winsemius; fxen3k > Cc: r-help@r-project.org > Subject: Re: [R] Calculating the mean in one column with e

Re: [R] weighted cumulative distribution with ggplot2

2012-10-08 Thread Francesco
I think I have my answer... ggplot2 uses ecdf which does NOT allow weightings... so there is no warning or error, but still the resulting plot do not take into account the command weight=weight Hope that helps someone, just in case ;-) On 8 October 2012 15:40, Francesco wrote: > Dear all, > > I

[R] Mininum number of resamples required to do BCa bootstrap?

2012-10-08 Thread Robert A. LaBudde
I'm using R 2.15.1 on a 64-bit machine with Windows 7 Home Premium and package 'boot'. I've found that using a number of bootstrap resamples in boot() that is less than the number of data results in a fatal error. Once the number of resamples meets or exceeds the number of data, the error disa

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread David L Carlson
Building on Jessica and Steve's use of embed: > X <- c(NA, 1, NA, 1, 1, 1, 1, 1, 1, NA, 1) > Z <- rowSums(embed(X, 3)) > Z[is.na(Z)] <- 1 > Z [1] 1 1 1 3 3 3 3 1 1 -- David L Carlson Associate Professor of Anthropology Texas A&M University College Stati

[R] arima.sim

2012-10-08 Thread J Toll
Hi, I have been using arima.sim from the stats package recently, and I'm wondering why I get different results when using what seem to be the same parameters. For example, I've given examples of three different ways to run arima.sim with what I believe are the same parameters. It's my understandin

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Jessica Streicher
> x<-c(NA , 1 ,NA, 1 , 1 , 1 , 1 , 1 ,1 ,NA , 1) > embed(x,3) [,1] [,2] [,3] [1,] NA1 NA [2,]1 NA1 [3,]11 NA [4,]111 [5,]111 [6,]111 [7,]111 [8,] NA11 [9,]1 NA1 > which(rowSums(embed(x,

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Steve Lianoglou
Ugh, typo: On Mon, Oct 8, 2012 at 10:04 AM, Steve Lianoglou wrote: > R> x <- c(NA, 1, NA, 1, 1, 1, 1, 1, 1, NA, 1) > R> e <- embed(x, e) ## Take a look at this matrix > R> r <- apply(e, 1, rle) > R> sapply(r, function(rr) rr$lengths[1]) > ## [1] 1 1 2 3 3 3 3 1 1 The 2nd param to embed

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Steve Lianoglou
Hi Mike, On Mon, Oct 8, 2012 at 9:38 AM, Mike Spam wrote: > Sorry, i just realized, that it output the sum of all vectors. I can > work with this function but it would be much faster and easier if it > would be possible to get the positions of evry match. > > example: > > NA 1 NA 1 1 1 1 1

Re: [R] variances of random effects in coxme

2012-10-08 Thread Terry Therneau
You are right, those look suspicious. What version of R and of the coxme package are you running? Later version of coxme use multiple starting estimates due to precisely this kind of problem. Also, when the true MLE is variance=0 the program purposely never quite gets there, in order to avoi

Re: [R] Survival prediction

2012-10-08 Thread Mitja Kurki
Thanks for your thoughts. 1. The function is 'somewhat' linear. Small curvature but beginning and end are similar. Off course I could fit more complex functions of time. 2. Do I really have to build (start, stop) datasets as I have time-varying covariate effect but not time-varying covariate?

Re: [R] Presence/ absence data from matrix to single column

2012-10-08 Thread Andrea Goijman
Hi all, Thanks all for the great advices! I tried two of the approaches and certainly Reshape, melt() gave me the best results in this case. I copy below part of the code and output #First approach occ2012 <- read.table("Pres_Abs_punto_2012.csv", header=TRUE,sep=",",na.strings=TRUE) occ2012[1:5,]

Re: [R] Expected number of events, Andersen-Gill model fit via coxph in package survival

2012-10-08 Thread Terry Therneau
I am interested in producing the expected number of events, in a recurring events setting. I am using the Andersen-Gill model, as fit by the function "coxph" in the package "survival." I need to produce expected numbers of events for a cohort, cumulatively, at several fixed times. My ultimate g

Re: [R] device error pdf

2012-10-08 Thread Duncan Murdoch
On 12-10-08 9:39 AM, Christian Hoffmann wrote: Hi, Iwrote 'pdfc' in analogy to 'lpr': pdfc <- function (file = "Rplot.pdf") { current.device <- dev.cur() dev.off(dev.copy(device = pdf, file = file, ...)) dev.set(current.device) print(paste(file, "generated.")) } lpr <- func

[R] time series data failing non-constant variance test

2012-10-08 Thread liang . che
For a set of data showing seasonality (related to the 4th quarter), ncv test shows p-value of 0.008 which rejects the null hypothesis of constant-variance. Currently a linear LM relationship is being applied to the data. Should white's error be used to correct the non-cons

[R] device error pdf

2012-10-08 Thread Christian Hoffmann
Hi, Iwrote 'pdfc' in analogy to 'lpr': pdfc <- function (file = "Rplot.pdf") { current.device <- dev.cur() dev.off(dev.copy(device = pdf, file = file, ...)) dev.set(current.device) print(paste(file, "generated.")) } lpr <- function (object, file = "Rplotlpr.ps", ...) { if (missing

[R] weighted cumulative distribution with ggplot2

2012-10-08 Thread Francesco
Dear all, I am trying to draw a weighted cumulative distribution (as defined here http://rss.acs.unt.edu/Rdoc/library/spatstat/html/ewcdf.html) with ggplot2 however the syntax temp<-qplot(X,weight=weight,data=data,stat = "ecdf", geom = "step",colour=factor(year)) seems not to produce exactly th

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Mike Spam
Sorry, i just realized, that it output the sum of all vectors. I can work with this function but it would be much faster and easier if it would be possible to get the positions of evry match. example: NA 1 NA 1 1 1 1 1 1 NA 1 rle returns lengths: int [1:6] 1 1 1 6 1 1 what i need would

Re: [R] Survival prediction

2012-10-08 Thread Terry Therneau
Dear All, I have built a survival cox-model, which includes a covariate * time interaction. (non-proportionality detected) I am now wondering how could I most easily get survival predictions from my model. My model was specified: coxph(formula = Surv(event_time_mod, event_indicator_mod) ~ Se

Re: [R] How to count combinations

2012-10-08 Thread arun
Hi, Another way to get the matrix with combinations of two columns: just use table() dat1<-structure(list(Env = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("23", "55", "67", "Env"), class = "factor"), place = structure(c(7L, 7L, 7L, 2

Re: [R] How to count combinations

2012-10-08 Thread arun
Hi, Not clear how you want your output in matrix: Try this: dat1<-structure(list(Env = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("23", "55", "67", "Env"), class = "factor"), place = structure(c(7L, 7L, 7L, 2L, 1L, 11L, 11L, 11L,

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Mike Spam
Hey Rui, Perfect! Thanks!! :) Nico 2012/10/8 Rui Barradas : > Hello, > > See ?rle > > Hope this helps, > > Rui Barradas > Em 08-10-2012 13:55, Mike Spam escreveu: >> >> Hi, >> >> just a simple question. >> Assumed i have a vector, >> >> FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE >> or

Re: [R] How to count combinations

2012-10-08 Thread Rui Barradas
Hello, Your dataset seems to have a problem, the first row should the columns' names. If I'm right, nms <- levels(dat[[1]])[dat[1,1]] nms[2] <- levels(dat[[2]])[dat[1,2]] dat <- dat[-1, ] names(dat) <- nms with(dat, table(Env, place)) If I'm wrong, with(dat, table(V1, V2)) Hope this help

Re: [R] Why do I get different results for type III anova using the drop1 or Anova command?

2012-10-08 Thread John Fox
Dear Christiane, I found the code and output that you attached difficult to read, but I see at least one error: I'm not sure why you think that Anova() takes a contrasts argument. It doesn't; contrasts is an argument to lm(). See ?Anova and ?lm. Here's a reproducible example that shows that you g

Re: [R] Simple - Finding vector in a vector

2012-10-08 Thread Rui Barradas
Hello, See ?rle Hope this helps, Rui Barradas Em 08-10-2012 13:55, Mike Spam escreveu: Hi, just a simple question. Assumed i have a vector, FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE or NA 1 1 1 NA 1 NA 1 NA what i need is the position where an element is the same - three (o

[R] Simple - Finding vector in a vector

2012-10-08 Thread Mike Spam
Hi, just a simple question. Assumed i have a vector, FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE or NA 1 1 1 NA 1 NA 1 NA what i need is the position where an element is the same - three (or in general multiple) times in a row. in this case: i want to get the position where it is

[R] How to count combinations

2012-10-08 Thread Nico Met
Dear all, Need a help. I would like to count combination of two columns: structure(list(V1 = structure(c(4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("23", "55", "67", "Env"), class = "factor"), V2 = structure(c(9L, 7L, 7L, 7L, 2L, 1L, 11L, 1

  1   2   >