Re: [R] Help on merging without a common variable

2012-08-02 Thread Petr PIKAL
Hi OTOH I wonder why cbind gives error as OP told us x <- data.frame(x = 1:5) y <- data.frame(y = 6:15) merge(x,y) cbind(x,y) Gives different results but without any error. Regards Petr > > On Thu, Aug 2, 2012 at 4:52 PM, Ayyappa Chaturvedula > wrote: > > Michael, > > Thank you for this ,

[R] Binary Quadratic Opt

2012-08-02 Thread khris
Hi Bert, I won't post any more messages on this thread as problem has shifted from Optimization in R to Graph Algorithms. Rest fine Khris. On Aug 2, 2012, at 9:13 PM, Bert Gunter [via R] wrote: > This discussion needs to be taken off (this) list, as it appears to > have nothing to do with R.

Re: [R] Binary Quadratic Opt?

2012-08-02 Thread khris
Thanks for the response Petr On Aug 2, 2012, at 11:11 PM, Petr Savicky [via R] wrote: > On Thu, Aug 02, 2012 at 02:27:43AM -0700, khris wrote: > > > > > On Aug 2, 2012, at 12:39 PM, Petr Savicky [via R] wrote: > > > > > On Wed, Aug 01, 2012 at 04:55:30AM -0700, khris wrote: > > > > Hi Petr,

Re: [R] How to adjust legend in a plot?

2012-08-02 Thread Pramod
The only way then i believe is to reduce the width of the bars. Make it 0.5 in case if the numbers of variable allows you to do so. -- View this message in context: http://r.789695.n4.nabble.com/How-to-adjust-legend-in-a-plot-tp4638995p4639002.html Sent from the R help mailing list archive at N

Re: [R] Kruskal-Wallis test and kruskalmc

2012-08-02 Thread greatest.possible.newbie
I didn't do any research about this but I think it's the following: If you run several t-tests to compare groups and then do a tukey-HSD you won't get the same results either. It's the same with the kruskal-wallis test. This happens because the variance that is used for computing significant differ

Re: [R] How to adjust legend in a plot?

2012-08-02 Thread Manish Gupta
No, My X label are so big so i cannot reduce margin and cex change won't affect it much. Is there any way to write legend first and start plot later. Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-adjust-legend-in-a-plot-tp4638995p4638997.html Sent from the R h

[R] Multiple Comparisons-Kruskal-Wallis-Test: kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results although they should do (?)

2012-08-02 Thread greatest.possible.newbie
Hi there, I am doing multiple comparisons for data that is not normally distributed. For this purpose I tried both functions kruskal{agricolae} and kruskalmc{pgirmess}. It confuses me that these functions do not yield the same results although they are doing the same thing, don't they? Can anyone

[R] How to adjust legend in a plot?

