Re: [R] Error on easy way for JoSAE Package

2012-05-16 Thread ana24maria
I have attached to this message the first 20 lines of the output for dput(amigo). Unfortunately, i can't send it the overall output. Thank you. On Wed, May 16, 2012 at 6:10 PM, David Winsemius [via R] < ml-node+s789695n4630253...@n4.nabble.com> wrote: > > On May 16, 2012, at 1:33 AM, ana24maria w

[R] hu6800cdf

2012-05-16 Thread srod
Hi, I'm using a command in bioconductor that seems to require a package called hu6800cdf. I've installed this properly but I still get the same error: Could not find array definition file ' hu6800cdf.qcdef '. Simpleaffy does not know the QC parameters for this array type. See the package vignett

Re: [R] survival survfit with newdata

2012-05-16 Thread Damjan Krstajic
Thanks David for prompt reply. I agree with you. However, I still fail to get the survfit function to work with newdata. In my previous example I changed the column names of testX matrix and I still fail. > colnames(testX)<-names(coxph.model$coefficients) > sfit<- survfit(coxph.model,newdata=d

Re: [R] extract data from square cracket

2012-05-16 Thread Marc Girondot
Le 17/05/12 03:37, Min Wang a écrit : Dear Sir or Madam, I have a question like this. I want to extract the following data from the square bracket: 1 bandband[0.86] 2 bandband[0.93] 3 noband noban

Re: [R] survival survfit with newdata

2012-05-16 Thread David Winsemius
On May 16, 2012, at 5:08 PM, Damjan Krstajic wrote: Dear all, I am confused with the behaviour of survfit with newdata option. Yes. It has the same behavior as any other newdata/predict from regression. You need to supply a dataframe with the same names as in the original formula. Doesn

[R] extract data from square cracket

2012-05-16 Thread Min Wang
Dear Sir or Madam, I have a question like this. I want to extract the following data from the square bracket: 1bandband[0.86] 2bandband[0.93] 3noband noband [0.95] 4noband

Re: [R] triangular matrices input/output

2012-05-16 Thread Rui Barradas
Hello, I needed this once. upper.diag <- function(x, byrow=FALSE){ m <- sqrt(1 + 8*length(x)) if(abs(m - floor(m)) < .Machine$double.eps^0.5) m <- (m - 1)/2 else{ warning("length of 'x' is not a triangular number.") m <- flo

Re: [R] using XML package to read RSS

2012-05-16 Thread J Toll
On Wed, May 16, 2012 at 9:02 PM, Duncan Temple Lang wrote: > Hi James. > >  Yes, you need to identify the namespace in the query, e.g. > >  getNodeSet(doc, "//x:entry", c(x = "http://www.w3.org/2005/Atom";)) > > This yeilds 40 matching nodes. > > (getNodeSet() is more convenient to use when you do

Re: [R] caret: Error when using rpart and CV != LOOCV

2012-05-16 Thread Max Kuhn
Dominik, See this line: >   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. >  30.37   30.37   30.37   30.37   30.37   30.37 The variance of the predictions is zero. caret uses the formula for R^2 by calculating the correlation between the observed data and the predictions which uses sd(pred) which

Re: [R] using XML package to read RSS

2012-05-16 Thread Duncan Temple Lang
Hi James. Yes, you need to identify the namespace in the query, e.g. getNodeSet(doc, "//x:entry", c(x = "http://www.w3.org/2005/Atom";)) This yeilds 40 matching nodes. (getNodeSet() is more convenient to use when you don't specify a function to apply to the nodes. Also, you don't need xmlRoo

[R] using XML package to read RSS

2012-05-16 Thread J Toll
Hi, I'm trying to use the XML package to read an RSS feed. To get started, I was trying to use this post as an example: http://www.r-bloggers.com/how-to-build-a-dataset-in-r-using-an-rss-feed-or-web-page/ I can replicate the beginning section of the post, but when I try to use another RSS feed

[R] subreddit for R related stuff

2012-05-16 Thread Robert M. Flight
Thought there might be some Redditors lurking on these mailing lists. I created a sub-reddit for R (and by extension Bioconductor) discussions, links, etc. http://www.reddit.com/r/Rsoftware/ This will be the first and only shameless plug. -Robert Robert M. Flight, Ph.D. University of Louisville

Re: [R] triangular matrices input/output

2012-05-16 Thread R. Michael Weylandt
Do leave the posts for anyone else who might google the same question. (I don't think you really could delete the post anyways, perhaps only on one mirror) You could probably use some combination or rev() and t() to fill by row, but I haven't thought through the geometry all the way yet. Micha

Re: [R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-16 Thread Rich Shepard
On Tue, 15 May 2012, ilai wrote: Apologies in advance if I misinterpret " R console insists that I retype ..." but actually makes more sense (than sourcing a script) to use the group argument (see the last example in ?qqmath) as in 4 groups in each of 30 panels, or allow.multiple=T, outer=T if y

Re: [R] triangular matrices input/output

2012-05-16 Thread R. Michael Weylandt
The Matrix package provides good support for many special sorts of matrices, but here it looks like you probably don't need that additional machinery for such small case: makeUpper <- function(vec, diag = FALSE){ n <- (-1 + sqrt(1 + 8*length(vec)))/2 stopifnot(isTRUE(all.equal(n, as.intege

[R] Updating Neural Networks

2012-05-16 Thread Josh Browning
Hi useR’s, I apologize if I’ve missed some documentation somewhere, but I can’t seem to find anything related to this question… For a ensemble/data-mining problem, I’m trying to train a neural network on my data set and have it output predictions (or coefficients) after varying numbers of epoch

Re: [R] trouble with ifelse statement

2012-05-16 Thread Rui Barradas
Hello, 'sample' is a really bad name for a variable, it's already taken, it's an R function. sample>1 && sample<5 # '&&' is not vectorized, it's '&' you want. # Without 'ifelse' raw.saliva.data$max.cort[index] <- raw.saliva.data$cortisol[index & sample > 1 & sample < 5] Negate this last conj

[R] triangular matrices input/output

2012-05-16 Thread casperyc
Hi, Is there any package that deals with triangular matrices? Say ways of inputting an upper (lower) triangular matrix? Or convert a vector of length 6 to an upper (lower) triangular matrix (by row/column)? Thanks! - ## PhD candidate in Statistics Big R Fan Big LEGO Fan

[R] Unable to install package

2012-05-16 Thread Rismyname
Hi, I get the following error while installing a package. Can someone please help? install.packages("memisc") Warning in install.packages : argument 'lib' is missing: using 'C:/Users/ravi/Documents/R/R-2.15.0' Warning in install.packages : downloaded length 8255 != reported length 200 Error in

Re: [R] TukeyHSD plot error

2012-05-16 Thread R. Michael Weylandt
Hmmm, I can't reproduce, but I'm not really sure why that would happen... is there any way you can test this in a --vanilla R session? (That's the UNIX-y way to start a totally clean session; not sure exactly how to achieve that on Windows) Does this happen if you just run example(TukeHSD) direc

Re: [R] error code trying to extract second column from coeftest output

2012-05-16 Thread Jeff Newmiller
I recommend that you troubleshoot your own problem using the str function... for example, str( coeftest(lmodT_WBHO)). The error message is not a "code"... it is perfectly readable English, and it is telling you that the result of calling coeftest is not a list with parts that can be pulled out u

Re: [R] trouble with ifelse statement

2012-05-16 Thread R. Michael Weylandt
It seems like your problem is that R can't find your variable "sample" and is instead finding its own sample() function which can't be compared to an integer and is giving your problem. It seems likely that sample is part of raw.saliva.data? If that's the case, change sample --> raw.saliva.data$sa

[R] variable spatial correlation

2012-05-16 Thread m p
Hello, I used "correlogram" from "spatial" package to determine correlation scale for my data but just looking with bare eye it seems that the correlation scale varies over the domain. Can someone suggest what would the best way to handle that problem? Thanks, Mark [[alternative HTML versi

Re: [R] Optimization problem

2012-05-16 Thread Greg Snow
There are a couple of options. First if you want the mean to equal 7, then that means the sum must equal 21 and therefore you can let optim only play with 2 of the variables, then set the 3rd to be 21-s1-s2. If you want the mean to be greater than 7 then just put in a test, if the mean is less th

Re: [R] clusters in zero-inflated negative binomial models

2012-05-16 Thread Ben Bolker
Lies Durnez itg.be> writes: > I want to build a model in R based on animal collection data, that look like the following > > NrVillage DistrictSiteSurvey Species Count > 1 AX A F Dry B 0 > 2 AY A V Wet A 5 > 3 BX

[R] survival survfit with newdata

2012-05-16 Thread Damjan Krstajic
Dear all, I am confused with the behaviour of survfit with newdata option. I am using the latest version R-2-15-0. In the simple example below I am building a coxph model on 90 patients and trying to predict 10 patients. Unfortunately the survival curve at the end is for 90 patients. Could som

[R] trouble with ifelse statement

2012-05-16 Thread Melissa Rosenkranz
Hello, I apologize in advance for not providing sample data, I'm a very new to R and can't easily generate appropriate sample data quickly. I'm hoping someone can offer advice without it. This code below works and does what I want it to do, which is for a given row in my dataframe, where the vari

Re: [R] finding mean and SD for a log-normal distribution

2012-05-16 Thread peter dalgaard
On May 16, 2012, at 12:37 , Andras Farkas wrote: > Dear R Expert > > allow me to ask a quick qestion: I have a mean value of 6 and a SD of 3 > describing my distribution. I would like to "convert" this distribution into > a log normal distribution that would best describe it when resimulated

[R] Scraping a web page.

2012-05-16 Thread Keith Weintraub
Duncan, Thanks for the advice. It turns out that the web pages are pretty well behaved. I ended up using readHTMLTable str_select grep gsub readLines When I have time I am going to convert my code to use the html parser and the more robust getNodeSet method that you mention below. Thanks fo

Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread David Winsemius
On May 16, 2012, at 12:27 PM, aramos wrote: Thanks, I've already done that!! But the illustration for how you get the statistics is in the code. Describe what you want: number of samples, two versus single sided, two sample versus comparing to theory, which table columns should be used.

[R] Getting reliable financial ratios

2012-05-16 Thread Keith Weintraub
Check out this site: http://www.gummy-stuff.org/Yahoo-data.htm It shows how to download a .csv file with the data you might want. Here is an example URL: http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yrr2 The "r2" in the above URL means P/E ratio. You should be able to

[R] error code trying to extract second column from coeftest output

2012-05-16 Thread rl269
I want to use the standard error values in the summary that is produced using coeftest, but I am getting an error code- any ideas? > library(lmtest) > coeftest(lmodT_WBHO) t test of coefficients: Estimate Std. Error t value Pr(>|t|) t1W 5.948190.17072 34.8410 < 2.2e-16 *** t2W 6.5

[R] TukeyHSD plot error

2012-05-16 Thread Bret Jagger
Hi, I am seeking help with an error when running the example from R Documentation for TukeyHSD. The error occurs with any example I run, from any text book or website. thank you... > plot(TukeyHSD(fm1, "tension")). Error in plot(confint(as.glht(x)), ylim = c(0.5, n.contrasts + 0.5), ...) : err

Re: [R] simple data.frame question

2012-05-16 Thread arun
Hi Troels, Not sure this is what you want. > X<-runif(9,0,10) > FF1<-data.frame(ID=c(1,2,3)[rep(c(1,1,1,2,2,2,3,3,3))], > PERIOD=c(1,2,3)[rep(c(1,2,3),times=3)],X=X) > FF1$X[4]<-NA > FF1   ID PERIOD  X 1  1  1 8.27119347 2  1  2 9.64698097 3  1  3 2.74132386 4  2  1  

Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread R. Michael Weylandt
Open source software (what you're driving) Michael On Wed, May 16, 2012 at 12:27 PM, aramos wrote: > Thanks, I've already done that!! > What is OSS? > > > -- > View this message in context: > http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630276.html > Sent from the

Re: [R] Help needed for efficient way to loop through rows and columns

2012-05-16 Thread Priya Bhatt
Yes here it is. I actually convert them all as strings, initially using options(stringsAsFactors=F) at the top of my code. This what the initial dataframe looks like. Please note this is a toy dataset: namesXYZAorB S1BBBBBBA S2AABBBBA S3AB

Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread aramos
Thanks, I've already done that!! What is OSS? -- View this message in context: http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630276.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

[R] fitting t copula with fixed dof

2012-05-16 Thread ergen
I need to fit a t copula with fixed degree of freedom let's say 4. I do not want to estimate the dof together with correlation matrix optimally. Instead fix the dof to 4 and only estimate the correlation matrix in the optimization routine. Is anyone aware of such estimation method in R.

Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread aramos
I think that command will give me the statistics observed value!! Not quantiles from the k-s distribution! -- View this message in context: http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630275.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Job posting - Statistical Consultant - Univ. of Texas at Austin

2012-05-16 Thread Mahometa, Michael J
All, Just to get the word out: We are looking for a new Statistical Consultant at the Division of Statistics and Scientific Computation here at the University of Texas at Austin. Please pass along to any colleagues who might be interested... http://ssc.utexas.edu/people/employment Thanks, Michae

Re: [R] caret: Error when using rpart and CV != LOOCV

2012-05-16 Thread Dominik Bruhn
Sorry for the follow-up, but I dig deeper into the problem. My text on the R^2 was wrong: In my opinion, and at least to Wikipedia, R^2 yields a division by zero iff SStot (the total sum of squares) is zero. SStot is the sum of the sum of the difference between the observed (not the predicted) val

Re: [R] caret: Error when using rpart and CV != LOOCV

2012-05-16 Thread Dominik Bruhn
Thanks Max for your answer. First, I do not understand your post. Why is it a problem if two of predictions match? From the formula for calculating R^2 I can see that there will be a DivByZero iff the total sum of squares is 0. This is only true if the predictions of all the predicted points from

[R] Optimization problem

2012-05-16 Thread Pacin Al
Hi, I'm dealing with an optimization problem. I'm using 'optim' to maximize the output of a function, given some restrictions on the input. I would like to know if there is a way to impose some restrictions on 'intermediate variables' of the function. An example.. fx = function (x) { s <- 0 for (

Re: [R] Scraping a web page.

2012-05-16 Thread Keith Weintraub
Thanks Gabor, Nifty regexp. I never used strapplyc before and I am sure this will become a nice addition to my toolkit. KW Message: 5 Date: Tue, 15 May 2012 07:55:33 -0400 From: Gabor Grothendieck To: Keith Weintraub Cc: r-help@r-project.org Subject: Re: [R] Scraping a web page. Message-ID:

Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread Petr Savicky
On Wed, May 16, 2012 at 06:52:48AM -0700, aramos wrote: > Hi! > > Any one knows how to obtain critical values for the k-s statistic, using R? Hi. I do not know, whether there is a function for this. However, the following randomized approach allows to extract a table of statistic/p.value pairs f

Re: [R] transfer R objects back to console/command line

2012-05-16 Thread R. Michael Weylandt
Take a look at this SO question: http://stackoverflow.com/questions/10575005/output-a-boolean-from-an-rscript-into-a-bash-variable None of the solutions are "Boolean specific" so you should be good with them (the key is printing and capturing) Michael On Wed, May 16, 2012 at 2:36 PM, Jannis wro

[R] transfer R objects back to console/command line

2012-05-16 Thread Jannis
Dear R community, is there any way to invoke R in batch mode, do some calculations and get the values of some R variables back into the (bash)shell ? I only managed to get some output saved into a text file with: R --slave --args 2 2 test2.R test.R contains: a <- as.numeric(commandArgs()[

[R] Finding words that are within +/- X words of "KRAS" using tm package or other means

2012-05-16 Thread Paul Miller
Hello All, This will probably be easy for some but isn't for me. Currently am working on a text mining exercise. Want to be able to predict whether cancer patients got KRAS testing, and, if so, whether the test yielded a result of wild type/negative or mutant/positive. I've begun with a "bag-of

Re: [R] simple data.frame question

2012-05-16 Thread Troels Ring
Thanks a lot - beautiful Troels Den 16-05-2012 19:29, David Winsemius skrev: On May 16, 2012, at 11:56 AM, Troels Ring wrote: Dear friends - I hope you will forgive me another simple question, illustrated by ID <- c(1,1,1,2,2,3,3,3) PERIOD <- c(1,2,3,2,3,1,2,3) X <- runif(8,0,10)) Extrane

Re: [R] simple data.frame question

2012-05-16 Thread David Winsemius
On May 16, 2012, at 11:56 AM, Troels Ring wrote: Dear friends - I hope you will forgive me another simple question, illustrated by ID <- c(1,1,1,2,2,3,3,3) PERIOD <- c(1,2,3,2,3,1,2,3) X <- runif(8,0,10)) Extraneous paren removed: FF <- data.frame(ID=ID,PERIOD=PERIOD,X=X) I need to the

[R] how disable the Error massage in read.table() " no lines available in input"

2012-05-16 Thread gianni lavaredo
Dear Researchers, I am looking a way to disable the Error massage in read.table() as warn = TRUE in readLines(), when the lines are empty Error in read.table(con, header = F, sep = " ", nrow = n) : no lines available in input thanks for all suggestions Gianni [[alternative HTML versio

Re: [R] confidence intervals for nls or nls2 model

2012-05-16 Thread Walmes Zeviani
If you want a confidence based in new x values you can do. I have this post with steps to do this. It's written in Portuguese but the R code is useful. http://ridiculas.wordpress.com/2011/05/19/bandas-de-confianca-para-modelo-de-regressao-nao-linear/ Bests. Walmes. ==

Re: [R] replacing with NA

2012-05-16 Thread R. Michael Weylandt
x[is.na(z)] <- NA This might send you a nasty bug if x and z are different lengths though -- just a head's up. Michael On Wed, May 16, 2012 at 12:55 PM, Mintewab Bezabih wrote: > Dear R users, > > I was wondering  how I can replace the values of a vector with the values > from in another vecto

[R] replacing with NA

2012-05-16 Thread Mintewab Bezabih
Dear R users, I was wondering how I can replace the values of a vector with the values from in another vector in the same row For example, how can I replace the value of x below with NA when the value of Z in the same row is NA? x <-1:20 z<- c(11, 15, 17, 2, 18, 6, 7, NA, 12, 10,21, 25, 27,

[R] replacing with NA

2012-05-16 Thread Mintewab Bezabih
Dear R users, I was wondering how I can replace the values of a vector with the values from in another vector in the same row For example, how can I replace the value of x below with NA when the value of Z in the same row is NA? x <-1:20 z<- c(11, 15, 17, 2, 18, 6, 7, NA, 12, 10,21, 25, 27, 1

Re: [R] finding mean and SD for a log-normal distribution

2012-05-16 Thread David Winsemius
On May 16, 2012, at 6:37 AM, Andras Farkas wrote: Dear R Expert allow me to ask a quick qestion: I have a mean value of 6 and a SD of 3 describing my distribution. I would like to "convert" this distribution into a log normal distribution that would best describe it when resimulated usin

[R] simple data.frame question

2012-05-16 Thread Troels Ring
Dear friends - I hope you will forgive me another simple question, illustrated by ID <- c(1,1,1,2,2,3,3,3) PERIOD <- c(1,2,3,2,3,1,2,3) X <- runif(8,0,10)) FF <- data.frame(ID=ID,PERIOD=PERIOD,X=X) I need to the fourth value of X as NA, and ID and PERIOD is updated to 1,1,1,2,2,2,3,3,3 and 1,

Re: [R] install ggplot2 package

2012-05-16 Thread Ista Zahn
Hi Yang, Did you try a different CRAN mirror? Best, Ista On Wed, May 16, 2012 at 10:21 AM, Yang, Ming wrote: > Has one try to install the ggplot2 package recently? I tried to install > it on my new system and had trouble: > > > >> install.packages("ggplot2") > > Installing package(s) into 'C:/P

Re: [R] install ggplot2 package

2012-05-16 Thread R. Michael Weylandt
It looks like there might be a mirror problem -- use chooseCRANmirror() to select a different mirror. Best, Michael On Wed, May 16, 2012 at 10:21 AM, Yang, Ming wrote: > Has one try to install the ggplot2 package recently? I tried to install > it on my new system and had trouble: > > > >> instal

Re: [R] install ggplot2 package

2012-05-16 Thread Uwe Ligges
Looks like your mirror was in an inconstant state. Seems to be fixed by a finished rysnc in the meantime ... Uwe ligges On 16.05.2012 16:21, Yang, Ming wrote: Has one try to install the ggplot2 package recently? I tried to install it on my new system and had trouble: install.packages(

Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread Uwe Ligges
On 16.05.2012 15:52, aramos wrote: Hi! Any one knows how to obtain critical values for the k-s statistic, using R? ks.test(.)$statistic Uwe ligges Thanks, Alex -- View this message in context: http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245.html Sent from

Re: [R] Merging multiple data sets

2012-05-16 Thread Uwe Ligges
On 16.05.2012 15:51, Bharat Warule wrote: Hello R user, I have four data sets in dir "D:/Bharat Warule/Rdata_file" which are output_data_prod_1.rda, output_data_prod_2.rda, output_data_prod_3.rda, output_data_prod_4.rda. Each data set is huge size like number of rows 343297 and columns are nea

Re: [R] rpart - predict terminal nodes for new observations

2012-05-16 Thread Uwe Ligges
On 15.05.2012 16:30, tudor wrote: Dear useRs: Is there a way I could predict the terminal node associated with a new data entry in an rpart environment? In the example below, if I had a new data entry with an AM of 5, I would like to link it to the terminal node 2. My searches led to http://to

Re: [R] double buffering in windows() not working

2012-05-16 Thread Uwe Ligges
Fine for me, and I cannot investigate anything since there is not even a single piece of reproducible code given. Uwe Ligges On 15.05.2012 23:20, Daniel Carr wrote: I have doubled buffered animations that I show in class. They used to work but now flash. The default windows() option is buffe

[R] install ggplot2 package

2012-05-16 Thread Yang, Ming
Has one try to install the ggplot2 package recently? I tried to install it on my new system and had trouble: > install.packages("ggplot2") Installing package(s) into 'C:/Program Files/R/R-2.14.2/library' (as 'lib' is unspecified) also installing the dependency 'scales' trying URL 'http:/

Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread R. Michael Weylandt
On Wed, May 16, 2012 at 9:52 AM, aramos wrote: > Hi! > > Any one knows how to obtain critical values for the k-s statistic, using R? > Take a look at ?ks.test and the code of ks.test to see how R does it. OSS is super helpful for these sorts of things. Michael > Thanks, > Alex > > -- > View thi

Re: [R] Help needed for efficient way to loop through rows and columns

2012-05-16 Thread Rui Barradas
Hello, Your data.frame is composed exclusively of factors, but try this (I've changed the name to 'sampl', because 'sample' is an R function.) # logical index vectors iA <- sampl$AorB == "A" iB <- sampl$AorB == "B" new.sampl <- data.frame( apply(sampl, 2, function(x){ i

[R] clusters in zero-inflated negative binomial models

2012-05-16 Thread Lies Durnez
Dear all, I want to build a model in R based on animal collection data, that look like the following Nr Village DistrictSiteSurvey Species Count 1 AX A F Dry B 0 2 AY A V Wet A 5 3 BX B F W

Re: [R] vector w/o arithmetic addition for boxplot

2012-05-16 Thread Uwe Ligges
On 15.05.2012 23:47, rl269 wrote: Hello, I am having trouble asking R to read individual numeric vectors for a box plot of the residuals of a linear regression. It is performing arithmetic addition on the 16 individual variables that I want individual box plots for. I have 16 race*treatment

[R] Hmisc improveProb() and PredictABEL reclassification () function and continuous NRI

2012-05-16 Thread Svingen, Gard Frodahl
Dear Sirs. I am working with the R packages Hmisc and PredictABEL to make NRI estimates from my Cox models with and without a specific biomarker. According to Pencina et al (Statistics in Medicine 2010, DOI: 0.1002/sim.4085 ), a continuous/non-categorical NRI (NRI>0) is to be used when there ar

[R] Merging multiple data sets

2012-05-16 Thread Bharat Warule
Hello R user, I have four data sets in dir "D:/Bharat Warule/Rdata_file" which are output_data_prod_1.rda, output_data_prod_2.rda, output_data_prod_3.rda, output_data_prod_4.rda. Each data set is huge size like number of rows 343297 and columns are near to 50. For example: x1 <- data.frame(x11=

[R] kolmogorov-Smirnov critical values

2012-05-16 Thread aramos
Hi! Any one knows how to obtain critical values for the k-s statistic, using R? Thanks, Alex -- View this message in context: http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Need your help setting $R_check_force_suggests = "FALSE" on Windows system

2012-05-16 Thread Uwe Ligges
On 15.05.2012 19:23, Zhiqiu Hu wrote: r-help@r-project.org Dear friends, I want to make the following change of R setting on a windows 7 desktop. $R_check_force_suggests = "FALSE" You can change it globally in the operating systems defaults for environment variable, or for the current ses

Re: [R] caret: Error when using rpart and CV != LOOCV

2012-05-16 Thread Max Kuhn
More information is needed to be sure, but it is most likely that some of the resampled rpart models produce the same prediction for the hold-out samples (likely the result of no viable split being found). Almost every incarnation of R^2 requires the variance of the prediction. This particular fai

Re: [R] How to use the value of "rect" to determine the location of legend

2012-05-16 Thread Uwe Ligges
On 16.05.2012 02:13, Gundala Viswanath wrote: Given the attached plot, Nothing came through. how can I locate the center text with "Mean and SD" so that it can be placed exactly under "---emp".? The current code I have is this: L = list(bquote(Em.Mean ==.(new_avg)),bquote(Em.SD==.(new

Re: [R] code to iterate function apply to matrix

2012-05-16 Thread Uwe Ligges
On 16.05.2012 08:11, umai88 wrote: I got this code below and i want to repeat the loop for 100 times.. And what is the problem? What are you aiming at? Uwe Ligges x<-rnorm(60) mat1<-matrix(x,nrow=15,ncol=4) trim<-numeric(ncol(mat1)) win<-numeric(ncol(mat1)) ssd<-numeric(ncol(mat1)) fo

Re: [R] finding mean and SD for a log-normal distribution

2012-05-16 Thread Uwe Ligges
On 16.05.2012 12:37, Andras Farkas wrote: Dear R Expert allow me to ask a quick qestion: I have a mean value of 6 and a SD of 3 describing my distribution. I would like to "convert" this distribution into a log normal distribution that would best describe it when resimulated using log normal

Re: [R] Error on easy way for JoSAE Package

2012-05-16 Thread David Winsemius
On May 16, 2012, at 1:33 AM, ana24maria wrote: Thank you very much. After using dput and the easy way (> result <- eblup.mse.f.wrap(domain.data = amigo, lme.obj = fit.lme)), i have got the following error: Error in `[.data.frame`(sample.data, , variabs) : undefined columns selected What

Re: [R] confidence intervals for nls or nls2 model

2012-05-16 Thread Francisco Mora Ardila
Thanks! Now it is clear. Francisco On Wed, 16 May 2012 07:32:56 -0400, Gabor Grothendieck wrote > On Tue, May 15, 2012 at 11:20 PM, Gabor Grothendieck > wrote: > > On Tue, May 15, 2012 at 8:08 PM, Francisco Mora Ardila > > wrote: > >> Hi all > >> > >> I have fitted a model usinf nls function to

Re: [R] Reading Excel Formulas as values

2012-05-16 Thread David L Carlson
I can't replicate your problem. I created a spreadsheet in Excel 2007 consisting of three columns. Numbers from 1 - 15, rand(), and the sum of the first two columns. Using all the defaults with read.xlsx() (package: xlsx), I get the values of each column and using keepFormulas=TRUE, I get the form

Re: [R] How to sum and group data by DATE in data frame

2012-05-16 Thread R. Michael Weylandt
Fascinating... dput() has never given me anything that looks like that I would have expected something much more like z <- structure(c(123.53, 123.78, 124.24, 124.2, 124.07, 123.91, 123.44, 123.0616, 123.06, 123.13, 123.745, 123.96, 123.99, 123.99, 124.3, 124.38, 124.67, 125.19, 124.9, 125.27,

Re: [R] tm package: problem of TermDocumentMatrix and minWordLength

2012-05-16 Thread Baoqiang Cao
try this: dtm <- DocumentTermMatrix(examplecorpus, control = list(wordLengths=c(1,100))) On Wed, May 16, 2012 at 6:22 AM, C.H. wrote: > Dear All, > > The following code illustrate the problem. > > [R code] > require(tm) > exampledoc <- c("R is good", "R is really good") > examplecorpus <- Corp

Re: [R] correlation among variables in the same subset

2012-05-16 Thread R. Michael Weylandt
? cor e.g., x <- data.frame(rnorm(5), rnorm(5), rnorm(5), rnorm(5), rnorm(5)) cor(x) Best, Michael On Wed, May 16, 2012 at 6:52 AM, Andrea Sica wrote: > Dear all, > > I have created a subset from my dataset, which contains 6 variables. > I need to make the correlation among all of them, possi

Re: [R] Help needed for efficient way to loop through rows and columns

2012-05-16 Thread David L Carlson
Can you show us what you want the final data.frame to look like? You've created five variables stored as factors and you seem to be trying to change those to numeric values? Is that correct? Since AB and BA are always set to 1, you could just replace those values globally rather than mess with th

Re: [R] Automating R for Hypothesis Testing

2012-05-16 Thread meredith
Rui- Just a quick question. I understand your comment on using ANOVA, but doesn't this only test for similarities of the mean. We are trying to see if a the same model can fit for two or three months, therefore have the similar slope and intercept. The ANOVA would only do one part of this correct

Re: [R] Problem to resolve a step for reading a large TXT and, split in several file

2012-05-16 Thread Rui Barradas
Hello, Your bug is obvious, each pass through the loop you read twice and write only once. The file pointer keeps moving forward... Use something like while (length(pv <- readLines(con, n=n)) > 0 ) { # note that this line changed. i <- i + 1 write.table(pv, file = paste(fileNames.t

[R] ANCOVA power

2012-05-16 Thread Xan
Dear list members: I am trying to calculate power for an ANCOVA analysis. I have found different solutions such as power.t.test and power.anova.test but they seem to refer to the ANOVA part of the ANCOVA. My model is of the form: lm (y ~ factor + x1 + x2 + x2*myfactor) where myfactor is a fact

Re: [R] problem with get() inside of lme()

2012-05-16 Thread ONKELINX, Thierry
You can achieve that with a combination of as.formula and paste. library(nlme) data(petrol, package = "MASS") lme(as.formula(paste(Y.VAR, "~EP")), random= ~1|No, data=petrol) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and F

Re: [R] write data using xlsReadWrite

2012-05-16 Thread diyanah
Hai, I have change it to these, but error and I couldn't fix it. Do you have any idea why? file <- system.file("D:\\FYP\\image\\Cropped Images\\user61", "forgerUser61.xlsx", package = "xlsx") wb <- loadWorkbook("forgerUser61.xlsx") sheets <- getSheets(wb) sheet <- sheets[["all"]] res <- readRows(s

[R] finding mean and SD for a log-normal distribution

2012-05-16 Thread Andras Farkas
Dear R Expert   allow me to ask a quick qestion: I have a mean value of 6 and a SD of 3 describing my distribution. I would like to "convert" this distribution into a log normal distribution that would best describe it when resimulated using log normal distribution. Currently I am using another

[R] Re : Wrong Q3 + Mean.

2012-05-16 Thread Pascal Oettli
Hi, Probably you could check this: >?quantile Particularly the 'type' option. Best Regards, Pascal - Mail original - De : Retep32 À : r-help@r-project.org Cc : Envoyé le : Mercredi 16 mai 2012 16h22 Objet : [R] Wrong Q3 + Mean. Hi. > a [1] 13 13 14 14 15 15 16 20 21 26 > summary(a)

Re: [R] How to sum and group data by DATE in data frame

2012-05-16 Thread Cren
Michael Weylandt wrote > > Can you provide a reproducible example? > Of course, Michael. Consider the following time series: 11/2/2011 14:30 123.53 11/2/2011 15:00 123.78 11/2/2011 15:30 124.24 11/2/2011 16:00 124.2 11/2/2011 16:30 124.07 11/2/2011 17:00 123.91 11/2/2011 17:30 123.44 11/2/20

Re: [R] order a data frame by date with orderl

2012-05-16 Thread Benedikt Gehr
Hi, many thanks for your answer. if i set tz="GMT" it does the job. Great! thanks cheers Benedikt Am 16.05.2012 12:20, schrieb jholtman [via R]: > Is the a daylight saving time problem? Check your timezone and see > when it occurred; these times might not be legal. > > Sent from my iPad > > O

Re: [R] Splus equivalent of reshape in R

2012-05-16 Thread Jim Lemon
On 05/16/2012 01:18 PM, Santosh wrote: Hello R/Splus users.. I am posting in R discussion group in hope of wider response compared to what I received from Splus user groups Was wondering if there is any function available in Splus 8.2 that is equivalent to "reshape" of R? Below is a sample

Re: [R] confidence intervals for nls or nls2 model

2012-05-16 Thread Gabor Grothendieck
On Tue, May 15, 2012 at 11:20 PM, Gabor Grothendieck wrote: > On Tue, May 15, 2012 at 8:08 PM, Francisco Mora Ardila > wrote: >> Hi all >> >> I have fitted a model usinf nls function to these data: >> >>> x >>  [1]   1   0   0   4   3   5  12  10  12 100 100 100 >> >>> y >>  [1]  1.281055090  1.5

[R] tm package: problem of TermDocumentMatrix and minWordLength

2012-05-16 Thread C.H.
Dear All, The following code illustrate the problem. [R code] require(tm) exampledoc <- c("R is good", "R is really good") examplecorpus <- Corpus(VectorSource(exampledoc), encoding = "UTF-8") dtm <- DocumentTermMatrix(examplecorpus, control = list(minWordLength = 1)) as.matrix(dtm) [/R code] Th

Re: [R] Wrong Q3 + Mean.

2012-05-16 Thread Michael Dewey
At 08:22 16/05/2012, Retep32 wrote: Hi. > a [1] 13 13 14 14 15 15 16 20 21 26 > summary(a) Min. 1st Qu. MedianMean 3rd Qu.Max. 13.014.015.016.719.026.0 > mean(a) [1] 16.7 > quantile(a) 0% 25% 50% 75% 100% 13 14 15 19 26 Clearly, this is not rig

[R] correlation among variables in the same subset

2012-05-16 Thread Andrea Sica
Dear all, I have created a subset from my dataset, which contains 6 variables. I need to make the correlation among all of them, possibly, without making it one by one. Is there any command that can permits me to do it directly for all of them in the same time? Thank you so much in advance. Andr

[R] Change the order of variables in a linear model

2012-05-16 Thread Frank Paetzold
Hello, the following lines m <- matrix(c(1,1,9,1,2,6,1,3,7,2,1,4,2,2,5,2,3,1,3,1,2,3,2,-1,3,3,-2), 9, 3, byrow = TRUE, dimnames=list(NULL, cbind('A','B','Y'))) md <- as.data.frame(m) md$A <- as.factor(md$A) md$B <- as.factor(md$B) mm <- model.matrix(Y~A+B+A:B, data=md) produce > mm (Interce

Re: [R] order a data frame by date with orderl

2012-05-16 Thread Jim Holtman
Is the a daylight saving time problem? Check your timezone and see when it occurred; these times might not be legal. Sent from my iPad On May 16, 2012, at 3:27, Benedikt Gehr wrote: > Hi > > I have a rather large data frame (>7000 rows with 28 columns) which I want > to sort by date. Below I

  1   2   >