Re: [R] Is there a sexy way ...? Fortune nomination

2024-09-28 Thread Achim Zeileis via R-help
On Sat, 28 Sep 2024, J C Nash wrote: On 2024-09-28 13:57, avi.e.gr...@gmail.com wrote: Python users often ask if a solution is “pythonic”. But I am not aware of R users having any special name like “R-thritic” and that may be a good thing. Nice, added on R-Forge :-) Achim __

Re: [R] 2SLS with Fixed Effects and Control Variables

2024-01-28 Thread Achim Zeileis
f-contained and reproducible example. Best regards, Achim On Sun, 28 Jan 2024, Kelis Wong wrote: Dear John Fox, Christian Kleiber, and Achim Zeileis, I am attempting to run various independent variable parameters to assess their suitability. Unfortunately, I hit a snag and couldn't get the t

Re: [R] aggregate formula - differing results

2023-09-04 Thread Achim Zeileis
On Mon, 4 Sep 2023, Ivan Calandra wrote: Thanks Rui for your help; that would be one possibility indeed. But am I the only one who finds that behavior of aggregate() completely unexpected and confusing? Especially considering that dplyr::summarise() and doBy::summaryBy() deal with NAs differe

Re: [R] col2rgb() function

2023-07-23 Thread Achim Zeileis
Just one addition which may or may not be useful: The color palette you use is also known as "Okabe-Ito" and it is the default set of colors in the palette.colors() function. This function also has an optional alpha argument. So if you want to generate these colors with an alpha of 0.3 you can

Re: [R] grDevices::hcl.colors using two colours: Bug or Feature?

2023-04-28 Thread Achim Zeileis
On Fri, 28 Apr 2023, Duncan Murdoch wrote: On 28/04/2023 6:18 a.m., Achim Zeileis wrote: On Fri, 28 Apr 2023, Achim Zeileis wrote: This was introduced in 4.3.0 (hence Rui cannot reproduce it in 4.2.3). It's a bug and was introduced when fixing this other bug: https://bugs.R-projec

Re: [R] grDevices::hcl.colors using two colours: Bug or Feature?

2023-04-28 Thread Achim Zeileis
On Fri, 28 Apr 2023, Achim Zeileis wrote: This was introduced in 4.3.0 (hence Rui cannot reproduce it in 4.2.3). It's a bug and was introduced when fixing this other bug: https://bugs.R-project.org/show_bug.cgi?id=18476 https://hypatia.math.ethz.ch/pipermail/r-help/2023-February/476960

Re: [R] grDevices::hcl.colors using two colours: Bug or Feature?

2023-04-28 Thread Achim Zeileis
This was introduced in 4.3.0 (hence Rui cannot reproduce it in 4.2.3). It's a bug and was introduced when fixing this other bug: https://bugs.R-project.org/show_bug.cgi?id=18476 https://hypatia.math.ethz.ch/pipermail/r-help/2023-February/476960.html Apparently, it only affects the case with n =

Re: [R] Palettes {grDevices} - wrong number of colors returned?

2023-02-28 Thread Achim Zeileis
Just for the record: Duncan and Martin (Maechler) improved my proposed patch and Martin committed it to R-devel now. Thank you, Sigbert, for reporting the issue! On Thu, 23 Feb 2023, Achim Zeileis wrote: On Thu, 23 Feb 2023, Duncan Murdoch wrote: On 23/02/2023 6:09 a.m., Achim Zeileis

Re: [R] Palettes {grDevices} - wrong number of colors returned?

2023-02-23 Thread Achim Zeileis
On Thu, 23 Feb 2023, Duncan Murdoch wrote: On 23/02/2023 6:09 a.m., Achim Zeileis wrote: Duncan, thanks for your feedback. I just received your response after sending out mine. You came to the same conclusion. Should I prepare a patch and send it to you so that you can also have a look? Or

Re: [R] Palettes {grDevices} - wrong number of colors returned?

