[R] BCA Package Doubts

2012-10-05 Thread kokila
Hi .., In create.samples() function how to calculate "Estimation","validation","Holdout" .I got the answer in this function.But I dont know how the function is working.please Reply this..Iam Waiting for Reply... See this below example and reply me... Example: > data(cars) > create.sa

Re: [R] geoRglm with factor variable as covariable

2012-10-05 Thread Ruben
On 10/4/2012 10:39 PM, Filoche wrote: Dear R users. I'm trying to fit a generalised linear spatial mode using the geoRglm package. To do so, I'm preparing my data (geodata) as follow: geoData9093 = as.geodata(data9093, coords.col= 17:18, data.col=15,* covar.col=16*) where covar.col is a facto

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

2012-10-05 Thread Omar De la Cruz C.
Hello, 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 ultim

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

2012-10-05 Thread Andrea Goijman
I've been trying to reshape this database but haven't succeed at it. I tried using loops but can't get it right. I just want to reshape my database from this matrix, to the one below, with only one column of data. Year Route Point Sp1 Sp2 Sp3 2004 123 123-1 0 1 0 2004 123 123-2 0 1 1 2004 123

[R] SPM/SemiPar -- Plotting additive interactions

2012-10-05 Thread Andrew Crane-Droesch
I'm taking the residual-regression approach to semiparametric estimation (Robinson 1988, Econometrica), and basically using SemiPar simply as a convenient means of doing multivariate nonparamteric additive models. The final bit of code is here: finalfit <- spm(res~f(V3,basis="trunc.poly")+f(V5

Re: [R] Anova, F statistics, P-values

2012-10-05 Thread Jhope
Thank you for the replies. I am actually trying to gain p-values and f values, and tried the below script but unsuccessful. 1) I have read in another forum to use the package lmer but apparently it does not exist. 2) Then I tried the pvals.fnc but it is not a function. 3) I read also that a gl

Re: [R] Minute Difference

