Re: [R] Ayuda con un árbol de regresión

2015-03-30 Thread Jose Iparraguirre
Miguel, Sin tus datos es imposible brindarte una respuesta precisa pero ten en cuenta que la descripción del argumento 'fórmula' en la función tree del paquete del mismo nombre dice que la variable dependiente -PRECIO en tu caso- debe ser un vector numérico si quieres estimar un árbol de regre

Re: [R] Dummy variable in ARIMA

2015-03-02 Thread Jose Iparraguirre
Have a look at the caschrono package. There's an excellent associated book by the author of the package -Yves Aragon- but it's in French; if you don't read French, the package documentation is very clear. José -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Beh

Re: [R] colours in ggplot2

2015-02-23 Thread Jose Iparraguirre
Dear Antonello, How about this? Obviously, you can change the background colours for the confidence levels (deprespal) and for the regression lines, etc. Surely, many in the list can improve on my rough and ready solution. deprespal=c("#CC","#99") p2 <- ggplot(data = df, aes(x =Levels_De

Re: [R] Calculate the median age interval

2015-01-12 Thread Jose Iparraguirre
Dear Erik, There may be more elegant solutions, but try this: a. Create a data frame with your data, for example data <- data.frame(agegrp, y1994, y1995, y1996) b. Then use the which function: as.character(aa$agegrp[which(aa$y1994==23)]) Hope it helps, José Prof. José Iparraguirre Chief Ec

Re: [R] a question about arimax, please

2014-10-07 Thread Jose Iparraguirre
Also, the package caschrono is very good for Arima-X. If you read French, the author, Yves Aragon, wrote an excellent book describing its use: "Series temporelles avec R" (Springer). Prof. José Iparraguirre Chief Economist Age UK Age UK Tavis House, 1- 6 Tavistock Square London, WC1H 9NB T 0

Re: [R] Fitting Arima Model to Daily Time Series

2013-09-11 Thread Jose Iparraguirre
g, of course), R can do it for you as well. Best, José From: Paul Bernal [mailto:paulberna...@gmail.com] Sent: 11 September 2013 15:41 To: Jose Iparraguirre Cc: r-help@r-project.org Subject: Re: [R] Fitting Arima Model to Daily Time Series Dear Jose, good morning, First of all, let me thank yo

Re: [R] Chi-square values in GLM model comparison

2013-09-11 Thread Jose Iparraguirre
Hi Eiko, How about this? > anova (m1, m2, test="Chisq") See: ?anova.glm Regards, José Prof. José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Torvon Sent: 11 September 2013 16:48 To: r-

Re: [R] Fitting Arima Model to Daily Time Series

2013-09-11 Thread Jose Iparraguirre
Hi Paul, There are different packages in R to fit an ARIMA model. I would use the forecast package. In your case, perhaps you would want to explore SARIMA models to include seasonal components? Anyhow, the first port of call could be the auto.arima() function to select the best fitting represe

Re: [R] ESEM in R

2013-09-04 Thread Jose Iparraguirre
Hi Krzysztof, Have a look at the packages sem, lavaan and psych. Regards, José Prof. José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of fronc...@vizja.pl Sent: 03 September 2013 13:33 To: r-h

Re: [R] Outliers Help

2013-08-30 Thread Jose Iparraguirre
Hi Ma Teresa, Sorry, but I can't understand what you're trying to achieve. On a statistical note, I'd tend to think more in terms of medians and would think hard before replacing any outliers, but that's another matter. Here I created the dataframe dd with the means column of D in its first colu

Re: [R] Help R

2013-08-29 Thread Jose Iparraguirre
As said by arun, the code is not clear. Ma Teresa, what is it that you actually want to do? Regards, José -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of arun Sent: 29 August 2013 15:12 To: R help Subject: Re: [R] Help R HI, You

Re: [R] SEM polychoric

2013-08-12 Thread Jose Iparraguirre
Hi Pablo, Prof John Fox is a frequent contributor to this forum, and no-one is better placed than him to respond on your particular point, but I would use the sem and the polycor packages. There's an example in the documentation of sem which uses polychoric correlations. Incidentally you haven'

[R] Lack of catalog number referencing for statistical objects

2013-08-08 Thread Jose Iparraguirre
Hi, In "Skew-t fits to mortality data - can a Gaussian-related distribution replace the Gompertz-Makeham as the basis for mortality studies?" (J Gerontol A Biol Sci Med Sci 2013 August ;68(8):903-913; doi:10.1093/Gerona/gls239) Clark et al compares the fit of several distributions to mortality

Re: [R] R plot

2013-08-06 Thread Jose Iparraguirre
Hola Maria Teresa! I'd need some data to fully understand your problem, but as far as I can tell you are overdoing things. Again, without the data I can't help you but I'd use the ggplot2 package and forget about splitting the data into vectors and thus creating additional objects which look re

Re: [R] Help R

2013-07-29 Thread Jose Iparraguirre
Hola Maria Teresa, For multiple imputation, I would suggest the Amelia package by Gary King, James Honaker, and Matthew Blackwell, which uses the expectation-maximisation (EM) algorithm with bootstrap. Its excellent vignette has examples which should be more than enough for your needs. Do read

Re: [R] Computing "standard error of the mean" using REML

2013-07-25 Thread Jose Iparraguirre
Dear Ebrahim, We do not deal with study or work assignments in this group. I'd suggest, nonetheless, to look into the lme4 package and the mer-class objects created with this package. Regards, José Prof. José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...

Re: [R] Adjusting published survival functions

2013-07-24 Thread Jose Iparraguirre
Have you tried the packages 'survival' and 'eha' yet? You can use the survreg() function in the former to compare between different models. Have a look at this tutorial: http://www.openintro.org/stat/surv.php (a copy can also be found here: http://anson.ucdavis.edu/~hiwang/teaching/10fall/R_tut

Re: [R] about mix type clust algorithm

2013-07-22 Thread Jose Iparraguirre
Dear Cheng, This question exceeds the topics of this group. However, you may benefit from this recent (and excellent) paper along with the discussions: Henning, C. and T. Liao (2013). "How to find an appropriate clustering for mixed-type variables with application to socio-economy stratificatio

Re: [R] Needing help for excluding vector elements

2013-07-12 Thread Jose Iparraguirre
Dear Olivier, Perhaps you're looking for this? > yourvector[-(1:1000)] Kind regards, José Prof. José Iparraguirre Chief Economist Age UK Age UK Tavis House, 1- 6 Tavistock Square London, WC1H 9NB T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk -Origin

Re: [R] kruskal.test followed by kruskalmc

2013-07-05 Thread Jose Iparraguirre
Humber, Have a look at this: http://r.789695.n4.nabble.com/Multiple-Comparisons-Kruskal-Wallis-Test-kruskal-agricolae-and-kruskalmc-pgirmess-don-t-yield-the-sa-td4639004.html Hope it helps. Kind regards, José Prof. José Iparraguirre Chief Economist Age UK -Original Message- From: r-he

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Jose Iparraguirre
Hi Mikhail, After a cursory online search using simply " A new method for non-parametric multivariate analysis" + CRAN + R, I got the following three packages which include this paper in their references: vegan, mefa, and TraMineR. I don't know whether they deal with the procedure you are after

Re: [R] multivariate multilevel model

2013-06-06 Thread Jose Iparraguirre
Dear Patty, I would leave others to point you to the right packages, but I'd suggest you read this excellent R-based book: "Data Analysis Using Regression and Multilevel/Hierarchical Models", by Andrew Gelman and Jennifer Hill (Cambridge University Press, 2006). Kind regards, José Prof. José

[R] Problems in running x12

2013-05-29 Thread Jose Iparraguirre
Dear all, I have been experiencing difficulties in running the x12 package. I'm encountering the following error message which may or may not be R-related: "CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory." I don't

Re: [R] pearson correlation significant level

2013-05-17 Thread Jose Iparraguirre
Dear Elaine, One of the elements you obtain the P matrix, which is the matrix of asymptotic p-values. In your case, you get that the asymptotic p-value of the association between t_i and t_r is 0. That is, there would exist a perfect association (look also at the first result, the matrix of co

Re: [R] warnings in ARMA with other regressor variables

2013-05-02 Thread Jose Iparraguirre
Preetam, Have a look at this post: http://stats.stackexchange.com/questions/26999/auto-arima-warns-nans-produced-on-std-error José -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Preetam Pal Sent: 02 May 2013 12:24 To: r-help@r-pr

Re: [R] ARMA with other regressor variables

2013-05-02 Thread Jose Iparraguirre
Dear Preetam, I suggest that you read the TSA package documentation (and, if possible, the book by Cryer and Chan (Time Series Analysis with Applications in R) -it contains the function arimax which fits ARIMA models with exogenous variables. One thing: once you run your model, you will get the

Re: [R] double exponential regression R

2013-04-21 Thread Jose Iparraguirre
Dear Catalin, I think the package dcemriS4 has this capability. Hope it helps, Jose From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of catalin roibu [catalinro...@gmail.com] Sent: 21 April 2013 20:34 To: r-help@r-project.org Sub

Re: [R] Anova unbalanced

2013-04-17 Thread Jose Iparraguirre
Dear Claudia, Your question has been posed on many previous occasions. The (short) answer has always been the same: have a look at the Anova function in the car package but before doing that, get a copy of John Fox's "Applied Regression Analysis and Generalized Linear Models" book. Best, José

Re: [R] Logistic regression

2013-04-14 Thread Jose Iparraguirre
Endy, See the package ResourceSelection for the HL test and the package caret for the sensitivity and specificity measures. Regards, Jose Iparraguirre Chief Economist Age UK, London From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On

Re: [R] Calculating std errors of marginal effects in interactions

2013-04-11 Thread Jose Iparraguirre
Hi Richard, Have a look at this blog: http://www.r-bloggers.com/recovering-marginal-effects-and-standard-errors-from-interaction-terms-in-r/ Hope it helps! José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk Tavis Ho

Re: [R] Boxplot Labels OK

2013-04-10 Thread Jose Iparraguirre
Beatriz, In this case, use the car package and run the following: > bp <- Boxplot(DATA$ave, data= DATA, main= "Average Size", labels=DATA$num, > Id.method=c("y")) This will print out the labels 211 & 225 beside the outlier points. As you can see, the instruction assigns the values in the num c

Re: [R] Boxplot Labels

2013-04-09 Thread Jose Iparraguirre
Estimada Beatriz, If you use the Box.plot function in the car package (notice that here it's Box.plot, not box.plot), and add the argument id.method=c("identify"), it should work. You only need one instruction: R> library(car) R> bp <- Boxplot(DATA$ave, data= DATA, main= "Average Size",id.meth

Re: [R] error while extracting the p-value from adf.test

2013-03-22 Thread Jose Iparraguirre
Yes, it should be $p.value Have a look at the components here: > names(ht) José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk Tavis House, 1- 6 Tavistock Square London, WC1H 9NB www.ageuk.org.uk | ageukblog.org.uk

Re: [R] How to get the t-stat for arima()?

2013-03-20 Thread Jose Iparraguirre
Rebecca, Not to contradict Prof. Ripley re the merits and de-merits of the z ratios in an ARMA setting -far from it-, I'd like to point out that in the package "cashcrono" you can find the function t_stat() to compute the t-statistics tests for the coefficients of Arima models. José José Ipar

[R] Error message in vars package

2013-03-14 Thread Jose Iparraguirre
Hi I'm getting an error message with the roots() function in the vars package. Even the example in the help file comes up with an error: > data(Canada) > var.2c <- VAR(Canada, p = 2, type = "const") > roots(var.2c) Error in UseMethod("roots") : no applicable method for 'roots' applied to an ob

Re: [R] Arimax with intervention dummy and multiple covariates

2013-02-21 Thread Jose Iparraguirre
nk ) using an ARIMAX. why >>>> don't you take his paper and his data and see if you get the same >>>> estimates using R. >>>> That's one way if you'll know if you're doing the steps correctly. >>>> I don't have cryer and cha

Re: [R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread Jose Iparraguirre
Hi Zhengyu Surely not the most elegant piece of coding, but this should do the trick: > m=rep(NA,nrow(seq)*ncol(seq)) > mat1=matrix(m,3) > for(i in 1:nrow(seq)){ + for(j in 1:ncol(seq)){ + ifelse((seq[i,j]==1 | seq[i,j]==-1), + mat1[i,j]<-mat[i,j],mat1[i,j]<-NA) + } + } > mat1 e.g. Wi

[R] Arimax with intervention dummy and multiple covariates

2013-02-21 Thread Jose Iparraguirre
Hi I'm trying to measure the effect of a policy intervention (Box and Tiao, 1975). This query has to do with the coding of the model rather than with the particulars of my dataset, so I'm not providing the actual dataset (or a simulated one) in this case, apart from some general description. Th

Re: [R] How to plot doubles series with different location using plotCI

2013-02-11 Thread Jose Iparraguirre
Hi Rosalinde, If you set the argument err equal to "x", you'll get horizontal error bars. Hope this helps, José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk Tavis House, 1- 6 Tavistock Square London, WC1H 9NB www.ag

Re: [R] coplot question

2013-02-07 Thread Jose Iparraguirre
Hi, Derek, Try and modify the value for the overlap argument. Hope this helps, José -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of derek@nemac Sent: 07 February 2013 03:49 To: r-help@r-project.org Subject: [R] coplot question

Re: [R] Calculating Cumulative Incidence Function

2013-02-05 Thread Jose Iparraguirre
Hi Tasnuva, You can read Scrucca, L.; Santucci, A. and Aversa, F. (2007) "Competing risk analysis using R: an easy guide for clinicians", Bone Marrow Transplantation, 40, 381-387, and also Brock, G.; Barnes, C.; Ramirez, J. and Myers, J. (2011) "R code for calculating the competing risks estima

Re: [R] If() values in one dataframe then return values from another

2013-02-04 Thread Jose Iparraguirre
Hi Steven, You are not indexing mA properly within the loop. In order not to change the elements of the object, I'll create a new vector, mA2 -not strictly necessary, though. Let's start with an empty vector: > mA2 <- rep(0,40) Now, the loop with the correct indexing: > for(i in 1:40){ + if(

Re: [R] lower corner cumulative probability

2013-01-31 Thread Jose Iparraguirre
Have you looked in the package 'copula'? Regards, José José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eliza botto Sent: 31 January 2013 11:13 To: r-help@r-project.org Subject: [R] lower c

Re: [R] facet plot

2013-01-31 Thread Jose Iparraguirre
Hi Robin, You didn't provide the list with a clear structure of your data, but I hope I understood it properly. If not, it'd be easy for you to adapt what follows. I guess your data looks like this: Gene T0h T0.25h T0.5h T1h T2h T3h T6h T12h T24h T48h 1 NM_001001130 68 95

Re: [R] to check if a character string is in a group of character strings

2013-01-23 Thread Jose Iparraguirre
Not sure what you want this for, but work along the following: > pool = c("s1","s2") > subpool = c("s1") > ifelse(pool==subpool,1,0) [1] 1 0 Notice: > pool2 = c("s2","s1") > ifelse(pool2==subpool,1,0) [1] 0 1 Etc. Hope this helps. José José Iparraguirre Chief Economist Age UK -Origin

Re: [R] Average calculations

2013-01-23 Thread Jose Iparraguirre
Hi Nico, You can use tapply: > tapply( x[["Values" ]], x[[ "Names" ]], mean ) CK113234 CK113298 CK114042 CK116292 CK116296 216.5061 190.1725 222.8710 220.4324 204.5741 Alternatively, > tapply( x$Values, x$Names, mean ) CK113234 CK113298 CK114042 CK116292 CK116296 216.5061 190.1725 222.8710 2

Re: [R] columns called X rename Y

2013-01-18 Thread Jose Iparraguirre
Simply > colnames(seba)[1] <- "c" > colnames(seba)[2] <- "b" Regards, Jose From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Sebastian Kruk [residuo.so...@gmail.com] Sent: 18 January 2013 18:14 To: R-help Subject: [R] column

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Jose Iparraguirre
Dear Andrea I may have not understood the question properly, but I guess it has to do with replacing values before and after casting. The molten object ('melting') is a data frame, whilst the cast object ('y') is an array. Crucially, the values of the variable "Rep" in the 'melting' data f

Re: [R] Code to fetch summary info from vector

2013-01-15 Thread Jose Iparraguirre
Hi Ben I'm not sure whether I understood correctly, but is it something like this? > sum(ifelse(b==2,1,0)) [1] 4 > sum(ifelse(b==3,1,0)) [1] 4 > sum(ifelse(b>=2,1,0)) [1] 13 > sum(ifelse(b>2,1,0)) [1] 9 Etc... José José Iparraguirre Chief Economist Age UK -Original Message- From: r-h

Re: [R] Drawing a dotted circle.

2013-01-12 Thread Jose Iparraguirre
Don't know, but you can use the function draw.circle in the plotrix package. Hope this helps, Jose From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Ved P. Sharma [vedsha...@gmail.com] Sent: 12 January 2013 07:43 To: r-help@r-pr

Re: [R] Basic loop programming

2013-01-09 Thread Jose Iparraguirre
Hi Paolo, You say you have monthly observations of two variables, say Sales and Customers. Then, what you should have is something like this: Year Month Sales Customer 2012Jan ss_12.1 cc_12.1 2012Feb ss_12.2 cc_12.2 ... ... ... ... 2013Jan ss_13.1

Re: [R] Need an advise for bayesian estimate

2013-01-09 Thread Jose Iparraguirre
Hi Kyong, Even if it is not -as can be inferred from what you said- a homework or assignment related query (and the group has clear policy against such requests), the questions you posed have nontheless very little to do specifically with R. Instead, they are about statistics. In this respect,

Re: [R] Set a zero at minimum row by group

2012-12-18 Thread Jose Iparraguirre
There may be more efficient ways, but here's one: > x_new <- rep(0,nrow(df)) > x_new <- ifelse(df$T==min(T),0,1) Regards, José -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Carlos Nasher Sent: 18 December 2012 14:10 To: r-help@

Re: [R] ggplot geom_smooth colour

2012-12-17 Thread Jose Iparraguirre
Try something along these lines: > library(ggplot2) > cbPalette <- c("#99", "#E69F00") > df<-data.frame(y=rnorm(100,30,10),x=rnorm(100,20,5),treat=factor(rbinom(100,1,0.5))) > p1<-ggplot(df, aes(x=x, y=y,group=treat)) + theme_bw() + + geom_smooth(aes(linetype=treat, colour="black"),method

Re: [R] ggplot geom_smooth colour

2012-12-17 Thread Jose Iparraguirre
"... A search online has not suggested any solution / work around." Really? Have a look at this: http://docs.ggplot2.org/current/geom_smooth.html Regards, José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]

Re: [R] Pairwise deletion in a linear regression and in a GLM ?

2012-12-13 Thread Jose Iparraguirre
default in lm !!). I just when to be able to recalculate the statistics given in this thesis. Arnaud 2012/12/13 Jose Iparraguirre <mailto:jose.iparragui...@ageuk.org.uk>> Hi Arnaud, A quick help search of lm or glm tells you that 'the "factory-fresh" default is na.omit

Re: [R] Pairwise deletion in a linear regression and in a GLM ?

2012-12-13 Thread Jose Iparraguirre
Hi Arnaud, A quick help search of lm or glm tells you that 'the "factory-fresh" default is na.omit'. If you then look up 'na.omit', you'll read that it 'returns the object with incomplete cases removed'. So, pairwise deletion is the default option in both lm and glm. On a related note, it goes

Re: [R] question about sum of (column) elements in R

2012-12-04 Thread Jose Iparraguirre
Hi, Imagine the data you have is in a data frame, c, with columns a and b. Then you can do this: > res=tapply(b,c[,-2],sum) > res[is.na(res)]<-0 > res 0 1 2 3 4 12 40 64 111 63 Hope it helps, José José Iparraguirre Chief Economist Age UK -Original Message- From: r-hel

Re: [R] Little's Chi Square test for MCAR?

2012-11-30 Thread Jose Iparraguirre
If you mean Little's Chi Sq test in particular, go to the BaylorEdPsych package. Regards, José José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Sileshi Melesse Sent: 30 November 2012 05:57 T

Re: [R] Anova

2012-11-27 Thread Jose Iparraguirre
Hi, You can use the car package and choose Type-III test. Also, have a look at the package easyanova. Regards, José José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of humming-bird Sent: 27 N

Re: [R] How to count the number of different elements in a column

2012-11-26 Thread Jose Iparraguirre
Hi, Imagine the column is named XX. Type: > nrow(table(banca_impresa$XX)) and you'll get how many different categories there are in that column. (If you type > table(banca_impresa$XX) you'll get the frequencies). José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparra

Re: [R] lattice density plot: add vertical lines at groupwise medians for all panels

2012-11-21 Thread Jose Iparraguirre
Dear AnjaM There may be better ways of dealing with this, but the following works: densityplot(~gcsescore | factor(score), groups=gender, data=Chem97, auto.key=TRUE, plot.points=FALSE, ref=TRUE, panel=function(x,...){ panel.densityplot(x,...)

Re: [R] Removing default loess line from scatterplot ({car})

2012-11-15 Thread Jose Iparraguirre
Always look at the help page. If you type, in this case, ?scatterplot, you'll see that all you need to add is the argument smooth=FALSE to omit the loess line. Jose From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of nprause [n

Re: [R] cluster analysis in R

2012-11-15 Thread Jose Iparraguirre
Have a look at the package mclust. Jose From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Ingmar Visser [i.vis...@uva.nl] Sent: 15 November 2012 21:10 To: KitKat Cc: r-help@r-project.org Subject: Re: [R] cluster analysis in R D

Re: [R] Can't format x axis on a stacked plot of a zoo object

2012-11-14 Thread Jose Iparraguirre
Hi, Have a look at this example in plot.zoo: ## Custom x axis labelling using a custom panel. # 1. test data z <- zoo(c(21, 34, 33, 41, 39, 38, 37, 28, 33, 40), as.Date(c("1992-01-10", "1992-01-17", "1992-01-24", "1992-01-31", "1992-02-07", "1992-02-14", "1992-02-21", "1992-02-28",

Re: [R] predict.zeroinfl not found

2012-11-09 Thread Jose Iparraguirre
Gavin, Try simply predict() José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk Tavis House, 1- 6 Tavistock Square London, WC1H 9NB www.ageuk.org.uk | ageukblog.org.uk | @ageukcampaigns For a copy of our new Economic

Re: [R] Simple Likert count data visualization

2012-11-09 Thread Jose Iparraguirre
Hi Werner I've recently used the net_stacked function here: http://statisfactions.com/2012/improved-net-stacked-distribution-graphs-via-ggplot2-trickery/ Have a look also at this: http://stats.stackexchange.com/questions/25109/visualizing-likert-responses-using-r-or-spss And this: http://stac

Re: [R] Produce "a prism like plot"

2012-11-08 Thread Jose Iparraguirre
See the 4th example in ?ehplot in the plotrix package: ehplot(iris$Petal.Length, iris$Species, offset=0.06, pch=as.numeric(iris$Species)) José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk Tavis House, 1- 6 Tavistock

Re: [R] A panel of contour plots through a iteration process

2012-11-08 Thread Jose Iparraguirre
Thierry's solution is such more elegant and succinct. Loukia, you'd better forget about the multiplot() function for this... José -Original Message- From: ONKELINX, Thierry [mailto:thierry.onkel...@inbo.be] Sent: 08 November 2012 16:12 To: Jose Iparraguirre; Loukia Spineli

Re: [R] A panel of contour plots through a iteration process

2012-11-08 Thread Jose Iparraguirre
Hi Loukia, I think the problem stems from the fact that the filled.contour "uses the layout function and so is restricted to a full page display" as its documentation reads. And if you look at the documentation of the layout function, it says that it is "totally incompatible with the other mech

Re: [R] Dabbling with R5 setRefClass - Inheritance problems

2012-11-08 Thread Jose Iparraguirre
Hi Johannes, Just a typo. You've written ... contains="rcfpdsuperclass") When, in fact, you've defined the object rcfdpsuperclass To highlight the mistake, I'll use capital letters: rcfPD... and rcfDP... Regards, José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.ipar

Re: [R] Welch Two Sample T-Test

2012-11-08 Thread Jose Iparraguirre
Let's define this object: > welch <- t.test(x,y,alt="less",var.equal=TRUE) Then, if you type > names(welch) You get its contents: [1] "statistic" "parameter" "p.value" "conf.int""estimate" [6] "null.value" "alternative" "method" "data.name" Now, to obtain the value of eac

Re: [R] New Learner

2012-11-07 Thread Jose Iparraguirre
Dear Debaranjan, What's your field of specialisation or study? Regards, José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk Tavis House, 1- 6 Tavistock Square London, WC1H 9NB www.ageuk.org.uk | ageukblog.org.uk | @ag

Re: [R] boxplots of various levels

2012-10-31 Thread Jose Iparraguirre
Have a look at this: http://stats.stackexchange.com/questions/15486/plotting-a-boxplot-against-multiple-factors-in-r-with-ggplot2 Hope it helps. José -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of dysonsphere Sent: 30 October 2

Re: [R] Amelia imputation - column grouping

2012-10-30 Thread Jose Iparraguirre
Hi Elisa, Simply create a data frame with the columns you want to use and then run the amelia() function on that data frame. Say, you've creasted the data frame MyDF with the 3 columns you want amelia to perform the imputation. Then type > a.out <- amelia(MyDFl, m =M) (where M is the number of

Re: [R] Estimating credit card default probabilities.

2012-10-26 Thread Jose Iparraguirre
Sounds like a Markov-chain problem. There are a number of packages that deal with this, including multi-state Markov models, hidden Markov models, and Bayesian Monte Carlo chains (msm, HHM and HiddenMarkov, MCMCpack, respectively). But you won't get much help from us as to which model to use, e

Re: [R] Represent point size according to frequency

2012-10-22 Thread Jose Iparraguirre
Shortly ago I did something similar to what you intend to. The data frame was called 'fore'. There were eight different variables and I wanted to plot each one by column, and depict the frequencies in terms of the size of the dots. The problem I ran into is that the plots got extremely big for

Re: [R] dynamic panel data estimation

2012-10-22 Thread Jose Iparraguirre
You can run dynamic panel data models with plm -see the package's vignette "Panel Data Econometrics in R: The plm Package" by Yves Croissant and Giovanni Millo (section 5.4) Check Giovanni Petris, Sonia Petrone, Patrizia Campagnoli's monograph "Dynamic Linear Models with R" as well. Hope this he

Re: [R] Time Series Analysis and Forecasting

2012-10-18 Thread Jose Iparraguirre
And there's a wealth of textbooks on time series based in R. Two to start with: Paul S.P. Cowpertwait and Andrew V. Metcalfe (2009). Introductory Time Series with R. Use R! Series. Springer. Robert H. Shumway and David S. Stoffer (2006). Time Series Analysis and Its Applications With R Examples

Re: [R] anova test for variables with different lengths

2012-10-16 Thread Jose Iparraguirre
Hi Sachin, You may find this tutorial useful: http://goanna.cs.rmit.edu.au/~fscholer/anova.php And you'll need the car package; but become yourself familiar with Type I, II and III sums of squares models before running the Anova; the tutorial explains these in detail. Hope it helps. José Jos

Re: [R] t-test

2012-10-04 Thread Jose Iparraguirre
Hi, You can also have a look at this paper (no subscription needed): Herberich, E.; Sikorski, J.; and Hothorn, T. (2010). "A Robust Procedure for Comparing Multiple Means under Heteroscedasticity in Unbalanced Designs". PLoSONE, Vol. 5, Issue 3, e9788. doi:10.1371/journal.pone.0009788 In this

Re: [R] Is there a function that runs AR model with Schwarz Bayesian Information Criteria (BIC)?

2012-09-29 Thread Jose Iparraguirre
he answer there. Best, Jose From: jpm miao [miao...@gmail.com] Sent: 27 September 2012 14:48 To: Jose Iparraguirre Cc: r-help; kri...@ymail.com Subject: Re: [R] Is there a function that runs AR model with Schwarz Bayesian Information Criteria (BIC)? Thanks. W

Re: [R] Is there a function that runs AR model with Schwarz Bayesian Information Criteria (BIC)?

2012-09-27 Thread Jose Iparraguirre
You'll find this in the forecast package, function auto.arima() Regards, José José Iparraguirre Chief Economist Age UK T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk Tavis House, 1- 6 Tavistock Square London, WC1H 9NB www.ageuk.org.uk | ageukblog.org.uk | @age

Re: [R] add reference lines (or grid) in background

2012-09-18 Thread Jose Iparraguirre
Dear Luigi, Here's an option: boxplot(x, boxcol="white", whiskcol="white",medcol="white",staplecol="white") abline(h=c(-1,0,1)) grid(NA, 4, lwd = 2) boxplot(x,add=T) Regards, José Iparraguirre -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]

[R] [Re] add reference lines (or grid) in background

2012-09-18 Thread Jose Iparraguirre
Dear Luigi, Here's an option: boxplot(x, boxcol="white", whiskcol="white",medcol="white",staplecol="white") abline(h=c(-1,0,1)) grid(NA, 4, lwd = 2) boxplot(x,add=T) Regards, José Iparraguirre -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] Position of y axis labels in plot graphic

2012-09-11 Thread Jose Iparraguirre
Hi Nico, Far from the most elegant solution, at least it works and will give you plenty of freedom to choose where to place the labels: > plot.zoo(x, type="l", main="", xlab="", ylab="",yaxt="n", xaxs="i"); > title(main="Title", xlab="index") > mtext(names(x)[1],2,line=1,at=0.9) > mtext(names(

Re: [R] Query on how to do maximum likelihood fitting of a functional (MLFR)

2012-09-07 Thread Jose Iparraguirre
Turgut, I'm afraid you'll have to write it by yourself. Dhanoa and Sanderson (Can J Zool, 66:821-823, 2010) mention the FREML Excel add-in written by Ripley and Thompson (available on the Royal Society of Chemistry's website at the moment of writing that paper) and that the simulation and extr

Re: [R] Fwd: Need help

2012-08-23 Thread Jose Iparraguirre
Dear Elvira, The RandForestGUI estimates the Berger-Parker dominance index. Regarding the Brillouin Index, I found that someone posted the same question here earlier this year: http://tolstoy.newcastle.edu.au/R/e17/help/12/01/1132.html The answers in the thread may help you. Regards, José J

Re: [R] Combining imputed datasets for analysis using Factor Analysis

2012-08-22 Thread Jose Iparraguirre
Dear Conrad, 1) Have you tried the missMDA package? It imputes missing values of a dataset to perform multiple factor analysis, principal components analysis, etc. 2) The EM algorithm can be used for FA even in the presence of missing values. Two references in this regard: a) Jamshidian, M.

Re: [R] colorful plot

2012-08-21 Thread Jose Iparraguirre
Hi Nooshin, Have you tried the RColorBrewer package? After loading the package, the following gives you the whole array of available colour palletes. > display.brewer.all(n=NULL, type="all", select=NULL, exact.n=TRUE) Then, you can add to your code something like this (I'm using palette "Set3"

Re: [R] How to delete only those rows in a dataframe in which all records are missing

2011-11-04 Thread Jose Iparraguirre
It does! Thanks, José -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: 04 November 2011 15:18 To: Jose Iparraguirre Cc: r-help@r-project.org Subject: Re: [R] How to delete only those rows in a dataframe in which all records are missing Perhaps

[R] How to delete only those rows in a dataframe in which all records are missing

2011-11-04 Thread Jose Iparraguirre
Hi, Imagine I have the following data frame: > a <- c(1,NA,3) > b <- c(2,NA,NA) > c <- data.frame(cbind(a,b)) > c a b 1 1 2 2 NA NA 3 3 NA I want to delete the second row. If I use na.omit, that would also affect the third row. I tried to use a loop and an ifelse clause with is.na to get

[R] Residuals with Elliot-Rothenberg-Stock Unit Root Test

2009-11-12 Thread Jose Iparraguirre D'Elia
Does anyone know how to retrieve the residuals after running an ERS unit root test on a time series (urca package)? There are no 'residuals' or 'res' (or similar) slots in the ur.ers-class, but a plot instruction - ie plot(ur.ers()) renders amongst other things a residual plot. If an augmen

[R] Quarterly data in PLM package

2009-10-30 Thread Jose Iparraguirre D'Elia
Dear all, Does anyone know if the PLM package (to run Panel Data Analysis) accepts quarterly data? The package vignette and documentation only use annual data -and the only time index available seems to work for years. José Mr José Luis Iparraguirre Senior Research Economist Ec

Re: [R] Retrieving original data frame after repetition

2009-07-31 Thread Jose Iparraguirre D'Elia
ose -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: 30 July 2009 20:13 To: Jose Iparraguirre D'Elia Cc: r-help@r-project.org Subject: Re: [R] Retrieving original data frame after repetition On Jul 30, 2009, at 11:15 AM, Jose Iparraguirre D'Elia wrot

[R] Retrieving original data frame after repetition

2009-07-30 Thread Jose Iparraguirre D'Elia
Dear R users, Consider the first two columns of a data frame like this: > z[,1:2] x y 1 1 1 2 2 2 3 3 3 4 1 4 Imagine that y represents the times that the value x happens in a population. But z is not exactly a frequency table, because in z we have x=1 twice. So, the x=1 in the

Re: [R] A query about na.omit

2009-04-02 Thread Jose Iparraguirre D'Elia
Mark, Ted, Gabor, Thanks for all your input. José -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 01 April 2009 18:12 To: Jose Iparraguirre D'Elia Cc: r-help@r-project.org Subject: Re: [R] A query about na.omit First input the data frame: &g

[R] A query about na.omit

2009-04-01 Thread Jose Iparraguirre D'Elia
Dear all, Say I have the following dataset: > DF x y z [1] 1 1 1 [2] 2 2 2 [3] 3 3NA [4] 4 NA 4 [5] NA 5 5 And I want to omit all the rows which have NA, but only in columns X and Y, so that I get: x y z 1 1 1 2 2 2 3 3 NA

[R] Do not want to print when using prop.test

2009-01-20 Thread Jose Iparraguirre D'Elia
I am using the function prop.test (base package), which returns a list with class "htest". All I want to do is to assign one of its values to a variable, but I do not want R to print the results and added warning message whenever I invoke the function. How can I prevent R from printing on using

Re: [R] Kolmogorow-Smirnow-Test to check if Data comes from Subbotin distribution

2008-12-17 Thread Jose Iparraguirre D'Elia
Dear Sara, You could also use the Subbotools package by Giulio Bottazzi and test the goodness of fit of your data to this distribution. See: http://www.lem.sssup.it/WPLem/files/2004-14.pdf Also, http://cafim.sssup.it/~giulio/software/subbotools/install_cygwin.html Regards, José Mr José Luis

  1   2   >