2023-02-23 Thread Achim Zeileis
Thanks, Sigbert, good catch. The reason that this happens is the following: rainbow(), heat.colors(), terrain.colors(), cm.colors(), and topo.colors() are all just front-ends to calls to hsv() for Hue-Saturation-Value colors. (BTW: This is also the main reason why they yield palettes with rath

Re: [R] Palettes {grDevices} - wrong number of colors returned?

2023-02-23 Thread Achim Zeileis
Duncan, thanks for your feedback. I just received your response after sending out mine. You came to the same conclusion. Should I prepare a patch and send it to you so that you can also have a look? Or view Bugzilla? Best wishes, Achim On Thu, 23 Feb 2023, Duncan Murdoch wrote: On 23/02/20

Re: [R] struccchange on zoo time series

2022-05-01 Thread Achim Zeileis
and zoo because the data is simply monthly. This can be done with as.ts() and as.zoo(), respectively. dd.ocus <- efp(dd ~ dd.lag1 + dd.lag12, data = as.ts(na.trim(dd.z)), type = "OLS-CUSUM") On Sun, May 1, 2022 at 5:56 PM Achim Zeileis wrote: On Sun, 1 May 2

Re: [R] A glitch (???) in tools::texi2pf.

2021-08-29 Thread Achim Zeileis
On Sat, 28 Aug 2021, Rolf Turner wrote: On Sat, 28 Aug 2021 12:49:04 +0300 Eric Berger wrote: As Achim wrote in point (2), Makefile is your friend. Well, all I can say is that Makefile is *not* my friend; I have never made its acquaintance and wouldn't know where to begin looking. Would i

Re: [R] A glitch (???) in tools::texi2pf.

2021-08-28 Thread Achim Zeileis
On Sat, 28 Aug 2021, Rolf Turner wrote: On Sat, 28 Aug 2021 09:47:03 +0200 Achim Zeileis wrote: On Sat, 28 Aug 2021, Rolf Turner wrote: I have found that tools::texi2pf() ignores changes to the *.bib file unless the *.bbl file is removed prior to re-running tools::texi2pdf(). This is

Re: [R] A glitch (???) in tools::texi2pf.

2021-08-28 Thread Achim Zeileis
On Sat, 28 Aug 2021, Rolf Turner wrote: I have found that tools::texi2pf() ignores changes to the *.bib file unless the *.bbl file is removed prior to re-running tools::texi2pdf(). This is how texi2pdf (or actually texi2dvi) from texinfo behaves. This is likely what tools::texi2pdf calles in

Re: [R] colourlovers error

2021-06-28 Thread Achim Zeileis
On Mon, 28 Jun 2021, Monica Palaseanu-Lovejoy wrote: Hi, Thanks for letting me know. I will go back to RColorBrewers and monitor from time to time that issue in GitHub as well to see if it gets solved. See also example(palette.colors) example(hcl.colors) in base R which provide a wide range

Re: [R] colourlovers error

2021-06-28 Thread Achim Zeileis
On Mon, 28 Jun 2021, Monica Palaseanu-Lovejoy wrote: Hi, In an older version of R i was using the package colourlovers to get nice color palettes. I just updated my R to the latest version and now i am getting the following error: Presumably, there was a change in the API of the colourlovers

Re: [R] newdata for predict.lm() ??

2020-11-04 Thread Achim Zeileis
On Wed, 4 Nov 2020, peter dalgaard wrote: Don't use $ notation in lm() formulas. Use lm(w ~ h, data=DAT). ...or in any other formula for that matter! Let me expand a bit on Peter's comment because this is really a pet peeve of mine: The idea is that the formula "w ~ h" described the relati

Re: [R] Package 'coin' - How to extract rho

2020-04-29 Thread Achim Zeileis
bootstrap test, unconditional asymptotic test, or permutation test. At least I wouldn't see any reason, not to do so. Best, Z -Ursprüngliche Nachricht- Von: Achim Zeileis Gesendet: Mittwoch, 29. April 2020 13:56 An: Blume Christine Cc: Jim Lemon ; torsten.hoth...@uzh.ch; r-help@r-project

Re: [R] Package 'coin' - How to extract rho

2020-04-29 Thread Achim Zeileis
Christine, thanks for the example. As far as I can see, the "coin" package does not explicitly compute Spearman's rho. This is probably also the reason why it isn't reported in the test output. Thus, you would have to do this "by hand" using cor(..., method = "spearman"). Hope that helps, Ac

Re: [R] Complete month name from as.yearmon()

2019-04-13 Thread Achim Zeileis
On Sat, 13 Apr 2019, Christofer Bogaso wrote: Hi, I am wondering if there is any way to get the full name from as.yearmon() function. Please consider below example: library(quantmod) as.yearmon(Sys.Date()) This gives: [1] "Apr 2019". How can I extract the full name ie. 'April 2019' Interna

Re: [R] strucchange Graph By Week and xts error

2019-03-06 Thread Achim Zeileis
= 0.05, code = 3) Above, the $confint is a vector. If it is a matrix (due to more than one breakpoint) the code needs to be tweaked to make cix also a matrix and then use cix[,i] rather than cix[i] for i = 1, 2, 3. From: Achim Zeileis Sent: Wednesday,

Re: [R] strucchange Graph By Week and xts error

2019-03-06 Thread Achim Zeileis
On Thu, 7 Mar 2019, Sparks, John wrote: Hi R Helpers, I am doing some work at identifying change points in time series data. A very nice example is given in the R Bloggers post https://www.r-bloggers.com/a-look-at-strucchange-and-segmented/ The data for the aswan dam in that example is year

Re: [R] getting 21 very different colours