2012-08-02 Thread Manish Gupta
Hi, I am working on bar plot and legend overlap plot. I attempted all position like topright, bottomright, topleft and bottomleft still same pblm is there. par(mar=c(5,22.5,2,2)) barplot(t(data[,2:3]) , beside=TRUE, col=c(rgb(.537, .769, .933),rgb(.059, .412, .659)), width = 1, horiz=TRUE,cex.na

Re: [R] Formatting numbers for display

2012-08-02 Thread arun
Hi, For your first condition, this could be used: gsub("(\\d)[.].*","\\1",49888.85) [1] "49888" Second condition: formatC(4333.78889,width=8,format="f",digits=2,flag="0") #[1] "04333.79"  formatC(884333.78889,width=8,format="f",digits=2,flag="0") #[1] "884333.79" Third condition: sprintf

Re: [R] [O/T] Good bash or Linux shell command book

2012-08-02 Thread Jorge Hernandez
If you are looking for an introduction, and for Linux in particular, I recommend the last twelve chapters of "The Linux Command Line" (William Shotts) which you can download in pdf from the following link. http://linuxcommand.org/tlcl.php Regards, Jorge On Thu, Aug 2, 2012 at 7:05 PM, Erin Hodge

Re: [R] text search in r

2012-08-02 Thread arun
Hi, One more solution: new<-"BABBBABB" resAB<-count(unlist(strsplit(gsub("AB",1,new),""))==1)[2,]  resAB # x freq #2 TRUE    3 resBA<-count(unlist(strsplit(gsub("BA",2,new),""))==2)[2,]  resBA # x freq #2 TRUE    2 new1<-c("ABABAAABABBABABBA") resAB<-count(unlist(strsplit(gsub

Re: [R] text search in r

2012-08-02 Thread arun
Hi, You could also use these: library(Biostrings)  gregexpr2("AB",new) #[[1]] #[1]  4 10 14  length(unlist(gregexpr2("AB",new))) #[1] 3  length(unlist(gregexpr2("BA",new))) #[1] 2 matchPattern("AB",new)  # Views on a 16-letter BString subject #subject: BABBBABB #views:   #  start end wid

[R] problem with fitting tevCopula

2012-08-02 Thread wcurrent
Hi everyone I'm trying to estimate both the rho parameter and the degree of freedom of t-ev copula from the data using the "fitCopula" function in the "copula" package. cop <- tevCopula(0.8) est <- fitCopula(cop, x, method="ml"); However, there is always an error and it says: Error: length(cop

Re: [R] How to adjust legend in a plot?

2012-08-02 Thread Pramod
I would suggest the following: 1. Change the margins of the third axis from 5.2 to say 2.5. 2. Reduce the cex in the legend from 1.5 to say 0.75 I think this should work for you. -- View this message in context: http://r.789695.n4.nabble.com/How-to-adjust-legend-in-a-plot-tp4638995p4638996.

Re: [R] embedding data frame in R code?

2012-08-02 Thread Gabor Grothendieck
On Thu, Aug 2, 2012 at 8:57 PM, ivo welch wrote: > I would like to insert a few modest size data frames directly into my > R code. a short illustration example of what I want is > > d <- read.csv( _END_, row.names=1 ) > , "col1", "col2" > "row1",1,2 > "row2",3,4 > __END__ > > right now, the da

Re: [R] embedding data frame in R code?

2012-08-02 Thread Dirk Eddelbuettel
On 3 August 2012 at 03:15, William Dunlap wrote: | > and you probably want closeAllConnections() immediately following | | No you do not want to close all connections. You should close each | connection that you open, but not others (they may be used by other | functions like sink() or capture.o

Re: [R] embedding data frame in R code?

2012-08-02 Thread William Dunlap
> and you probably want closeAllConnections() immediately following No you do not want to close all connections. You should close each connection that you open, but not others (they may be used by other functions like sink() or capture.output()). Use something like: readTableFromText <-funct

[R] Formatting numbers for display

2012-08-02 Thread Dennis Fisher
Colleagues R 2.15.1 OS X I have a lengthy script that generates a positive number that I display in a graphic using text. The range of possible values is quite large and I am looking for an efficient means to format. 1. If the number is large (e.g., > 10^7), I want to display only t

Re: [R] Metafor package: Including multiple (categorical) predictors

2012-08-02 Thread Jeremy Miles
The test of moderator coefficients (QM) is chi-square distributed.You can use the change in this value when you add a predictor to the model as a chi-square test, with df equal to the change in df. Jeremy On 2 August 2012 05:54, Bexkens, Anika wrote: > Dear Metafor users, > > I'd like to test a

Re: [R] summary(svyglm) Pr (> | t |) ?

2012-08-02 Thread John Fox
Dear Diana, > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Diana Marcela Martinez Ruiz > Sent: August-02-12 5:00 PM > To: j...@mcmaster.ca; tlum...@uw.edu; Ayuda en R > Subject: Re: [R] summary(svyglm) Pr (> | t |) ? > > > T

Re: [R] embedding data frame in R code?

2012-08-02 Thread David Winsemius
On Aug 2, 2012, at 5:57 PM, ivo welch wrote: I would like to insert a few modest size data frames directly into my R code. a short illustration example of what I want is d <- read.csv( _END_, row.names=1 ) , "col1", "col2" "row1",1,2 "row2",3,4 __END__ right now, the data sits in external

Re: [R] embedding data frame in R code?

2012-08-02 Thread R. Michael Weylandt
I'm not sure I entirely understand the question, but the closest thing I can think of to a data frame literal, excepting dput(), would be this: d <- read.csv(textConnection(" a, b 1, cow 2, dog 3, cat"), header = TRUE) and you probably want closeAllConnections() immediately following to avoid a w

[R] embedding data frame in R code?

2012-08-02 Thread ivo welch
I would like to insert a few modest size data frames directly into my R code. a short illustration example of what I want is d <- read.csv( _END_, row.names=1 ) , "col1", "col2" "row1",1,2 "row2",3,4 __END__ right now, the data sits in external files. I could put each column into its own vec

Re: [R] Alternating between "for loops"

2012-08-02 Thread Claudia Penaloza
Thank you very much for all your suggestions. I am very sorry my code is so crude (it gives me a headache too!), I'm very new to R programing. I will have to look at your suggestions/questions very carefully (I'm barely holding on at this point) and get back to you (Dr. Winsemius) with some answers

Re: [R] Plotting Where People Live on a U.S. Map

2012-08-02 Thread Sarah Goslee
Hi Dan, For question 1, yes you'll need geographic coordinates. I thinknit's possible to get a shapefile of zip codes, but maybe someone else will know the details. For #2, you probably want maps instead of map, and you need to load a package before you can use it: install.packages("maps") libra

[R] Plotting Where People Live on a U.S. Map

2012-08-02 Thread Lopez, Dan
Hi, QUESTION TOPIC #1 I have some data I want to plot on a map. But what I have are home addresses: street, City, State, complete postal code--i.e 95377-1234. Is there a way to plot this data or do I need latitudinal and longitude coordinates? If so how do I convert them? Is there a package tha

Re: [R] [O/T] Good bash or Linux shell command book

2012-08-02 Thread R. Michael Weylandt
On Thu, Aug 2, 2012 at 6:05 PM, Erin Hodgess wrote: > Dear R People: > > Sorry for the off topic question, but here it goes: could someone > recommend a good bash shell programming book, please? Don't know if it's the best, but it worked for me and it comes from a semi-official source: http://t

Re: [R] Polygon shaded area

2012-08-02 Thread R. Michael Weylandt
On Thu, Aug 2, 2012 at 5:53 PM, Jose Narillos de Santos wrote: > Many thanks Eik it works properly. > > what I don´t know exactly is why you put > c(xv,rev(xv)),c(efinal,rev(efinal2)),col="red" inside polygon. I see it > works but for the moment I don´t really see the meaning of c() and why is > n

[R] [O/T] Good bash or Linux shell command book

2012-08-02 Thread Erin Hodgess
Dear R People: Sorry for the off topic question, but here it goes: could someone recommend a good bash shell programming book, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail

Re: [R] text search in r

2012-08-02 Thread Eloi Mercier
There's no need for 'strsplit' here. new=c("BABBBABB") A2B <- gregexpr("AB", new) B2A <- gregexpr("BA", new) length(A2B[[1]]) #3 length(B2A[[1]]) #2 Cheers, Eloi On 12-08-02 03:44 PM, David Winsemius wrote: On Aug 2, 2012, at 2:27 PM, rnewbie565 wrote: I am trying to count the numb

Re: [R] Polygon shaded area

2012-08-02 Thread Jose Narillos de Santos
Many thanks Eik it works properly. what I don´t know exactly is why you put c(xv,rev(xv)),c(efinal,rev(efinal2)),col="red" inside polygon. I see it works but for the moment I don´t really see the meaning of c() and why is needed to put twice and so on. If I had a vector of dates associated with e

Re: [R] Joining R Local Dataset with Table from Database

2012-08-02 Thread R. Michael Weylandt
You'll either need to do it in R or Oracle (I'm not sure you can do it directly across the ODBC boundary) -- I'd actually think Oracle would be more performant for this sort of thing. But anyways, import your data from Oracle into R as a data.frame and then look at the ?merge command. Best, Micha

