[R] Major discrepancy between R and Stata for ARIMA

2014-04-09 Thread Benster, Tyler
Hi all, I've been looking through documentation to try to understand why Stata and R occasionally come up with very different parameter estimates for ARIMA, and am stumped. Existing discussion on this question, including code, can be found here: https://stackoverflow.com/questions/22443395/major-d

Re: [R] Polychoric Principal Component Analysis (pPCA)

2014-04-09 Thread William R Revelle
Peter, I am not sure if anyone answered your question about doing biplots using polychoric output and PCA. The biplot.psych example # 3 shows how to do this library(psych) > responses <- table2df(bock.table[,2:6],count=bock.table[,7], > labs= paste ("lsat6.",1:5,sep="”)) > W <-

Re: [R] Issues with fa() function in "psych"

2014-04-09 Thread sagnik chakravarty
Thanks a lot Bill and Revelle for your helpful response. It would have been great if I could know when we can expect the release of the edited version 1.4.4. Sagnik On Wed, Apr 9, 2014 at 8:05 PM, William Revelle wrote: > Sagnik raises the question as to why the psych package does not offer th

Re: [R] simulation data

2014-04-09 Thread Rolf Turner
On 10/04/14 09:28, thanoon younis wrote: hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. Nobody's stopping you! :-) cheers, Rolf Turner __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] ggplot / ggmap: fixing geom_point size to break bins

2014-04-09 Thread Trevor Davies
Hello, I'm been playing around trying to get some maps working in ggplot & ggmap. I have a series of maps I'm trying to make and I want to fix the bubble area size of banana catches to the specified breaks. I.e so banana catches of 2 will always be a specified size so when I make the next map, b

Re: [R] Fractional multinomial logit model or similar in R for analysis of behavior?

2014-04-09 Thread David Winsemius
On Apr 9, 2014, at 10:25 AM, Brian Battaile wrote: > I'm looking for a method to analyse behavior data that can be assigned to > multiple categories > as a proportion with all the categories adding to 1 and some explanatory > variables and repeated measures on some individuals. Maybe expanding y

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread David Winsemius
On Apr 9, 2014, at 6:17 PM, Hurr wrote: > What we've covered so far is of great value. > For a neater plot, > the next step will be to learn how to put > numbers with units at each tick mark. > I suppose I can form the number-unit string myself in > separate code and put the tickmark in a place t

Re: [R] Generate Crosstab in R