2012-10-05 Thread Jim Lemon
On 10/05/2012 10:56 PM, Rantony wrote: Hi, Here i have a time along with date, for eg:- "10/5/2012 5:05:00 AM" i need to do minus 10 minutes along current date Like this :- "10/5/2012 4:55:00 AM" Hi Antony, Did you get an answer for this? oldtime<-strptime("10/5/2012 5:05:00 AM", format="%

Re: [R] svyhist

2012-10-05 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Dear Anthony and David, Sorry- the earlier-sent plots were mislabeled, which I have corrected and attached. But, the y-lim issue is yet to be resolved. Thanks, Pradip Muhuri From: Anthony Damico [ajdam...@gmail.com] Sent: Friday, October 05, 2012 7:2

Re: [R] svyhist

2012-10-05 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Dear Anthony and David, Thank you so much for your comments and suggestions! The sample data set I had embedded in the earlier-sent R script was intended to be used for the reproducible example. Now I have used Anthony's revised code on the the entire analytic file. The code has worked fine

Re: [R] arrange data

2012-10-05 Thread arun
Hi, I hope this helps you.  I created a small dataset: 3 replications per month for 1998:2000. set.seed(1) dat1<-data.frame(Tahun=rep(c(98:99,00),each=36),Bahun=rep(rep(1:12,times=3),each=3), x=sample(1:500,108,replace=TRUE)) dat2<-within(dat1,{Tahun<-factor(Tahun,levels=c(98,99,0))}) agg_dt

[R] Two questions about R2BayesX package

2012-10-05 Thread Shige Song
Dear All, I have two questions regarding the use of the R2BayesX package for Bayesian analysis. First, is it possible to generate predictions based on the fitted model? According to Gelman and Hill (2007, pp. 361-363), there are at least two ways to do this in BUGS: (1) generate additional data p

[R] arrange data

2012-10-05 Thread Roslina Zakaria
Dear r-users, I have dailly rainfall data from year 1971 to 2000. I use aggregate to form monthly rainfall data.  What I don't understand is that the data for the year 2000 become on the top, instead of year 1971.  Here are some codes and output: agg_dt1     <- aggregate(x=dt1[,4],by=dt1[,c(1,

Re: [R] Creating vegetation distance groups from one column

2012-10-05 Thread Jhope
Hi, I have tried the script posted but received the following errors. I hope I copied it correctly. I'm sorry but I don't know how to alter the script myself. Please advise, Jean > x <- 0:30 + runif(124) > data.to.analyze$VegIndex <- cut(x, breaks = seq(0, 35, 5)) Error in `$<-.data.frame`(`*tm

Re: [R] Calculating all possible ratios

2012-10-05 Thread Rui Barradas
And was it it? Rui Barradas Em 05-10-2012 21:44, genome1976 escreveu: Thanks Rui.I actually exactly did that. Date: Fri, 5 Oct 2012 05:49:20 -0700 From: ml-node+s789695n4645154...@n4.nabble.com To: genome1...@hotmail.com Subject: Re: Calculating all possible ratios Hello, Comment

Re: [R] Creating vegetation distance groups from one column

2012-10-05 Thread Jhope
Hi Thanks to all for posting! In plyr I did try something similar, a combination of what I learned from all who replied. It seemed to work. If anyone knows of any criticism about the grouping structure please let me know. I need this to be accurate. Grouping defined by (0-5m) (6-10m) (11-15m) (16

Re: [R] Format of numbers in plotmath expressions.

2012-10-05 Thread Rolf Turner
Thanks Uwe. I think your recipe is substantially sexier than mine. However I will, I believe, ***NEVER*** understand how to put together plotmath constructs. They seem to require some subset of: * expression() * bquote() * substitute() * parse() * paste() * as.express

Re: [R] Using variables from different environments in one function

2012-10-05 Thread Duncan Murdoch
On 12-10-05 3:47 PM, Rik Verdonck wrote: Dear R-community, I have been experiencing this issue with functions within a function and I can kind of feel where the problem is (environments, closures etc), but I don't manage to solve it. I will sketch it with an example: #We have two simple "inne

Re: [R] svyhist

2012-10-05 Thread Anthony Damico
this worked for me -- and doesn't require removing the PSUs from the design :) options( survey.lonely.psu = "adjust" ) svyhist (~dthage, subset (nhis, xspd2=='No SPD'), breaks=MyBreaks, main= " ", col="grey80", xlab="Age at Death Distribution" ) lin

Re: [R] svyhist

2012-10-05 Thread David Winsemius
On Oct 5, 2012, at 3:33 PM, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: > Hello, > > I was trying to draw histograms of age at death and got the following 2 > error messages: > > > 1) Error in tapply(1:NROW(x), list(factor(strata)), function(index) { : > > arguments must have same leng

[R] svyhist

2012-10-05 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, I was trying to draw histograms of age at death and got the following 2 error messages: 1) Error in tapply(1:NROW(x), list(factor(strata)), function(index) { : arguments must have same length 2) Error in findInterval(mm[, i], gx) : 'vec' contains NAs In addition: Warn

Re: [R] loop for column substraction of a matrix

2012-10-05 Thread Rui Barradas
Or, using your mapply solution, compute rs <- rowSums(mat1) and then use it for all subtractions. With a larger dataset this would be probably faster. Rui Barradas Em 05-10-2012 22:41, arun escreveu: Hi, Sorry, I think I misunderstand your question (after reading Rui's solution). You can a

Re: [R] loop for column substraction of a matrix

2012-10-05 Thread eliza botto
Dear Arun and Barradas, millions of thanks. you guys always rock. regards eliza > Date: Fri, 5 Oct 2012 14:41:38 -0700 > From: smartpink...@yahoo.com > Subject: Re: [R] loop for column substraction of a matrix > To: eliza_bo...@hotmail.com > CC: ruipbarra...@sapo.pt; r-help@r-project.org > > Hi,

Re: [R] Dúvida função Anova pacote car - Medidas repetidas

2012-10-05 Thread John Fox
Dear Diego, This is close enough to Spanish for me to understand it (I think). Using Anova() in the car package for repeated-measures designs requires a multivariate linear model for all of the responses, which in turn requires that the data set be in "wide" format, with each response as a variab

Re: [R] loop for column substraction of a matrix

2012-10-05 Thread arun
Hi, Sorry, I think I misunderstand your question (after reading Rui's solution). You can also try any of these to get the result if this is what you meant: set.seed(1) mat1<-matrix(sample(1:500,380,replace=TRUE),ncol=38) res1<-t(do.call(rbind,lapply(1:ncol(mat1), function(i) mat1[,i]-apply(mat1,

Re: [R] Using variables from different environments in one function

2012-10-05 Thread Ista Zahn
Hi Rik, I don't fully understand it, but setting local=TRUE to your source() calls will avoid the specific error you noted. Best, Ista On Fri, Oct 5, 2012 at 3:47 PM, Rik Verdonck wrote: > Dear R-community, > > > I have been experiencing this issue with functions within a function and > I can k

Re: [R] LaTeX consistent publication graphics from R and Comparison of GLE and R

2012-10-05 Thread Marc Schwartz
On Oct 5, 2012, at 3:32 PM, clangkamp wrote: > Hi Everyone > > I am at the moment preparing my thesis and am looking at producing a few > Organigrams / Flow charts (unrelated to the calculations in R) as well as a > range of charts (barcharts, histograms, ...) based on calculations in R. > > F

Re: [R] loop for column substraction of a matrix

2012-10-05 Thread arun
HI, Try this: set.seed(1)  mat1<-matrix(sample(1:500,380,replace=TRUE),ncol=38) list1<-list() for(i in 1:ncol(mat1)){  list1[[i]]<-t(apply(mat1,1,function(x) x[i]-x))  list1} list1 A.K. - Original Message - From: eliza botto To: "r-help@r-project.org" Cc: Sent: Friday, October 5, 20

Re: [R] Calculating all possible ratios

2012-10-05 Thread genome1976
Thanks Rui.I actually exactly did that. Date: Fri, 5 Oct 2012 05:49:20 -0700 From: ml-node+s789695n4645154...@n4.nabble.com To: genome1...@hotmail.com Subject: Re: Calculating all possible ratios Hello, Comment out the second apply and all following instructions using 'r2'. In the

Re: [R] loop for column substraction of a matrix

2012-10-05 Thread Rui Barradas
Hello, 1. Let me refrase it a bit. For each column, sum all others and take the symmetric. mat <- matrix(1:30, ncol = 3) sapply(seq_len(ncol(mat)), function(i) -rowSums(mat[, -i])) 2. write.table (maybe using sep = "\t" ?) and send the file to printer. Hope this helps, Rui Barradas Em 05

[R] LaTeX consistent publication graphics from R and Comparison of GLE and R

2012-10-05 Thread clangkamp
Hi Everyone I am at the moment preparing my thesis and am looking at producing a few Organigrams / Flow charts (unrelated to the calculations in R) as well as a range of charts (barcharts, histograms, ...) based on calculations in R. For the Organigrams I am looking at an Opensource package call

Re: [R] barplot with some 0 frequencies

2012-10-05 Thread Guillaume2883
Thank for all your answer ! Here is another way I discoverd this morning : barplot(table(factor(variable, levels = 1:4)),names=c(1,2,3,4)) -- View this message in context: http://r.789695.n4.nabble.com/barplot-with-some-0-frequencies-tp4645102p4645208.html Sent from the R help mailing list arc

Re: [R] help with making figures

2012-10-05 Thread megalops
Bert, Can you help me understand your suggestion? I don't understand how I can include all 30 sites under the label called "site" in the xypot code example you provided. -- View this message in context: http://r.789695.n4.nabble.com/help-with-making-figures-tp4645074p4645216.html Sent fro

[R] Using variables from different environments in one function

2012-10-05 Thread Rik Verdonck
Dear R-community, I have been experiencing this issue with functions within a function and I can kind of feel where the problem is (environments, closures etc), but I don't manage to solve it. I will sketch it with an example: #We have two simple "inner" functions: ## INNER FUNCTIO

Re: [R] Bayesian inference distribution parameters

2012-10-05 Thread Guillaume2883
Maybe this link could help you http://sirs.agrocampus-ouest.fr/bayes_V2/index_menu.html You will be able to download some code ! -- View this message in context: http://r.789695.n4.nabble.com/Bayesian-inference-distribution-parameters-tp4645155p4645207.html Sent from the R help mailing list ar

[R] loop for column substraction of a matrix

2012-10-05 Thread eliza botto
Dear useRs, I have a matrix with 38 columns and 365 rows. what i want to do is the following. 1. subtracting from each column, first itself and then all the remaining columns. More precisely, from column number 1, i will first subtract itself(column 1) and then the remaining 37 columns.

Re: [R] BCA Package

2012-10-05 Thread Greg Snow
Kokila, Note that the quality of replies on this mailing list tend to correlate with the quality of the questions. Follow the advice found in the last 2 lines of this (and all) message and ask a better question and you are more likely to get a better reply. On Fri, Oct 5, 2012 at 5:53 AM, kokila

Re: [R] barplot with some 0 frequencies

2012-10-05 Thread Greg Snow
Others have shown barchart commands that include 0's. My guess (which could be wrong, feel free to ignore this e-mail if so) is that your problem is due to the way you are creating/summarizing the data before the plotting command is used. R needs some way to know about what bars you want, even if

Re: [R] convert multi dimensional array to list

2012-10-05 Thread Greg Snow
See fortune("toad") for a bit more on this concept. On Thu, Oct 4, 2012 at 3:19 PM, David Winsemius wrote: > > On Oct 4, 2012, at 8:57 AM, anto.r wrote: > >> Hi Michael >> >> thanks! That was the option if I kept it an array. The list format with $ >> sign since it leaves me feeling that the name

Re: [R] Minute Difference

2012-10-05 Thread R. Michael Weylandt
Mr Rantony could also probably benefit from taking a look at the lubridate package. Cheers, Michael On Fri, Oct 5, 2012 at 8:04 PM, arun wrote: > Hi, > Try this: > date1<-"10/5/2012 5:05:00 AM" > > format(as.POSIXct(strptime(date1,format="%m/%d/%Y > %H:%M:%S"))-600,format="%m/%d/%Y %r") > #[1]

Re: [R] Minute Difference

2012-10-05 Thread arun
Hi, Try this: date1<-"10/5/2012 5:05:00 AM"  format(as.POSIXct(strptime(date1,format="%m/%d/%Y %H:%M:%S"))-600,format="%m/%d/%Y %r") #[1] "10/05/2012 04:55:00 AM" A.K. - Original Message - From: Rantony To: r-help@r-project.org Cc: Sent: Friday, October 5, 2012 8:56 AM Subject: [R]

Re: [R] Test for Random Points on a Sphere

2012-10-05 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of R. Michael Weylandt > Sent: Friday, October 05, 2012 11:17 AM > To: Lorenzo Isella > Cc: r-help@r-project.org > Subject: Re: [R] Test for Random Points on a Sphere > > On Fri, Oc

Re: [R] Test for Random Points on a Sphere

2012-10-05 Thread R. Michael Weylandt
On Fri, Oct 5, 2012 at 5:39 PM, Lorenzo Isella wrote: > Dear All, > I implemented an algorithm for (uniform) random rotations. > In order to test it, I can apply it to a unit vector (0,0,1) in Cartesian > coordinates. > The result is supposed to be a set of random, uniformly distributed, points >

Re: [R] R: machine for moderately large data

2012-10-05 Thread Steve Lianoglou
Hi, On Fri, Oct 5, 2012 at 1:41 PM, Ista Zahn wrote: > On Fri, Oct 5, 2012 at 12:09 PM, PIKAL Petr wrote: [snip] >> If I compute correctly, such a big matrix (20e6*1000) needs about 160 GB >> just to be in memory. Are you prepared for this? > > This is not as outrageous as one might think -- yo

Re: [R] Format of numbers in plotmath expressions.

2012-10-05 Thread Uwe Ligges
On 05.10.2012 09:30, Rolf Turner wrote: I want to do something like: TH <- sprintf("%1.1f",c(0.3,0.5,0.7,0.9,1)) plot(1:10) legend("bottomright",pch=1:5,legend=parse(text=paste("theta ==",TH))) Notice that the final "1" comes out in the legend as just plain "1" and NOT as "1.0" although TH i

Re: [R] R: machine for moderately large data

2012-10-05 Thread Ista Zahn
On Fri, Oct 5, 2012 at 12:09 PM, PIKAL Petr wrote: > Hi > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of Skála, Zdeněk (INCOMA GfK) >> Sent: Friday, October 05, 2012 3:38 PM >> To: r-help@r-project.org >> Subject: [R] R: m

Re: [R] smoothScatter plot

2012-10-05 Thread JiangZhengyu
Hi John, Thanks for your link. Those plots look pretty but way too complicated in terms of making R code. Maybe my decription is not clear. But could you take a look at the attached png? I saw several publications showing smoothed plots like this but not sure how to make one... Thanks,Best,

Re: [R] Multiple graphs > boxplot

2012-10-05 Thread Rui Barradas
Hello, I've once written a function that does more or less what you want, but it has no formula interface. # Input: #x - matrix or data.frame of numeric vectors to graph #by - a factor or coercible to factor multi.boxplot <- function(x, by, col=0, ...){ x <- as.data.frame(x) un

Re: [R] Broken Links on http://www.r-project.org

2012-10-05 Thread Uwe Ligges
On 04.10.2012 21:03, Hasan Diwan wrote: The R Graphics Gallery has moved to http://gallery.r-enthusiasts.com/ Thanks, fixed. Uwe Ligges and there's another R Graphics Manual at http://rgm2.lab.nig.ac.jp/RGM2 -- H On 26 September 2012 04:56, Viechtbauer Wolfgang (STAT) < wolfgang.viechtb

[R] Test for Random Points on a Sphere

2012-10-05 Thread Lorenzo Isella
Dear All, I implemented an algorithm for (uniform) random rotations. In order to test it, I can apply it to a unit vector (0,0,1) in Cartesian coordinates. The result is supposed to be a set of random, uniformly distributed, points on a sphere (not the point of the algorithm, but a way to test

[R] survival predictions

2012-10-05 Thread Mitja Kurki
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) ~ Sex +

[R] Setup Alias & Working Directory

2012-10-05 Thread Faisal Ghulam
I have 2 questions: 1- I want to setup alias for dbconnect in User .Rprofile. mydb = dbConnect(MySQL(), user='ghulam', password='password', dbname='ghulam_test', host='localhost') 2- I want to setup two working directory one is for user personal dirctory. I have setup .Rprofile in users Home

Re: [R] Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves

2012-10-05 Thread Brian S Cade
Another alternative is to put the data in a linear model structure (1 column for the response, another column for an indicator variable indicating group) and estimate all possible quantile regressions with rq() in quantreg package using a model with y ~ intercept + indicator (0,1) variable for

[R] Multiple graphs > boxplot

2012-10-05 Thread David Gramaje
Dear all I am trying to represent a dependent variable (treatment) against different independent variables (v1, v2, v3v20). I am using the following command: boxplot(v1~treatment,data=y, main="xx",xlab="xx", ylab="xx") However, it provides me only one graph for v1~treatment. F

Re: [R] R: machine for moderately large data

2012-10-05 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Skála, Zdeněk (INCOMA GfK) > Sent: Friday, October 05, 2012 3:38 PM > To: r-help@r-project.org > Subject: [R] R: machine for moderately large data > > Dear all, > > I would

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

2012-10-05 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of fxen3k > Sent: Friday, October 05, 2012 3:18 PM > To: r-help@r-project.org > Subject: Re: [R] Calculating the mean in one column with empty cells > > I imported the whole dat

Re: [R] Error in lmer: asMethod(object) : matrix is not symmetric [1, 2]

2012-10-05 Thread Ben Bolker
Ben Bolker gmail.com> writes: > PS this error message is listed in http://glmm.wikidot.com/faq -- if you google 'lmer "matrix is not symmetric"' it's in the hits (although pretty far from the top, alas). I've added a little bit more discussion. __

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

2012-10-05 Thread David Winsemius
On Oct 5, 2012, at 6:26 AM, Rerda wrote: > Dear everyone > > I am a bit of a computer imbecile and are having problems with R. > I am using R in my research project to do chi-square tests on data imported > from excel . > However I have som missing data in one of my variables (columns) and I nee

Re: [R] LMMs with some variance terms forced constant

2012-10-05 Thread Ben Bolker
Erica E.M. Moodie, Dr. mcgill.ca> writes: > I have been asked to help perform a meta-analysis with individual- > and aggregate-level data. I found a nice article on this, and the > idea is easy to understand: use a mixed effects models, but for the > studies where there is only aggregate level da

Re: [R] Minute Difference

2012-10-05 Thread David Winsemius
On Oct 5, 2012, at 5:56 AM, Rantony wrote: > Hi, > > Here i have a time along with date, > for eg:- "10/5/2012 5:05:00 AM" > > i need to do minus 10 minutes along current date > Like this :- "10/5/2012 4:55:00 AM" > There are both 'cut' and 'seq' methods for vectors of class POSIXt. These s

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

2012-10-05 Thread Rui Barradas
Hello, There are two ways, 1. ?sum # see argument na.rm sum(whatever, na.rm = TRUE) 2. ?table # produces the 2x2 contingency table, if there are only 2 values Also, you should provide us with a data example, especially since your code clearly doesn't work. Use ?dput like this dput( head(M

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

2012-10-05 Thread William Dunlap
You need to show us the verbatim output of the following R command dput(dataSet2$ac_bhar_60d_4d_after_ann[2:10]) to make any further progress. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-proje

Re: [R] problems with printing and plotting aareg

2012-10-05 Thread Terry Therneau
It's a bug in summary.aareg which no one found until now. What's wrong: If dfbeta=TRUE then there is a second estimate of variance calculated, labeled as test.var2. If maxtime is set, then both estimates of variance need to be recalculated by the summary routine. An incorrect if-then-else flow

Re: [R] t-test

2012-10-05 Thread Nico Met
Many many thanks for the input in this context. Nico On Thu, Oct 4, 2012 at 4:56 PM, Jose Iparraguirre < jose.iparragui...@ageuk.org.uk> wrote: > Hi, > > You can also have a look at this paper (no subscription needed): > > Herberich, E.; Sikorski, J.; and Hothorn, T. (2010). "A Robust Procedure

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

2012-10-05 Thread Sarah Goslee
If the numbers were imported correctly you wouldn't need to do as.numeric(as.character(yourdata)). Please use dput() to provide your data, as in: dput(dataSet2$ac_bhar_60d_4d_after_ann[2:10]) Otherwise it's impossible for us to diagnose your problem or reproduce your error. testdata <- c(0.20061

Re: [R] smoothScatter plot

2012-10-05 Thread John Kane
In line John Kane Kingston ON Canada -Original Message- From: zhyjiang2...@hotmail.com Sent: Fri, 5 Oct 2012 05:41:29 +0800 To: jrkrid...@inbox.com Subject: RE: [R] smoothScatter plot Hi John, Thanks for your email. Your way works good. However, I wa

[R] Likelihood: Multiple Maxima

2012-10-05 Thread felix1984
Hi everyone, I estimate structural equation models and use maximum likelihood estimation. However, the estimates differ depeding on the starting values I choose, so I guess there are multiple local maxima. I'm new to R (and statistics...;), does anybody maybe know how I solve this best? Thanks a

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

2012-10-05 Thread fxen3k
I'm sorry! Now I tried it again with just 10 numbers (just random numbers) and Excel gives a different output than R. Here are the numbers I used: 0,2006160108532920 0,1321167173880490 0,0563941428921262 0,0264198664609803 0,0200581303857603 -0,2971754213679500 -0,2353086361784190 0,06671955382

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

2012-10-05 Thread Rerda
Dear everyone I am a bit of a computer imbecile and are having problems with R. I am using R in my research project to do chi-square tests on data imported from excel . However I have som missing data in one of my variables (columns) and I need R to "exclude" these and make chi-square test on the

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

2012-10-05 Thread fxen3k
I imported the whole dataset with read.csv2() and it works fine. (2 for German is correct ;) ) I already checked the numbers and I also tried to calculate the mean of a range of numbers where there is no NA given. (as mentioned in my last post above). -- View this message in context: http://r

[R] Minute Difference

2012-10-05 Thread Rantony
Hi, Here i have a time along with date, for eg:- "10/5/2012 5:05:00 AM" i need to do minus 10 minutes along current date Like this :- "10/5/2012 4:55:00 AM" Thanks in Advance Antony -- View this message in context: http://r.789695.n4.nabble.com/Minute-Difference-tp4645157.html Sent from the

[R] R: machine for moderately large data

2012-10-05 Thread INCOMA GfK
Dear all, I would like to ask your advice about a suitable computer for the following usage. I (am starting to) work with moderately big data in R: - cca 2 - 20 million rows * 100 - 1000 columns (market basket data) - mainly clustering, classification trees, association analysis (e.g. libraries

Re: [R] jointModel error messages

2012-10-05 Thread Charles Graham
I contacted the package developer and that lead to me removing events at time 0 (or subjects with only 1 longitudinal measurement). I then still had the error message "Can't fit a Cox model with 0 failures" which I have managed to avoid by adding 1.8*10^(-15) to all my survival times, any number g

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

2012-10-05 Thread arun
HI, Not sure how your dataset looks like: set.seed(1) dat1<-data.frame(col1=c(sample(1:50,5,replace=TRUE),NA,sample(1:25,3,replace=TRUE),NA,sample(1:25,2,replace=TRUE)),col2=c(NA,NA,rnorm(8,15),NA,NA)) mean(dat1$col1[!is.na(dat1$col1)]) #[1] 20.1  mean(dat1$col1,na.rm=TRUE) #[1] 20.1 But, there i

Re: [R] Dúvida função Anova pacote car - Medidas repetidas

2012-10-05 Thread Rui Barradas
Trabalho de casa? Não fazemos trabalhos de casa. Ao menos podia ter tentado correr esse código... Rui Barradas Em 05-10-2012 14:56, Diego Pujoni escreveu: > Olá pessoal, estou realizando uma ANOVA com medidas repetidas e estou > utilizando a função "Anova" do pacote "car". > > Medi o biovolume de

Re: [R] avoid <<- in specific case

2012-10-05 Thread Bert Gunter
Inline. On Fri, Oct 5, 2012 at 6:38 AM, Frans Marcelissen wrote: > I agree with this. But there is (in my opinion) a much more dangerous point: > a If there is an object called b in the function, it uses this b. But if you > forgot to inialise b in the function, it looks in the global environme

Re: [R] avoid <<- in specific case

2012-10-05 Thread Duncan Murdoch
On 05/10/2012 9:38 AM, Frans Marcelissen wrote: I agree with this. But there is (in my opinion) a much more dangerous point: a If functions didn't have access to objects outside the local frame, they couldn't do much of anything at all. Unlike Pascal, functions in R are first class objects.

[R] Dúvida função Anova pacote car - Medidas repetidas

2012-10-05 Thread Diego Pujoni
Olá pessoal, estou realizando uma ANOVA com medidas repetidas e estou utilizando a função "Anova" do pacote "car". Medi o biovolume de algas a cada dois dias durante 10 dias (no banco de dados abaixo só coloquei até o 4° dia). Tenho 2 tratamentos ("c","t") e o experimento foi realizado em tréplica

Re: [R] Error in lmer: asMethod(object) : matrix is not symmetric [1, 2]

2012-10-05 Thread Ben Bolker
Olivier Blaser unil.ch> writes: > I am having trouble with lmer. I am looking at recombinant versus non > recombinant individuals. In the response variable recombinant > individuals are coded as 1's and non-recombinant as 0's. I built a model > with 2 fixed factors and 1 random effect. Sex (m

Re: [R] avoid <<- in specific case

2012-10-05 Thread Frans Marcelissen
I agree with this. But there is (in my opinion) a much more dangerous point: amailto:r-help-boun...@r-project.org] Namens Duncan Murdoch Verzonden: vrijdag 5 oktober 2012 14:26 Aan: Berry Boessenkool CC: R Help Onderwerp: Re: [R] avoid <<- in specific case On 05/10/2012 8:19 AM, Berry Boessenkool

Re: [R] help with making figures

2012-10-05 Thread Jean V Adams
It's helpful to provide reproducible code in your posting to R help. The dput() function can be used to share some of your data. For example, you might have used dput(mydata[1:10, 1:10]) # here's some data I made up as an example ... df <- structure(list(`2000` = c(44L, 31L, 55L, 83L,

Re: [R] Setting the desired reference category with contr.sum

2012-10-05 Thread Ista Zahn
Hi, The contr. functions return matrices, so you can can create any arbitrary matrix you like. For example contrasts(career) <- cbind(c1=c(-1, 1, 0, 0, 0, 0), c2=c(-1, 0, 1, 0, 0, 0), c3=c(-1, 0, 0, 1, 0, 0),

Re: [R] avoid <<- in specific case

2012-10-05 Thread Sarah Goslee
Hi Berry, You might look at scatterplot3d in the scatterplot3d package for an example of how a similar problem was handled, precisely as Duncan suggests. Sarah On Fri, Oct 5, 2012 at 8:25 AM, Duncan Murdoch wrote: > On 05/10/2012 8:19 AM, Berry Boessenkool wrote: >> >> >> Hi all, >> >> I improv

Re: [R] How to add a new row in to an existing data set in R Language?

2012-10-05 Thread Ista Zahn
Hi, On Fri, Oct 5, 2012 at 12:27 AM, killerkarthick wrote: > Hi Ista Zahn, > Thanks for your advice. Please see the > following Image. > > > > > To me this example looks plain wrong. You end up with a row that co

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

2012-10-05 Thread Ken Takagi
fxen3k gmail.com> writes: > > Hi all, > > I recently tried to calculate the mean and the median just for one column. > In this column I have numbers with some empty cells due to missing data. > So how can I calculate the mean just for the filled cells? > I tried: > mean(dataSet2$ac_60d_4d_aft

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

2012-10-05 Thread Berend Hasselman
On 05-10-2012, at 11:27, fxen3k wrote: > Hi all, > > I recently tried to calculate the mean and the median just for one column. > In this column I have numbers with some empty cells due to missing data. > So how can I calculate the mean just for the filled cells? > I tried: > mean(dataSet2$ac_

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

2012-10-05 Thread PIKAL Petr
Hi see inline > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of fxen3k > Sent: Friday, October 05, 2012 11:28 AM > To: r-help@r-project.org > Subject: [R] Calculating the mean in one column with empty cells > > Hi all, > > I

Re: [R] (no subject)

2012-10-05 Thread Jean V Adams
DL, Looks like you have a typo in the expression() function. You had only one "s". This works for me ... m <- 10 beta.q <- matrix(rnorm(81), ncol=9) for (i in 1:9){ plot(seq(1/m, 1-1/m, 1/m), beta.q[, i], type="l", col=1, ylim=range(beta.q), xlab="quantile", ylab=expression(beta[i]))

Re: [R] Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves

2012-10-05 Thread Rui Barradas
Hello, Try length.out = max(length(loga), length(logb)) Note also that all of the previous code and the line above assumes that we are interested in the max distance, whereas the KS statistic computes the supremum of the distance. If it's a two sample test then their values are almost surely

Re: [R] glm (probit/logit) optimizer

2012-10-05 Thread Ben Bolker
Dimitris.Kapetanakis gmail.com> writes: > I am using glm function in order to estimate a logit model i.e. glm(Y ~ > data[,2] + data[,3], family = binomial(link = "logit")). > > I also created a function that estimates logit model and I would like it to > compare it with the glm function. > > S

[R] Bayesian inference distribution parameters

2012-10-05 Thread José Carlos Nogueira Cavalcante Filho
Dear all, I'm having a hard time trying to estimate in a bayesian way the parameters alpha and beta for a beta distributed set of data (frequency of occurrence). Do you have any suggestions or tutorials on how to estimate this? Best regards, JC [[alternative HTML version deleted]]

[R] Setting the desired reference category with contr.sum

2012-10-05 Thread autarkie
Hi, I have 6 career types, represented as a factor in R, coded from 1 to 6. I need to use the effect coding (also known as deviation coding) which is normally done by contr.sum, e.g. contrasts(career) <- contr.sum(6) However, this results in the 6th category being the reference, that is being c

[R] BCA Package

2012-10-05 Thread kokila
Hi...In R rankscore() function How to calculate estimation & validation & holdout?Iam waiting for replyPlease Reply. -- View this message in context: http://r.789695.n4.nabble.com/BCA-Package-tp4645146.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Calculating all possible ratios

2012-10-05 Thread Rui Barradas
Hello, Comment out the second apply and all following instructions using 'r2'. In the end return 'r1', not cbind. Hope this helps, Rui Barradas Em 04-10-2012 23:38, genome1976 escreveu: Hi Rui, A while ago you helped me with calculaing all possible ratios from a dataset. This is the co

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

2012-10-05 Thread fxen3k
Hi all, I recently tried to calculate the mean and the median just for one column. In this column I have numbers with some empty cells due to missing data. So how can I calculate the mean just for the filled cells? I tried: mean(dataSet2$ac_60d_4d_after_ann[!is.na(master$ac_60d_4d_after_ann)], n

[R] glm (probit/logit) optimizer

2012-10-05 Thread Dimitris.Kapetanakis
Dear all, I am using glm function in order to estimate a logit model i.e. glm(Y ~ data[,2] + data[,3], family = binomial(link = "logit")). I also created a function that estimates logit model and I would like it to compare it with the glm function. So, does anyone know what optimizer or optimi

Re: [R] Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves

2012-10-05 Thread user1234
Rui, Your response nearly answered a similar question of mine except that I also have ecdfs of different lengths. Do you know how I can adjust x <- seq(min(loga, logb), max(loga, logb), length.out=length(loga)) to account for this? It must be in length.out() but I'm unsure how to proceed.

Re: [R] avoid <<- in specific case

2012-10-05 Thread Duncan Murdoch
On 05/10/2012 8:19 AM, Berry Boessenkool wrote: Hi all, I improved a function drawing horizontal histograms (code below) which uses barplot and works fine. It does,however, need to assign a function to the global environment to later find the actual location on the vertical axis, and not the

[R] avoid <<- in specific case

2012-10-05 Thread Berry Boessenkool
Hi all, I improved a function drawing horizontal histograms (code below) which uses barplot and works fine. It does,however, need to assign a function to the global environment to later find the actual location on the vertical axis, and not the number of bars used by barplot. Hopefully, runni

Re: [R] Creating vegetation distance groups from one column

2012-10-05 Thread Rui Barradas
Hello, That now seems to be a presentation problem. See this example: x <- 0:30 + runif(124) y <- cut(x, breaks = seq(0, 35, 5)) l <- levels(y) l1 <- sub("\\]", ")", l[1]) l2 <- as.numeric(sub("\\(([[:digit:]]+),.*", "\\1", l[-1])) + 1 l3 <- sub(".*,([[:digit:]]+).*", "\\1", l[-1]) l.new <- c(

Re: [R] How to add a new row in to an existing data set in R Language?

2012-10-05 Thread arun
Hi Karthick, Not sure if I understand your message correctly.  Are you saying that the SAS merge as shown in the image (Nabble) is correct?. The fourth row in the merged data (105 21JUN1980 21JAN2006) is incorrect. A.K. - Original Message - From: killerkarthick To: r-help@r-project

  1   2   >