[R] metafor- interpretation of moderators test for raw proportions

2012-08-02 Thread cpanderson
Hello metafor users, I'm using metafor to perform a single-effect summary estimate of the raw proportion of patients experiencing a post-operative complication, and I'm interested in seeing if this proportion differs between the three most commonly used surgical techniques. The software is working

Re: [R] text search in r

2012-08-02 Thread David Winsemius
On Aug 2, 2012, at 2:27 PM, rnewbie565 wrote: I am trying to count the number of times that the characters in a string change For example- new=c(BABBBABB) Presumably you meant to quote that string. I want to find the number of times that B changes to A and the number of times tha

Re: [R] te( ) interactions and AIC model selection with GAM

2012-08-02 Thread Ricardogg
- About the first question, I was not sure about what was the proper model ( a) or b) ) because I saw this at the end of the help for te ---> ?te : n <- 500 v <- runif(n);w<-runif(n);u<-runif(n) f <- test2(u,v,w) y <- f + rnorm(n)*0.2 # tensor product of 2D thin plate regression spline and 1D c

Re: [R] Subset data

2012-08-02 Thread arun kirshna [via R]
HI David, I realized it immediately after sending the message from email and corrected it in Nabble as yahoo mail is down. A.K. __ If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/Subset-data-tp463

Re: [R] Correlating different sets of variables?

2012-08-02 Thread danobolg321
Thanks for the reply. Maybe I am not describing this appropriately - but ultimately I am looking for items in matrix B that co-vary with items in matrix A. In the case below: http://r.789695.n4.nabble.com/file/n4638966/Slide1.jpg The values for Apples co-vary with Rice and Beans. The aim is t

Re: [R] apply function over same column of all objects in a list

2012-08-02 Thread arun kirshna [via R]
Thanks Elk, That was the missing link. #or lapply(list6,function(x)max(x$target)) [[1]] [1] 6 [[2]] [1] 18 [[3]] [1] 9 max(unlist(lapply(list6,function(x) max(x$target A.K. ___ If you reply to this email, your message will be added to the disc

[R] RCassandra: RC.read.table error