2014-04-09 Thread arun
Hi, Suppose your data is similar to below: dat <- structure(list(Custom = c("Judi", "Judi", "Ben", "Tom", "Tom", "Bill", "Lindy", "Shary", "Judu", "Judu", "Billy", "Tommy", "Tommy", "Benjum", "Linda", "Shiry", "Shiry", "Shiry", "Judu", "Billy", "Tommy", "Lindy"), Gender = c("Female", "Female", "

[R] simulation data

2014-04-09 Thread thanoon younis
hi i want to simulate multivariate dichotomous data matrix with categories (0,1) and n=1000 and p=10. thanks alot in advance [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Hurr
What we've covered so far is of great value. For a neater plot, the next step will be to learn how to put numbers with units at each tick mark. I suppose I can form the number-unit string myself in separate code and put the tickmark in a place that I calculate in separate code. But I need to learn

Re: [R] Memory allocation using .C interface

2014-04-09 Thread Dirk Eddelbuettel
Cassiano dos Santos gmail.com> writes: > I am testing a call to a C function from R, using .C interface. The test > consists in passing a numeric vector to the C function with no entries, > dynamically allocates n positions, makes attributions and return the > vector to R. Asking on StackOverflo

Re: [R] Memory allocation using .C interface

2014-04-09 Thread Peter Langfelder
On Wed, Apr 9, 2014 at 11:27 AM, Cassiano dos Santos wrote: > I am testing a call to a C function from R, using .C interface. The test > consists in passing a numeric vector to the C function with no entries, > dynamically allocates n positions, makes attributions and return the vector > to R. Wh

Re: [R] How to implement a recurring "check for updates" for R and packages?

2014-04-09 Thread Tal Galili
Thank you very much for the reply Henrik, you gave great pointers for me to look at. I am now curious about R.cache (although I am not sure it will help in my case, I'll need to look at it further). Also, I was debating if to use R-help or R-devel for this, since I was not sure from the descripti

Re: [R] Generate Binary Matrix

2014-04-09 Thread David Carlson
You could randomly assign 1 to a single column in each row and then use binomial draws on the remaining 0's: > set.seed(42) > dimMat <- matrix(0, 1000, 4) > dimMat[cbind(1:1000, sample.int(4, 1000, replace=TRUE))] <- 1 > dimMat[dimMat<1] <- sample(0:1, 3000, replace=TRUE, prob=c(.6, .4)) > table(r

Re: [R] Generate Binary Matrix

2014-04-09 Thread Clint Bowman
A bit kludgey but how about: dimMat <- matrix(0, 1000, 4) for(i in 1:1000){ while(sum(dimMat[i, ] <- sample(c(0,1), 4, replace = TRUE, prob = c(.3, .7)))==0) dimMat[i, ] <- sample(c(0,1), 4, replace = TRUE, prob = c(.3, .7)) } table(rowSums(dimMat)) Clint BowmanINTERNET:

Re: [R] getting arg names in function calls?

2014-04-09 Thread Spencer Graves
Thanks very much to both Bill Dunlap and Hadley Wickham. Per Bill's second suggestion, "match.call(eval(bo[[1]]), bo)" returned the desired "plot(x = 0, y = 1)" [with bo <- body(function()plot(0, 1)]. Hadley's "standardise_call(bo)" [from library(pryr)] is much simpler.

Re: [R] Generate Binary Matrix

2014-04-09 Thread ken knoblauch
Doran, Harold air.org> writes: > I am trying to generate a binary matrix where row in the matrix is guaranteed to have at least one 1. > Ideally, I would like most rowSums to be equal 2 or 3 with some 1s and some 4s. But, rowSums cannot be equal > to 0. > > I can tinker with the vector o

[R] Generate Binary Matrix

2014-04-09 Thread Doran, Harold
I am trying to generate a binary matrix where every row in the matrix is guaranteed to have at least one 1. Ideally, I would like most rowSums to be equal to 2 or 3 with some 1s and some 4s. But, rowSums cannot be equal to 0. I can tinker with the vector of probability weights, but in doing so

Re: [R] Summing up realizations

2014-04-09 Thread Jeff Newmiller
You might be thinking of bootstrap analysis. Note that measures are often correlated, so beware of just introducing randomness one measure at a time. Discussions about background theory are not really R-specific, so further chatter about this would not be on topic here, but the term "bootstrap"

[R] illumina probeID to entrezID

2014-04-09 Thread Kripa R
Hi, how do you convert the illumina ProbeID to entrezID? I've used LIMMA to identify top genes but i'm not sure how to apply illuminaHumanv4.db to get the EntrezID. Thanks in advance, .kripa [[alternative HTML version deleted]] _

[R] Memory allocation using .C interface

2014-04-09 Thread Cassiano dos Santos
I am testing a call to a C function from R, using .C interface. The test consists in passing a numeric vector to the C function with no entries, dynamically allocates n positions, makes attributions and return the vector to R. I'm using Calloc from R.h. The prototype of the function is type* Call

[R] Fractional multinomial logit model or similar in R for analysis of behavior?

2014-04-09 Thread Brian Battaile
I'm looking for a method to analyse behavior data that can be assigned to multiple categories as a proportion with all the categories adding to 1 and some explanatory variables and repeated measures on some individuals. Data would look something like this AnimalID Behavior1 Behavior2 Behavior3 Co

Re: [R] Generate Crosstab in R

2014-04-09 Thread arun
Hi, Try: datNew <- read.csv("customer_samples.csv",stringsAsFactors=FALSE) #I could reproduce similar error message with: dat[] <- lapply(dat,as.factor)  dat1 <- within(dat, Categ <- ave(Product, Custom, FUN= function(x) if(length(x)>1) "A and B" else x)) #Warning messages: 1: In `[<-.facto

Re: [R] Summing up realizations

2014-04-09 Thread Bert Gunter
Have you read "An Introduction to R" (or a web tutorial) to learn R? This looks straightforward, if I understand you correctly. ?sample and indexing operations might be all you need. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Informatio

[R] logistical indexing in R

2014-04-09 Thread Si Qi L.
Dear mates, I am bit of stuck with a coding, all I have to do is to clean and tranform the missing data "-97" of the attribute "ej" into a normal number value in a range from 0 to 22. My steps are : 1) first return the subsets, as check, they do sum to original 2) manipulate the attribute "ej

[R] Summing up realizations

2014-04-09 Thread Morway, Eric
Due in large part to my nonexistent statistics vocabulary, I'm not sure what the name is for the type of analysis I'm trying to do. I have, however, started to cobble something together (below) that is undoubtedly reinventing the wheel (i.e., someone has probably already written something to do th

Re: [R] Meta-analysis of prevalence at the country level with mgcv/gamm4

2014-04-09 Thread Michael Dewey
At 09:31 08/04/2014, Julien Riou wrote: Dear R community, Comments in line below I'm working on a meta-analysis of prevalence data. The aim is to get estimates of prevalence at the country level. The main issue is that the disease is highly correlated with age, and the sample ages of included

Re: [R] flowDensity package

2014-04-09 Thread Martin Morgan
On 04/09/2014 07:23 AM, Raghu wrote: I am unable to install flowDensity package from bioconductor in R version 3.0 or 3.1. did anyone have the same problems with this. Please ask questions about Bioconductor packages on the Bioconductor mailing list http://bioconductor.org/help/mailing-list

Re: [R] How to implement a recurring "check for updates" for R and packages?

2014-04-09 Thread Henrik Bengtsson
[Sounds like a question for R-devel] On Wed, Apr 9, 2014 at 5:02 AM, Tal Galili wrote: > Hello all, > > > I wish to add to the > installrpackage the > ability to check for new versions of R once every X units of > time (maybe once every two weeks)

[R] glmulti wrapper for lmer does not produce results

2014-04-09 Thread anto.r
I posted this on SO, got no response. Sorry about cross-posting, but atleast I would like to know if I am understading something totally wrong I am using a `glmulti` wrapper for glmer (binomial) and the `summary` is: `This is glmulti 1.0.7, Apr. 2013. Length Class Mode 0 NULL NULL`

[R] flowDensity package

2014-04-09 Thread Raghu
I am unable to install flowDensity package from bioconductor in R version 3.0 or 3.1. did anyone have the same problems with this. Thanks, Raghu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posti

Re: [R] Ignore escape characters in a string...

2014-04-09 Thread Jonathan Greenberg
Thanks all, I'll try some of these suggestions out but it seems like a raw string ability could come in helpful -- there aren't any packages out there that have this capability? --j On Tue, Apr 8, 2014 at 1:23 PM, Jeff Newmiller wrote: > What is wrong with > > winpath <- readLines("clipboard ")

[R] Error object .Source not found when using package tm.plugin.webmining

2014-04-09 Thread brian arb
I don't understand this error or how to resolve it. Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : object '.Source' not found Using R version 3.1.0 beta (2014-03-28 r65330) -- "Spring Dance" # output from console ## > library(quantmod) Loading required package: Defau

Re: [R] Generate Crosstab in R

2014-04-09 Thread arun
Hi, Try: dat <- structure(list(Custom = c("Judi", "Judi", "Ben", "Tom", "Tom", "Bill", "Lindy", "Shary", "Judu", "Judu", "Billy", "Tommy", "Tommy", "Benjum", "Linda", "Shiry"), Gender = c("Female", "Female", "Male", "Male", "Male", "Male", "Female", "Female", "Female", "Female", "Male", "Male"

Re: [R] Issues with fa() function in "psych"

2014-04-09 Thread William Revelle
Sagnik raises the question as to why the psych package does not offer the ‘equamax’ rotation. It is because all rotations are handled through the GPArotation package which does not offer equamax. Sagnik also points out that if the requested rotation is not available, fa defaults to rotate=“none

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread Bert Gunter
I would suggest that unlist(lapply(... should always be preferable to sapply(lapply... if you want to convert data in a data frame to a vector. I can't see any reason to run the same loop twice. But check timings -- maybe I'm overly sensitive to unimportant aesthetics. Cheers, Bert Bert Gunter Ge

[R] How to implement a recurring "check for updates" for R and packages?

2014-04-09 Thread Tal Galili
Hello all, I wish to add to the installrpackage the ability to check for new versions of R once every X units of time (maybe once every two weeks). I would like to keep a time stamp somewhere, that would stay persistent across R sessions (i.e.: t

[R] Fw: Re: Splitting columns and forming new data files in R

2014-04-09 Thread arun
On Wednesday, April 9, 2014 1:26 AM, arun wrote: Hi Atem, If you change colnames(mat1)[-(2:3)] <- ' ' in 'lst1New' lst1New <- lapply(lst1,function(x) {lst2 <- setNames(lapply(x,function(y) {dat <- read.table(y,sep=" ",header=TRUE, stringsAsFactors=FALSE); dat[,1:104]} ), names1); dat2 <-

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Jim Lemon
On 04/09/2014 06:17 PM, Hurr wrote: Thanks Jim, Labels for the following are at 0,2,4,6,8,10,12, not data, good. and omitted where lack of room. h=c(1.2,2.4,3.1,4.7,5.3,6.2,7.6,8.8,9.7) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n',xlim=c(-1,13)) x<-c(1.6,2.6,6.6,9.6,12.9) axis_labels<-1/pretty(x) ax

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Hurr
Thanks Jim, Labels for the following are at 0,2,4,6,8,10,12, not data, good. and omitted where lack of room. h=c(1.2,2.4,3.1,4.7,5.3,6.2,7.6,8.8,9.7) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n',xlim=c(-1,13)) x<-c(1.6,2.6,6.6,9.6,12.9) axis_labels<-1/pretty(x) axis(1,at=pretty(x),labels=axis_labels)

Re: [R] Label axis tick marks with a simple function of axis value

2014-04-09 Thread Jim Lemon
On 04/09/2014 01:12 PM, Hurr wrote: This still puts tick marks at data points: h=c(1,2,3,4,5,6,7,8,9) v=c(9,8,7,6,5,4,3,2,1) plot(h,v,xaxt='n') x<-c(1.6,2.6,6.6,9.6,12.9) axis_labels<-1/pretty(x) axis(1,at=pretty(x),labels=axis_labels) How do I get the axis to approx 13 ? plot(x,xaxt="n",xlim

Re: [R] Not able to convert data.frame to numeric properly

2014-04-09 Thread arun
Hi, Try: min(sapply(lapply(a,as.character),as.numeric))  #[1] 2.2194 A.K. On Wednesday, April 9, 2014 2:27 AM, Sachinthaka Abeywardana wrote: a is ofcourse a subset of data.frame, a ROW of the original table specifically. > str(a) 'data.frame': 1 obs. of  4 variables: $ GHP: Factor w/ 51 le

Re: [R] Replacement Value

2014-04-09 Thread arun
Hi Dila, If 'dat' is the dataset: dat$C[dat$B==0] <- 0  A.K. On Wednesday, April 9, 2014 1:30 AM, dila radi wrote: Dear arun Yes indeed..if the value in B is O..next value in the same row also 0.. other value than 0 remains unchanged. On Apr 9, 2014 12:48 PM, "arun" wrote: Dear Dila, > >What