2018-09-11 Thread Achim Zeileis
Have a look at the Polychrome package by Kevin Coombes and Guy Brock: https://CRAN.R-project.org/package=Polychrome This employs the LUV space (with HCL = polar LUV) to get many distinct distinguishable colors. For a few first steps, see: https://CRAN.R-project.org/web/packages/Polychrome/vigne

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-09 Thread Achim Zeileis
On Thu, 9 Aug 2018, John wrote: Hi, I try to run the same f-test by lm (with summary) and the function "linearHypothesis" in car package. Why are the results (p-values for the f-test) different? The standard F test in the summary output tests the hypothesis that all coefficients _except th

Re: [R] package colorspace and .WhitePoint question

2018-06-21 Thread Achim Zeileis
ge. To try it you can do: install.packages("colorspace", repos="http://R-Forge.R-project.org";) example("whitepoint", package = "colorspace") Glenn, it would be great if you could try this and let us know if any problems remain. On Mon, 4 Jun 2018,

Re: [R] package colorspace and .WhitePoint question

2018-06-04 Thread Achim Zeileis
Glenn, currently, this is currently not exposed in "colorspace" AFAICS. You can modify it by changing .WhitePoint inside colorspace's NAMESPACE, though: R> assignInNamespace(".WhitePoint", rbind(c(95, 100, 105)), +ns = "colorspace") R> as(XYZ(100, 100, 100), "LAB") LA

Re: [R] Rolling window difference for zoo time series

2018-04-24 Thread Achim Zeileis
On Tue, 24 Apr 2018, Eric Berger wrote: Zoo_TS/lag(Zoo_TS) - 1 Or: diff(Zoo_TS, arithmetic = FALSE) - 1 On Tue, Apr 24, 2018 at 9:29 PM, Christofer Bogaso < bogaso.christo...@gmail.com> wrote: Hi, I have a 'zoo' time series as below : Zoo_TS = zoo(5:1, as.Date(Sys.time())+0:4) Now I w

Re: [R] Understanding TS objects

2018-03-13 Thread Achim Zeileis
On Tue, 13 Mar 2018, JEFFERY REICHMAN wrote: R Help Community I'm trying to understand time series (TS) objects. Thought I understood but recently have run into a series of error messages that I'm not sure how to handle. I have 15 years of quarterly data and I typically create a TS object

Re: [R] hurdle model - count and response predictions

2018-02-16 Thread Achim Zeileis
I answered the question on SO. In short the differences come from truncated vs. untruncated models and conditional vs. unconditional expectations. Feel free to follow-up on SO or here on the list... On Fri, 16 Feb 2018, John Wilson wrote: Hello, I'm using pscl to run a hurdle model. Everythi

Re: [R] Plotting quarterly time series

2018-01-28 Thread Achim Zeileis
On Sun, 28 Jan 2018, p...@philipsmith.ca wrote: I have a data set with quarterly time series for several variables. The time index is recorded in column 1 of the dataframe as a character vector "Q1 1961", "Q2 1961","Q3 1961", "Q4 1961", "Q1 1962", etc. I want to produce line plots with ggplot2

Re: [R] Discrete valued time series data sets.