2012-08-02 Thread am
Hi, I'm trying to read in some data from Cassandra in a column family called DemoCF. I am able to connect to the cluster, describe and use the keyspace. *> conn <- RC.connect(host='', port=)* *> RC.describe.keyspace(conn2, 'DemoKS')* $name [1] "DemoKS" $strategy_class [1] "org.apache.cassandra.l

[R] text search in r

2012-08-02 Thread rnewbie565
I am trying to count the number of times that the characters in a string change For example- new=c(BABBBABB) I want to find the number of times that B changes to A and the number of times that A changes to B. I tried the grep command but I only figured out the positions of when B changes to

[R] Joining R Local Dataset with Table from Database

2012-08-02 Thread Madana_Babu
Hi All, I want to join a table (Dataset) that is created in R with a table that is in oracle database. Can some one help me in accomplishing this task in R? Example Code: library(RODBC) DB_CONNECT <- odbcConnect("DSN_NAME") TABLE_JOIN <- sqlQuery(DB_CONNECT, "SELECT * FROM DB_TABLE WHERE COL_1

Re: [R] Help on merging without a common variable

2012-08-02 Thread R. Michael Weylandt
On Thu, Aug 2, 2012 at 4:52 PM, Ayyappa Chaturvedula wrote: > Michael, > Thank you for this , it worked. I was thinking "by" is a required argument > in merge function. > Well, it is "required" in a strict sense, but it has a default value (defaulting to the shared names) so _you_ don't have to

Re: [R] Correlating different sets of variables?

2012-08-02 Thread R. Michael Weylandt
On Thu, Aug 2, 2012 at 3:47 PM, danobolg321 wrote: > This is a fairly entry level question - so any guidance on this would be > appreciated... > > I have two sets of residuals, one of 100 values (A), and one of 10,000 > values (B). There are 50 paired sets of these values. The data is in the > for

Re: [R] Help on merging without a common variable

2012-08-02 Thread R. Michael Weylandt
You can merge without a common variable: x <- data.frame(x = 1:5) y <- data.frame(y = 6:10) merge(x,y) works just fine (for one set of expectations) If you need more help, please do make a reproducible example (as requested of all R-help posts): the instructions here might help http://stackove

Re: [R] ggplot does not show in knitr

2012-08-02 Thread R. Michael Weylandt
See R FAQ 7.22 for the gory details -- It needs to go around the qplot() statement. In interactive use, most objects are "printed" after evaluation: sometimes this doesn't happen because the returned value is marked invisible. For grid graphics objects (of which ggplot objects are a type), this "p

Re: [R] Subset data

2012-08-02 Thread Ista Zahn
Hi Antonio, It's hard to know for sure what the problem is, because we don't know what your vef1 data.frame contains. My guess is that edad11 is not numeric, so never equals 0 (although it might equal the character string "0"). If you paste the results of str(vef1) in your reply we can see if my

[R] Help on merging without a common variable

2012-08-02 Thread Ayyappa Chaturvedula
Dear All, I want to create a dataset for a NONMEM simulation. I have a dataframe with individual PK parameters and want to create a dosing sceinario in a second dataframe. I want to merge them both so that every individiual's PK parameters are combined with the dosing scenario into one. I do not

[R] Correlating different sets of variables?

2012-08-02 Thread danobolg321
This is a fairly entry level question - so any guidance on this would be appreciated... I have two sets of residuals, one of 100 values (A), and one of 10,000 values (B). There are 50 paired sets of these values. The data is in the form of two matrices (100x50 and 10,000x50). The goal is to corre

Re: [R] summary(svyglm) Pr (> | t |) ?

2012-08-02 Thread Diana Marcela Martinez Ruiz
Thanks for the info, but with the anova () is obtained p_valor of Wald test for the variable level of education, I want to see the nievel p_valor in view of this variable as a dummy, so I wonder if in summary (mod. logis) the Pr (> | t |) lets me know if each level is significant in the mod

Re: [R] summary(svyglm) Pr (> | t |) ?

2012-08-02 Thread John Fox
Dear Diana, The Anova() function in the car package will produce a Wald test for each term in a model fit by svyglm(). I hope this helps, John > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Diana Marcela Martinez Ruiz > Sen

Re: [R] ggplot does not show in knitr

2012-08-02 Thread firdaus.janoos
Could you elaborate on this ? Where would the print /plot statement go ? On Thu, Aug 2, 2012 at 4:38 PM, Michael Weylandt wrote: > You need to explicitly print() the graphs to make them show -- or in > recent ggplot2 versions I think you can also use plot() as an alias. > > Michael > > On Aug 2,

Re: [R] Need Help in Finite Element Analysis

2012-08-02 Thread Bert Gunter
On Thu, Aug 2, 2012 at 1:23 PM, Abdul wrote: > Hi everybody > I need help to solve the following problem in finite element We don't do homework on this list. Especially homework that has essentially nothing to do with R. -- Bert > A field variable f(x,y)=xᵌ y is defined over a rectangle domain

Re: [R] Need Help in Finite Element Analysis

2012-08-02 Thread Michael Weylandt
On Aug 2, 2012, at 3:23 PM, Abdul wrote: > Hi everybody > I need help to solve the following problem in finite element > A field variable f(x,y)=xᵌ y is defined over a rectangle domain > Ω={K: 0≤x≥4 , 0≤y≥6” Given the expression > g=∬_(0 0)^(6 4)▒〖X^3 Y dx dy〗 > And assume the following

Re: [R] parallel SNOW slower than single core?

2012-08-02 Thread Prof Brian Ripley
On 02/08/2012 19:13, Jie wrote: Dear All, I am learning parallel in R and start with the package "snow". I did a test about running time and the parallel version is much slower than the regulat code. My laptop is X200s with dual core intel L9400 cpu. The OS matters far more. Overheads on Wind

Re: [R] ggplot does not show in knitr

2012-08-02 Thread Michael Weylandt
You need to explicitly print() the graphs to make them show -- or in recent ggplot2 versions I think you can also use plot() as an alias. Michael On Aug 2, 2012, at 2:37 PM, "firdaus.janoos" wrote: > Hello, > > I'm having some issues getting a ggplot figure to show up in the knitr > output,

Re: [R] Need Help in Finite Element Analysis

2012-08-02 Thread Sarah Goslee
Abdul, this list is not for answering your homework questions. On Thu, Aug 2, 2012 at 4:23 PM, Abdul wrote: > Hi everybody > I need help to solve the following problem in finite element > A field variable f(x,y)=xᵌ y is defined over a rectangle domain > Ω={K: 0≤x≥4 , 0≤y≥6” Given the expression

Re: [R] Cannot install the 'igraph' package

2012-08-02 Thread Prof Brian Ripley
On 02/08/2012 18:06, K. Elo wrote: Hi! On Thu, 2 Aug 2012, Uwe Ligges wrote: R.h should be part if your R installation, given the output above probably in /usr/lib64/R/include ? But there is no such file "R.h" in my system??? ~$ locate \/R.h ~$ Or with 'find': # find / -name R.h # Any ide

[R] Need Help in Finite Element Analysis

2012-08-02 Thread Abdul
Hi everybody I need help to solve the following problem in finite element A field variable f(x,y)=xᵌ y is defined over a rectangle domain Ω={K: 0≤x≥4 , 0≤y≥6” Given the expression g=∬_(0 0)^(6 4)▒〖X^3 Y dx dy〗 And assume the following bilinear interpolation shape functions are used to discr

[R] ggplot does not show in knitr

2012-08-02 Thread firdaus.janoos
Hello, I'm having some issues getting a ggplot figure to show up in the knitr output, when placed in a loop. Specifically, I have a loop inside a knitr chunk : ```{r fitting, warning=FALSE, fig.width=10, fig.height=10, fig.keep='high'} for (t in 1:T) { # do a regression of tgt.vals ~ predi

[R] summary(svyglm) Pr (> | t |) ?

2012-08-02 Thread Diana Marcela Martinez Ruiz
Hello I want to know if the summary of the logistic model with survey Pr (> | t |) to test if the coefficient of the model is significant, ie is the p_valor wald test for the model coefficients, for I am interested to know if the three levels of the variable educational level are significant

[R] Can anyone explain me how to use genpoisson{VGAM} ? Its urgent please!

2012-08-02 Thread Humayera Islam
Dear All, I have some questions regarding using the genpoisson{VGAM} . genpoisson(llambda="elogit", ltheta="loge", elambda=if(llambda=="elogit") list(min=-1,max=1) else list(), etheta=list(), ilambda=NULL, itheta=NULL, use.approx=TRUE, method.init=1, zero=1) and

Re: [R] apply function over same column of all objects in a list

2012-08-02 Thread Eik Vettorazzi
Hi Arun, if you name the data.frame in the list, e.g. mango <- list( y=c(4,5,3,2,1,8), bw=c(4,18,12,3,4,9), nn=paste0("a",1:6),target=data.frame(coconut=1:6)) banana <- list(target=data.frame(coconut=c(1,2,18,16,15)), y=c(4,5,9,2,1), bw=c(4,18,22,3,4), nn=paste0("a",1:5)) pineapple <- list(target=d

Re: [R] Subset data

2012-08-02 Thread David Winsemius
On Aug 2, 2012, at 12:00 PM, arun wrote: Hello, You need to use, subset(vef1,vef1$edad1==0) That should not be necessary (and quite defeats the usual value of subset()'s nonstandard evaluation): > vef1<-read.table(text=" + age edad1 + 12 1 + 10 0 + 9 0 + 14 1 + 15 1

[R] multiple comparisons for GAMs

2012-08-02 Thread Bird_Girl
Hi, I have a question regarding whether it is possible to do post hoc tests on a model fit with GAM {mgcv}. My response variable is abundance (no. individuals per plot), and I have one continuous predictor (light) and one factor (height) which includes 7 levels. > mod2=gam(log_abundance~s(light

[R] Changing the classification threshold for cost function

2012-08-02 Thread SiBorg
Dear All I am trying to perform leave-one-out cross validation on a logistic regression model using cv.glm from the boot package in R. As I understand it, the standard cost function: cost<-function(r,pi=0) mean(abs(r-pi)>0.5) Uses a 50% risk threshold to classify cases as positive or negative a

Re: [R] Subset data

2012-08-02 Thread arun
Hello, You need to use, subset(vef1,vef1$edad1==0) vef1<-read.table(text=" age  edad1 12 1 10 0 9  0 14 1 15 1 ",sep="",header=TRUE) subset(vef1,vef1$edad1==0)   age edad1 2  10 0 3   9 0 A.K. - Original Message - From: "antonio.bso...@sapo.pt" To: r-h

Re: [R] package "rms" nomogram

2012-08-02 Thread David Winsemius
On Aug 1, 2012, at 8:09 PM, B787s wrote: well, the article from this high impact factor journal mentioned about each step for building a nomogram including interpretation without going too much detail into statistical concept. All I want to know is what the R code does to come up with the

Re: [R] Subset data

2012-08-02 Thread R. Michael Weylandt
Hmmm a trivial mockup suggests this should work: x <- factor(sample(c(0, 1), 30, TRUE) x == 0 so perhaps you could work up a reproducible example for us: see this site for more details on how to do so: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Be

[R] Ad Hoc comparison non parametric ANCOVA

2012-08-02 Thread Luis Fernando García Hernández
Dear R Users, Recently I began to use R. I`m interested about comparing several regression curves. REcently I found the package sm and the function sm.ancova which I understand allows me to do this. I applied this function to my data (seven regression curves) and I found that there are significant

Re: [R] parallel SNOW slower than single core?

2012-08-02 Thread R. Michael Weylandt
I'm not surprised -- you're doing a fairly trivial calculation so the overhead of setting up the parallelization is likely more than the benefit from halving the computation time. Do it on a larger calculation and I imagine the performance will be better -- I might just be pulling this out of thin

[R] predictions from hurdle model

2012-08-02 Thread erin
I ran a negative binomial logit hurdle model and am now trying to plot the effects of a continuous predictor variable (the only variable in my model) on the count and zero component and the overall mean response. I'm confused because for some values, the predicted overall mean is higher than the m

Re: [R] apply function over same column of all objects in a list

2012-08-02 Thread arun kirshna [via R]
Hi Elk, I tried to test with another case where coconut is in different position in the sublist. mango <- list( y=c(4,5,3,2,1,8), bw=c(4,18,12,3,4,9), nn=paste0("a",1:6),data.frame(coconut=1:6)) banana <- list(data.frame(coconut=c(1,2,18,16,15)), y=c(4,5,9,2,1), bw=c(4,18,22,3,4), nn=paste0("a",1:

Re: [R] apply function over same column of all objects in a list

2012-08-02 Thread arun kirshna [via R]
Hello, I was in a hurry at the time, when I replied. You could do one thing: extract sublist using: list4 <- list(mango, banana, pineapple) b1<-list() for(i in 1:3){ b1[[i]]<-list() b1[[i]]<-list4[[i]][1] } b1 b<-list() for(i in 1:3){ b[[i]]<-list() b[[i]]<-lapply(b1[[i]][[1]],FUN=functio

Re: [R] apply function over same column of all objects in a list

2012-08-02 Thread arun kirshna [via R]
Hi Elk, Thanks for the input. Somehow, I got entangled with which.max. I should have used max. lapply(list4,function(x) max(x[[1]]$coconut)) [[1]] [1] 6 [[2]] [1] 18 [[3]] [1] 9 max(unlist(lapply(list4,function(x) max(x[[1]]$coconut #[1] 18 A.K.

Re: [R] te( ) interactions and AIC model selection with GAM

2012-08-02 Thread Ricardogg
- About the visualization, my question is more about interpretation. In the case of : model_name <- gam ( bm ~ t + te (t_year, temp_W, temp_sept, k = 5, bs = c( “cc”,”cr”,”cr”)), data = data) * a)* vis.gam (model_name , view= c(“t_year”, “temp_W”)) *b)* vis.gam (model_name , view= c(“t_year

[R] need help and its urgent!

2012-08-02 Thread Humayera Islam
Can you tell me what does the option "zero" in genpoisson{VGAM} mean? zero An integer vector, containing the value 1 or 2. If so, *ë* or *theta*respectively are modelled as an intercept only. If set to NULL then both linear/additive predictors are modelled as functions of the explanatory variable

[R] question on zoo package

2012-08-02 Thread ch chor
Hi all, I have made a lot of attempts with ts package and arima model for forecasting. Now I am looking on zoo package. I follow Gabor's steps from another post on leap years https://stat.ethz.ch/pipermail/r-help/2011-February/269069.html and I am confused in that step: # put dates (without Feb

[R] Subset data

2012-08-02 Thread antonio.bso...@sapo.pt
Hi Need a little help. This is easy question, but i´m new to R. I want to subset a data frame called vef1 using a variable that is a factor called edad11, 0 if under 11 years, 1 otherwise. I tried: vef1.sub<-subset(vef1, edad11==0) The code runs correctly but i get a empty dataframe. If i use thi

[R] parallel SNOW slower than single core?

2012-08-02 Thread Jie
Dear All, I am learning parallel in R and start with the package "snow". I did a test about running time and the parallel version is much slower than the regulat code. My laptop is X200s with dual core intel L9400 cpu. Should I make more clusters than 2? Or how to improve the performance? # insta

Re: [R] Binary Quadratic Opt?

2012-08-02 Thread Petr Savicky
On Thu, Aug 02, 2012 at 02:27:43AM -0700, khris wrote: > > On Aug 2, 2012, at 12:39 PM, Petr Savicky [via R] wrote: > > > On Wed, Aug 01, 2012 at 04:55:30AM -0700, khris wrote: > > > Hi Petr, > > > > > > It been sometime since I wrote. But here are the latest developments. > > > > > > When I

Re: [R] te( ) interactions and AIC model selection with GAM

2012-08-02 Thread Simon Wood
On 02/08/12 18:02, Bert Gunter wrote: Well, geez! Without trying to upstage SImon, why not google it yourself?! http://en.wikipedia.org/wiki/Akaike_information_criterion -- one or two slightly surprising statements in there though :-) I quite like the coverage in Davison (2003) "Statistical Mod

Re: [R] Optimize a function with Discrete inputs

2012-08-02 Thread R. Michael Weylandt
On Thu, Aug 2, 2012 at 5:58 AM, loyolite270 wrote: > oh sorry .. > > The detailed description of the problem is given below > > dataFrame is matrix of dim 100X100 with some values Odd name for something that's not a dataFrame (i.e., data.frame != matrix) > a is a vector of length 1 > x is a

Re: [R] apply function over same column of all objects in a list

2012-08-02 Thread Eik Vettorazzi
I still try to figure out, what you are finally asking for, but maybe res<-sapply(list4,function(x)max(x[[1]]$coconut)) names(res)<-c("mango", "banana", "pineapple") res max(res) is worth a try? Especially i did not get the point of doing something like x[which.max(x)] because this is in any cas

Re: [R] Filter a matrix with a matrix HELP!

2012-08-02 Thread R. Michael Weylandt
On Thu, Aug 2, 2012 at 8:16 AM, Cloneberry wrote: > Hi, > just during these vacation days, I'm trying to approach with multicore > package > and I have some troubles with foreach. > What I'm trying to do is to extract a data in coordinate (ii,jj) from a > matrix2, > only if the data in the same co

Re: [R] te( ) interactions and AIC model selection with GAM

2012-08-02 Thread Will Shadish
Bert, thanks for the very useful link. I am duly chastised for not having searched thoroughly enough. Will On 8/2/2012 10:02 AM, Bert Gunter wrote: Well, geez! Without trying to upstage SImon, why not google it yourself?! http://en.wikipedia.org/wiki/Akaike_information_criterion (seemed pret

[R] buffering output to the console

2012-08-02 Thread Berry Boessenkool
Hey all, I was wondering about the order of execution of functions and found that, in fact, I should look at the topic of buffering output to the console. Which I did - below are some links of related topics, in case anyone wants to read up on it. I decided to change the concerning lines in t

Re: [R] Cannot install the 'igraph' package

2012-08-02 Thread K. Elo
Hi! On Thu, 2 Aug 2012, Uwe Ligges wrote: R.h should be part if your R installation, given the output above probably in /usr/lib64/R/include ? But there is no such file "R.h" in my system??? ~$ locate \/R.h ~$ Or with 'find': # find / -name R.h # Any ideas? Kind regards, Kimmo __

Re: [R] te( ) interactions and AIC model selection with GAM

2012-08-02 Thread Bert Gunter
Well, geez! Without trying to upstage SImon, why not google it yourself?! http://en.wikipedia.org/wiki/Akaike_information_criterion (seemed pretty clear to me...) -- Bert On Thu, Aug 2, 2012 at 9:54 AM, Will Shadish wrote: > Simon, could you clarify this paragraph. We are submitting to a psych

Re: [R] finding the MLEs of IG parameters by EM-Alorithm

2012-08-02 Thread peter dalgaard
On Aug 2, 2012, at 16:01 , Sara S wrote: > Dear all > > I'm trying to caculate the MLEs for parameters of Inverse Gaussian > distribution (in a k-sample problem with common mean) by using > EM-Algorithm. I found some package for EM-Algorithm that are useful > for missing or incomplete data and

Re: [R] te( ) interactions and AIC model selection with GAM

2012-08-02 Thread Will Shadish
Simon, could you clarify this paragraph. We are submitting to a psychology journal and I am certain they will be asking us about why it is still ok to use AIC for non-nested models. Thanks. Will Shadish On 8/2/2012 9:49 AM, Simon Wood wrote: For AIC model comparison, the usual advice applies th

Re: [R] te( ) interactions and AIC model selection with GAM

2012-08-02 Thread Simon Wood
Ricardo, Your second construction (b) is the correct one (in a you are asking for one marginal to be a 2 dimensional cubic regression spline, which doesn't exist in mgcv). For visualization, would the example at the end of ?te be the thing to do? In 3d I find looking at a series of 2d slices

Re: [R] Naive Bayes in R

2012-08-02 Thread Saeed Abu Nimeh
You can use a table to compare your predicted values and the response. Here is an example: http://www.cyclismo.org/tutorial/R/tables.html On Thu, Aug 2, 2012 at 5:52 AM, Abraham Mathew wrote: > I'm developing a naive bayes in R. I have the following data and am trying > to predict on returned (cl

Re: [R] phantom NA/NaN/Inf in foreign function call (or something altogether different?)

2012-08-02 Thread Cecile De Cat
Sorry. I've used: > library(rms) I realise I still have a lot to learn to ask questions well - it took me a long time to compile this one, but I've obviously missed important things. Please see below for the session info. > sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i

Re: [R] How to link two R packages together

2012-08-02 Thread Xuan Zhao
Hi Michael, Thank you so much for the help Michael! When I put my package 'PKG2' (on which PKG1 is depending on) in the regular place, perhaps a place R CMD check won't look at, then when I try to build PKG1, they will say PKG2 required but not found, so I have to put it under a directory R look

Re: [R] How to link two R packages together

2012-08-02 Thread Xuan Zhao
Hi Josh, Thank you so much for your detailed explanation. It's very clear, and now I can understand the difference between depends and imports. Thank you so much for your help!! I really really appreciate it! Yours, Xuan -Original Message- From: Joshua Wiley [mailto:jwiley.ps...@gmail.com

[R] finding the MLEs of IG parameters by EM-Alorithm

2012-08-02 Thread Sara S
Dear all I'm trying to caculate the MLEs for parameters of Inverse Gaussian distribution (in a k-sample problem with common mean) by using EM-Algorithm. I found some package for EM-Algorithm that are useful for missing or incomplete data and are not helpful for solving my problem. (Exactly, the p

[R] Restricted VECM-VAR representation

2012-08-02 Thread dha3000
Hey guys, I am using the "urca" and "vars" package to estimate a VECM. I already estimated the VECM with the ca.jo, put restrictions on the cointegration and loading matrix via "alrtest", "blrtest" and "ablrtest" and finally reesimated the restricted VECM with cajorls. Is it possible to transfor

Re: [R] Subseting

2012-08-02 Thread arun
Hi, Try this: Here, in the example dataset, you have 3 banks.  Suppose, I want to delete 2 banks randomly out of 3, (you can name your specific banks to delete), dat1<-read.table(text=" Year  Name totalliabilties assets 1990  a  90    10 1991  a  89    48 1

Re: [R] Binary Quadratic Opt?

2012-08-02 Thread Bert Gunter
This discussion needs to be taken off (this) list, as it appears to have nothing to do with R. -- Bert On Thu, Aug 2, 2012 at 2:27 AM, khris wrote: > > On Aug 2, 2012, at 12:39 PM, Petr Savicky [via R] wrote: > >> On Wed, Aug 01, 2012 at 04:55:30AM -0700, khris wrote: >> > Hi Petr, >> > >> > It

Re: [R] apply function over same column of all objects in a list

2012-08-02 Thread arun kirshna [via R]
Hello, If I understand it now, can't you do this: Individual cases: list4<-list(mango[[1]],banana[[1]],pineapple[[1]]) b<-list() for(i in 1:3){ b[[i]]<-list() b[[i]]<-lapply(list4[[i]],FUN=function(x)x[which.max(x)]) } b1<-data.frame(do.call(rbind,b)) row.names(b1)<-c("mango","banana","pineap

  1   2   >