2018-01-02 Thread Achim Zeileis
The "tscount" package (see http://doi.org/10.18637/jss.v082.i05) comes with several count data time series. Maybe this is the kind of discrete data you were interested in? hth, Z On Tue, 2 Jan 2018, Eric Berger wrote: Hi Rolf, I looked at https://docs.microsoft.com/en-us/azure/sql-database/s

Re: [R] fortune candidate

2017-12-17 Thread Achim Zeileis
On Sun, 17 Dec 2017, J C Nash wrote: From Dirk E. on the R-devel list Many things a developer / power-user would do are very difficult on Windows. It is one of the charms of the platform. On the other hand you do get a few solitaire games so I guess everybody is happy. Thanks, added to the d

Re: [R] Graph f(x) = 1/x

2017-09-19 Thread Achim Zeileis
On Tue, 19 Sep 2017, AbouEl-Makarim Aboueissa wrote: Dear All: good morning I am trying to graph the function y=f(x)=1/x over the interval (-5,5). But I am getting an error message. Please see below. I am getting the error message: *Error in xy.coords(x, y, xlabel, ylabel, log) : * * 'x' an

Re: [R] Precision error in time index of ts objects

2017-09-02 Thread Achim Zeileis
not seem to have ".Tsp" anywhere in the code. It employs ts() in a couple of places so I'm not sure which part of the code you are referring to exactly. On Sat, Sep 2, 2017 at 12:31 AM Achim Zeileis wrote: On Fri, 1 Sep 2017, Andrea Altomani wrote: > I sh

Re: [R] Precision error in time index of ts objects

2017-09-01 Thread Achim Zeileis
On Fri, 1 Sep 2017, Andrea Altomani wrote: I should have formulated my question in a more specific way. 1. I suspect this is a floating point precision issue. I am not very knowledgeable about R internals, can someone else confirm it? Yes. If you represent a series with increment 1/12 it dep

Re: [R] R-Package for Recursive Partitioning without Classification or Regression

2017-07-31 Thread Achim Zeileis
On Fri, 28 Jul 2017, Tom D. Harray wrote: Hello, I have a question related to recursive partitioning, but I cannot find an answer, likely because I don't know how to properly word my Google search query. I think you are looking for "divisive hierarchical clustering" which is the more commo

Re: [R] Classification and Regression Tree for Survival Analysis

2017-06-13 Thread Achim Zeileis
On Tue, 13 Jun 2017, Dimitrie Siriopol via R-help wrote: I am trying to use the CART in a survival analysis. I have three variables of interest (all 3 ordinal - x, y and z, each of them with 5 categories) from which I want to make smaller groups (just an example 1st category from X variable w

Re: [R] Augmented Dickey Fuller test

2017-04-28 Thread Achim Zeileis
On Fri, 28 Apr 2017, T.Riedle wrote: Dear all, I am trying to run an ADF test using the adf.test() function in the tseries package and the ur.df() function in the urca package. The results I get contrast sharply. Whilst the adf.test() indicates stationarity which is in line with the correspo

Re: [R] Wilcoxon Test

2017-04-21 Thread Achim Zeileis
ey statistics. On 21 Apr 2017, at 14:54 , Achim Zeileis wrote: On Fri, 21 Apr 2017, Tripoli Massimiliano wrote: Dear R users, Why the result of Wilcoxon sum rank test by R is different from sas https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_npar1

Re: [R] Wilcoxon Test

2017-04-21 Thread Achim Zeileis
On Fri, 21 Apr 2017, Tripoli Massimiliano wrote: Dear R users, Why the result of Wilcoxon sum rank test by R is different from sas https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_npar1way_sect022.htm The code is next: sampleA <- c(1.94, 1.94, 2.92, 2.9

Re: [R] Piecewise continuous Poisson regression

2017-04-07 Thread Achim Zeileis
On Fri, 7 Apr 2017, Sorkin, John wrote: Is there an R package that will perform a piecewise continuous Poisson regression? I want to model two linear segments that intersect at a common knot. The "segmented" package implements such broken stick regressions based on either "lm" or "glm" model

Re: [R] Using betareg package to fit beta mixture with given initial parameters

2017-03-22 Thread Achim Zeileis
On Wed, 22 Mar 2017, Michael Dayan wrote: The method of setting the initial values given lambda, alpha1, etc. should not depend on the exact values of lambda, alpha1, etc. in my situation, i.e. it does not depend on my data. Presently, flexmix() that betamix() is built on cannot take the param

Re: [R] coeftest with covariance matrix

2017-03-16 Thread Achim Zeileis
On Thu, 16 Mar 2017, alfonso.carf...@uniparthenope.it wrote: Hi all, I want to ask you which is the difference between the specifyng and not specifyng the covariance matrix of the estimated coefficients when performing the coeftest command. coeftest(object, ...) computes Wald statistics f

Re: [R] lmtest package - Difference between vcov and vcov.

2017-02-19 Thread Achim Zeileis
On Sun, 19 Feb 2017, T.Riedle wrote: Dear all, I want to run a regression using coeftest() in combination with the waldtest() function from the lmtest package. I am confused about the argument vcov. The coeftest uses vcov. whereas according to the manual waldtest uses vcov and I am not sure

Re: [R] coeftest() R squared

2017-02-15 Thread Achim Zeileis
On Wed, 15 Feb 2017, T.Riedle wrote: Dear all, I want to run a regression using lm() with Newey West corrected standard errors. This is the code Reg<-lm(g~sent + liquidity + Cape, data=dataUsa) CoefNW<-coeftest(Reg, vcov.=NeweyWest) CoefNW In contrast to summary(Reg) the output of CoefNW nei

Re: [R] Date Column error: 'origin' must be supplied

2016-12-30 Thread Achim Zeileis
On Fri, 30 Dec 2016, Frederic Ntirenganya wrote: Hi All, I am creating date column on my data but getting the following error: #add date column dat1$Date=paste(as.Date(dat1$Year,dat1$Month, dat1$Day, sep="-"))Error in as.Date.numeric(origin, ...) : 'origin' must be supplied You first need to

Re: [R] tests for significance on conditional inference trees from party package

2016-12-13 Thread Achim Zeileis
Adrian, thanks for your interest. On Tue, 13 Dec 2016, Adrian Johnson wrote: Dear group, Please allow me to ask a naive question and pardon if it is qualified as stupid question. I am using party package to classify covariates and predict distribution of survival times for the classified var

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-10 Thread Achim Zeileis
r with Bert's advice of contacting a local statistics expert for discussion of such issues. hth, Z Achim Zeileis ha scritto: On Tue, 8 Nov 2016, danilo.car...@uniparthenope.it wrote: I tried the function flexmix() with the driver FLXMRnegbin() with two components first, in order to

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-08 Thread Achim Zeileis
flexmix(). So maybe setting these in some better way would be beneficial. Achim Zeileis ha scritto: On Mon, 7 Nov 2016, danilo.car...@uniparthenope.it wrote: I need a function for R software which computes a mixture of Negative Binomial distributions with at least three components. The pack

Re: [R] Three-component Negative Binomial Mixture: R code

2016-11-07 Thread Achim Zeileis
On Mon, 7 Nov 2016, danilo.car...@uniparthenope.it wrote: I need a function for R software which computes a mixture of Negative Binomial distributions with at least three components. The package "countreg" on R-Forge provides a driver FLXMRnegbin() that can be combined with the "flexmix" pack

Re: [R] Hausman Test

2016-09-12 Thread Achim Zeileis
On Mon, 12 Sep 2016, Ding, Jie Ding (NIH/NIA/ERP) [F] wrote: Dear Achim, Sorry to have disturbed you. I have encountered a problem when computing Hausman test statistics (i.e. p values) in R to compare OLS and 2SLS models. The problem is a discrepancy between the two p-value outputs from th

Re: [R] Chaid Decision Tree

2016-08-22 Thread Achim Zeileis
On Mon, 22 Aug 2016, MIKE DE LA HOZ wrote: Hi, I am running a chaid tree using titanic dataset (see attachment) setwd("C:/Users/miguel") titanic <- read.csv("train.csv") titanic.s <- subset( titanic, select = -c(PassengerId, Name ) ) ctrl <- chaid_control(minsplit = 20, minbucket = 5, mi

Re: [R] Likelihood ratio test in porl (MASS)

2016-07-27 Thread Achim Zeileis
On Wed, 27 Jul 2016, Faradj Koliev wrote: Dear all, A quick question: Let?s say I have a full and a restricted model that looks something like this: Full<- polr(Y ~ X1+X2+X3+X4, data=data, Hess = TRUE, method="logistic?) # ordered logistic regression Restricted<- polr(Y ~ X1+X2+X3, data=da

Re: [R] Ocr

2016-07-26 Thread Achim Zeileis
On Wed, 27 Jul 2016, Shane Carey wrote: Cool, thanks Jim!! I would love to be able to write my own script for this as I have many images/ pdf's in a folder and would like to batch process them using an R script!! The underlying engine is "tesseract" which is also available as a command-line t

Re: [R] C/C++/Fortran Rolling Window Regressions

2016-07-21 Thread Achim Zeileis
Jeremiah, for this purpose there are the "roll" and "RcppRoll" packages. Both use Rcpp and the former also provides rolling lm models. The latter has a generic interface that let's you define your own function. One thing to pay attention to, though, is the numerical reliability. Especially o

Re: [R] Logistic regression and robust standard errors

2016-07-01 Thread Achim Zeileis
On Fri, 1 Jul 2016, Faradj Koliev wrote: Dear Achim Zeileis,  Many thanks for your quick and informative answer.  I?m sure that the vcovCL should work, however, I experience some problems.  > coeftest(model, vcov=vcovCL(model, cluster=mydata$ID)) First I got this error:  Error in vco

Re: [R] Logistic regression and robust standard errors

2016-07-01 Thread Achim Zeileis
On Fri, 1 Jul 2016, Faradj Koliev wrote: Dear all, I use ?polr? command (library: MASS) to estimate an ordered logistic regression. My model: summary( model<- polr(y ~ x1+x2+x3+x4+x1*x2 ,data=mydata, Hess = TRUE)) But how do I get robust clustered standard errors? I??ve tried coeftest

Re: [R] Rpart plot produces no text

2016-06-29 Thread Achim Zeileis
I don't think this is an RStudio issue. The plot() method for "rpart" objects draws no labels. The text() method has to be called additionally: library("rpart") rp <- rpart(Species ~ ., data = iris) plot(rp) text(rp) As these plots produced by rpart itself are not very appealing, there are var

Re: [R] [FORGED] Re: Rattle

2016-06-25 Thread Achim Zeileis
On Sat, 25 Jun 2016, Rolf Turner wrote: On 25/06/16 09:13, Jeff Newmiller wrote: This is like asking, "My car doesn't work. Can anyone tell me what is wrong?" Fortune nomination! On R-Forge now. Z cheers, Rolf -- Technical Editor ANZJS Department of Statistics University of Aucklan

Re: [R] No reply from CRAN Task View: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization

2016-06-20 Thread Achim Zeileis
On Mon, 20 Jun 2016, Joseph Gama wrote: Hi all, I emailed a suggestion to Nicholas Lewin-Koh, the maintainer of the CRAN Task View: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization. I got no reply, so I wonder, is he still maintaining that view? If not, then who else doe

Re: [R] Using weights with truncreg

2016-06-13 Thread Achim Zeileis
On Mon, 13 Jun 2016, Ganz, Carl wrote: Hello everyone, I would like to use truncreg on survey data with weights, but so far as I can tell the weight parameter in truncreg is not working. I find that using weights does not actually change the output. Here is a small reproducible example using

Re: [R] sandwich package: HAC estimators

2016-06-01 Thread Achim Zeileis
wey & Wests nonparametric lag/bandwidth selection and prewhitening by default. Kind regards From: Achim Zeileis Sent: 31 May 2016 17:19 To: T.Riedle Cc: r-help@r-project.org Subject: Re: [R] sandwich package: HAC estimators On Tue, 31 May 2016, T.Riedle wrote:

Re: [R] Fortune candidate: Re: Whether statistical background is must to learn R language

2016-05-31 Thread Achim Zeileis
Thanks, Sarah, added now in the devel-package on R-Forge. Z On Tue, 31 May 2016, Sarah Goslee wrote: On Tue, May 31, 2016 at 11:09 AM, Jeff Newmiller wrote: However, please don't apply R like a magic answers box, because you can mislead others and cause harm.

Re: [R] sandwich package: HAC estimators

2016-05-31 Thread Achim Zeileis
= NeweyWest) waldtest(m, vcov = NeweyWest) Instead of NeweyWest other covariance estimators (e.g., vcovHAC, kernHAC, etc.) can also be plugged in. hth, Z From: Achim Zeileis Sent: 31 May 2016 13:18 To: T.Riedle Cc: r-help@r-project.org Subject: Re: [R] san

Re: [R] sandwich package: HAC estimators

2016-05-31 Thread Achim Zeileis
d test". For pseudo-R-squared values I'm not familiar with HAC-adjusted variants. And I'm not sure whether there is a LaTeX export solution that encompasses all of these aspects simultaneously. ____ From: R-help on behalf of Achim Zeileis

Re: [R] sandwich package: HAC estimators

2016-05-31 Thread Achim Zeileis
On Mon, 30 May 2016, Leonardo Ferreira Fontenelle wrote: Em Sáb 28 mai. 2016, às 15:50, Achim Zeileis escreveu: On Sat, 28 May 2016, T.Riedle wrote: > I thought it would be useful to incorporate the HAC consistent > covariance matrix into the logistic regression directly and gener

Re: [R] zelig package: robust SE

2016-05-29 Thread Achim Zeileis
On Sun, 29 May 2016, T.Riedle wrote: Dear R users, I am trying to run a logistic regression using zelig. The simple logistic regression works well but now I want to have HAC robust standard errors. I have read in the manual that there is an option called "robust" and that zelig() computes ro

Re: [R] sandwich package: HAC estimators

2016-05-28 Thread Achim Zeileis
On Sat, 28 May 2016, T.Riedle wrote: Dear R users, I am running a logistic regression using the rms package and the code looks as follows: crisis_bubble4<-lrm(stock.market.crash~crash.MA+bubble.MA+MP.MA+UTS.MA+UPR.MA+PPI.MA+RV.MA,data=Data_logitregression_movingaverage) Now, I would like to

Re: [R] Fortune candidate, was Re: Shaded areas in R

2016-05-26 Thread Achim Zeileis
On Thu, 26 May 2016, Michael Dewey wrote: In a reply Duncan said Nice, thanks, added to the "fortunes" package on R-Forge now. Best, Z On 26/05/2016 16:12, Duncan Murdoch wrote: On 26/05/2016 11:03 AM, Óscar Jiménez wrote: You should try things; R won't break. Duncan Murdoch __

Re: [R] Truncreg package help

2016-05-07 Thread Achim Zeileis
On Fri, 6 May 2016, Philipp Schaper wrote: Dear R userers, I am running truncated regressions with the 'truncreg' package. My sample is large (6,000 observations), the data is left-truncated at 1 and the left tail of the data is heavily centered at 1. When I am running the regression I receive

Re: [R] Accessing terminal datasets in Ctree()

2016-05-02 Thread Achim Zeileis
= "node") you can set up a new variable, e.g., iris$node <- factor(predict(ct, type = "node")) and then use this to obtain the subset corresponding to each of the terminal nodes. Regards, Preetam  On Tue, May 3, 2016 at 3:08 AM, Achim Zeileis wrote: On Mon,

Re: [R] Accessing terminal datasets in Ctree()

2016-05-02 Thread Achim Zeileis
On Mon, 2 May 2016, Preetam Pal wrote: Hi guys, If I am applying ctree() on a data (specifying some control parameters like maxdepth), is there a way I can programmatically access the (smaller) datasets corresponding to the terminal nodes in the tree? Say, if there are 7 terminal nodes, I need

Re: [R] Retrieving response variable in the probit

2016-05-02 Thread Achim Zeileis
On Mon, 2 May 2016, Steven Yen wrote: Can anyone tell me how to retrieve the response (dependent) variable from a probit regression object (as much as model.matrix(obj) retrieves the data matrix). Below is a self-runnable set of codes. Thank you! library(sampleSelection) data<-read.csv("https:/

Re: [R] simple interactions

2016-04-15 Thread Achim Zeileis
Try using ~ group/age or even ~ 0 + group/age Both have all three group-specific slopes but differ with respect to the intercept codings. The latter has three group-specific intercepts as well. But the former has an intercept corresponding to the reference group A and then the usual treatm

Re: [R] Decision Tree and Random Forrest

2016-04-14 Thread Achim Zeileis
On Thu, 14 Apr 2016, Michael Artz wrote: Ah yes I will have to use the predict function. But the predict function will not get me there really. If I can take the example that I have a model predicting whether or not I will play golf (this is the dependent value), and there are three independen

Re: [R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread Achim Zeileis
On Mon, 4 Apr 2016, varin sacha via R-help wrote: Hi Deepak, In econometrics there is another test very often used : the white test. The white test is based on the comparison of the estimated variances of residuals when the model is estimated by OLS under the assumption of homoscedasticity a

Re: [R] Test for Homoscedesticity in R Without BP Test

2016-04-04 Thread Achim Zeileis
On Mon, 4 Apr 2016, Deepak Singh wrote: Respected Sir, I am doing a project on multiple linear model fitting and in that project I have to test Homoscedesticity of errors I have google for the same and found bptest for the same but in R version 3.2.4 bp test is not available. The function is c

Re: [R] Compute the Gini coefficient

2016-03-30 Thread Achim Zeileis
On Wed, 30 Mar 2016, Erich Neuwirth wrote: On 30 Mar 2016, at 02:53, Marine Regis wrote: Hello, I would like to build a Lorenz curve and calculate a Gini coefficient in order to find how much parasites does the top 20% most infected hosts support. Here is my data set: Number of parasites

Re: [R] package Formula????

2016-03-11 Thread Achim Zeileis
On Fri, 11 Mar 2016, CHIRIBOGA Xavier wrote: Dear all, again me I have already updated my version of R. But still appears this message: plot(ctree(Surv(hours,state)~soil+volatile, data=data)) Error in loadNamespace(name) : there is no package called 'Formula' I cannot find a package "Formu

Re: [R] FUNCTION ctree

2016-03-10 Thread Achim Zeileis
Thanks to Erich and Sarah for the clarifications. For those wondering whether ctree() from "party" or from "partykit" should be used: the latter is the newer and improved implementation. On Thu, 10 Mar 2016, Erich Neuwirth wrote: If you do ??ctree and the package partykit is installed, you wi

Re: [R] ivreg with two endogenous variables and 1 instrument respectively

2016-03-09 Thread Achim Zeileis
On Tue, 8 Mar 2016, stefania innocenti wrote: Hello, I am trying to use the ivregress function to estimate a second stage model which looks like the following: LogGDP=GEO+RULE+OPENNESS I would like to instrument Rule (RULE) with Settler mortality (SETTLER) and Openness (OPENNESS) with logFr

Re: [R] error in vcovNW

2015-12-19 Thread Achim Zeileis
:06, Achim Zeileis wrote: On Sat, 19 Dec 2015, Saba Sehrish via R-help wrote: > Hi I am using NeweyWest standard errors to correct lm( ) output. For example: > lm(A~A1+A2+A3+A4+A5+B1+B2+B3+B4+B5) > vcovNW<-NeweyWest(lm(A~A1+A2+A3+A4+A5+B1+B2+B3+B4+B5)) > > I am using pac

Re: [R] error in vcovNW

2015-12-18 Thread Achim Zeileis
On Sat, 19 Dec 2015, Saba Sehrish via R-help wrote: Hi I am using NeweyWest standard errors to correct lm( ) output. For example: lm(A~A1+A2+A3+A4+A5+B1+B2+B3+B4+B5) vcovNW<-NeweyWest(lm(A~A1+A2+A3+A4+A5+B1+B2+B3+B4+B5)) I am using package(sandwich) for NeweyWest. Now when I run this command, i

Re: [R] Clustered Standard Errors?

2015-11-16 Thread Achim Zeileis
On Mon, 16 Nov 2015, Ignacio Martinez wrote: Hi, I found this post from 2011 for doing clustered standard errors in R. Is there any update to the lm package that allows to do this without having to write your own fun

Re: [R] ​ use of PPML (Poisson Pseudo Maximum Likelihood)

2015-10-08 Thread Achim Zeileis
On Thu, 8 Oct 2015, ?? ?. wrote: Dear Colleagues! We use R for research. We would like to perform calculations (gravity model of trade) with the ?? use of PPML (Poisson Pseudo Maximum Likelihood). Please explain: 1. What package in R enables us to make calculations in accordance with the

Re: [R] c(1:n, 1:(n-1), 1:(n-2), ... , 1)

2015-09-17 Thread Achim Zeileis
On Thu, 17 Sep 2015, Peter Langfelder wrote: Not sure if this is slicker or easier to follow than your solution, but it is shorter :) do.call(c, lapply(n:1, function(n1) 1:n1)) Also not sure about efficiency but somewhat shorter... unlist(lapply(5:1, seq)) Peter On Thu, Sep 17, 2015 at 11:

Re: [R] Trees (and Forests) with packages 'party' vs. 'partykit': Different results

2015-09-14 Thread Achim Zeileis
Christopher, thanks for you interest. I'm currently exploring a dataset with the help of conditional inference trees (still very much a beginner with this technique & log. reg. methods as a whole t.b.h.), since they explained more variation in my dataset than a binary logistic regression with

Re: [R] [FORGED] Re: Help with Binning Data

2015-09-10 Thread Achim Zeileis
On Fri, 11 Sep 2015, Rolf Turner wrote: On 11/09/15 11:57, David Winsemius wrote: The urge to imitate other statistical package that rely on profusion of dummies should be resisted. R repression functions can handle factor variables Fortune? :-) Nice! Should I include the "repress

Re: [R] Task Views

2015-09-09 Thread Achim Zeileis
On Wed, 9 Sep 2015, Partha Sinha wrote: Dear All I am using R version R version 3.2.1 (2015-06-18) in windows 7. I have installed few task views like Timeseries and Graphics in R. 1. Is it possible to find out which "TASK Views" are installed in the system ? Not out of the box. The task view

Re: [R] hurdle control and optim

2015-08-17 Thread Achim Zeileis
Please refrain from cross-posting. The same request was sent to the author of hurdle(), R-help, and StackOverflow (where it was already answered). Also, do provide self-contained and reproducible code as would be appropriate in any of the three cases. On Mon, 17 Aug 2015, Matt Dicken wrote:

Re: [R] CHAID Usage in R

2015-06-22 Thread Achim Zeileis
On Mon, 22 Jun 2015, My List wrote: All: I am trying to implement CHAID decision tree. Can anyone please help me to know which package can be used for it or lead me to the documentation to the same. A CHAID implementation is available on R-Forge at: https://R-Forge.R-project.org/R/?group_id=3

Re: [R] Views installation

2015-06-12 Thread Achim Zeileis
On Fri, 12 Jun 2015, Partha Sinha wrote: I want to install views like machine learning and Bayesian using code ( write code and running the code once and it will install all packages in those views rather than doing it twice). Pl help I'm not sure what exactly you are looking for but ctv::up

Re: [R] Mean error message missing

2015-06-08 Thread Achim Zeileis
On Mon, 8 Jun 2015, Christian Brandstätter wrote: Dear list, I found an odd behavior of the mean function; it is allowed to do something that you probably shouldn't: If you calculate mean() of a sequence of numbers (without declaring them as vector), mean() then just computes mean() of the fi

Re: [R] Mean of dates

2015-04-24 Thread Achim Zeileis
On Fri, 24 Apr 2015, Jue Lin-Ye wrote: Dear fellow R-help members, If my data is MM DD HH 2015 04 24 01 2015 04 24 02 2015 04 24 06 Where : year MM:month DD:day HH: hour How could I calculate the mean of the ISOdatetime(,MM,DD,HH,0,0) of these? With the mean() method? On my

Re: [R] Exhaustive CHAID package

2015-04-22 Thread Achim Zeileis
Yes. I thought R-FORGE was solely for developers? See: https://R-Forge.R-project.org/R/?group_id=343 You can easily install the package from R-Forge and also check out the entire source code anonymously. Again, many thanks. MCG -Original Message- From: Achim Zeileis [mailto:achim.zeil.

Re: [R] Exhaustive CHAID package

2015-04-22 Thread Achim Zeileis
On Tue, 21 Apr 2015, Michael Grant wrote: Dear R-Help: From multiple sources comparing methods of tree classification and tree regressions on various data sets, it seems that Exhaustive CHAID (distinct from CHAID), most commonly generates the most useful tree results and, in particular, is m

Re: [R] multiple break in univariate series

2015-03-29 Thread Achim Zeileis
On Sat, 28 Mar 2015, Bert Gunter wrote: Once you have looked at the data and chosen change points to test based on the data, the tests for change points are invalid (unless you make appropriate adjustments for post hoc tests). And no, I am not making this up. Consult any competent statistician.

Re: [R] #library(party) - Compare predicted results for ctree

2015-02-16 Thread Achim Zeileis
On Mon, 16 Feb 2015, Rodica Coderie via R-help wrote: Hello, I've created a ctree model called fit using 15 input variables for a factor predicted variable Response (YES/NO). When I run the following : table(predict(fit2), training_data$response) I get the following result: NO YES NO 4

Re: [R] R2BayesX

2015-02-05 Thread Achim Zeileis
bs = "re"), data = d, method = "MCMC", family = "gaussian") are all ok. Niki has contacted the original BayesX authors who might be able to give more insight. For the moment, I would recommend to use method="REML". Best, Z Kind regards, Shanley -

  1   2   3   4   5   6   7   8   >