[R] Precision in R

2018-02-25 Thread Iuri Gavronski
Hi, Why sum() on a 10-item vector produces a different value than its counterpart on a 2-item vector? I understand the problems related to the arithmetic precision in storing decimal numbers in binary format, but shouldn't the errors be equal regardless of the method used? See my example: > opti

[R] Problems with bstats::white.test()

2014-09-08 Thread Iuri Gavronski
Hi, I am trying to test for heteroskedascity in an OLS model, but I am not able to run the white.test() if the model has dummy variables built from factors. Any suggestions? Please find a reproducible code below: myswiss <- swiss myswiss$fert <- ifelse( myswiss$Fertility>70, "High","Low") mysw

[R] Multiplicative Heterogeneous DIFFusion (mhdiff) models in R

2014-06-03 Thread Iuri Gavronski
in advance, Iuri _ Dr. Iuri Gavronski Assistant Professor Programa de Pós-Graduação em Administração Universidade do Vale do Rio dos Sinos – UNISINOS Av. Unisinos, 950 – São Leopoldo – RS – Brasil Sala (Room) 5A 407 D 93022-000

[R] Ideas for a short R course

2014-01-29 Thread Iuri Gavronski
Hi, A colleague invited me to teach a short course in R for Management, Accounting, and Economics PhD students. I would have 5 3-hour classes. Any ideas (datasets, syllabus, teaching strategies, etc.) are welcome. Kind regards, Iuri. _ Dr. Iuri

[R] Factor deletion criteria

2013-05-03 Thread Iuri Gavronski
Hi, I would like to know the criteria by which R removes a factor in linear models. For example, I have a four level factor, and R creates 3 dummies to estimate coefficients. Which level is chosen? Can I chance it? Thanks, Iuri [[alternative HTML version deleted]]

[R] Colors in interaction plots

2013-01-17 Thread Iuri Gavronski
Hi, I am trying to plot an interaction.plot with different color for each level of a factor. It has an erratic behavior. For example, it works for the first interaction.plot below, with the example from the ALDA book, but not with the other plots, from the NPK dataset: # from http://www.ats.ucla

[R] car::linearHypothesis fails to constrain factor to zero

2012-08-15 Thread Iuri Gavronski
Hi, I am trying to test whether a factor (coded as a set of dummy variables) is equal to zero, using linearHypothesis. I get an error. See a reproducible example: data(swiss) my_swiss = swiss my_swiss$fake = factor(sample(c("A","B"),47,rep=T)) my_lm <- lm(Infant.Mortality ~ Fertility + fake, data

[R] Fwd: How to best analyze dataset with zero-inflated loglinear dependent variable?

2012-06-08 Thread Iuri Gavronski
Dear netters, Sorry for cross-posting this question. I am sure R-Help is not a research methods discussion list, but we have many statisticians in the list and I would like to hear from them. Any function/package in R would be able to deal with the problem from this researcher? -- Forward

Re: [R] Function for multiple t tests

2012-01-21 Thread Iuri Gavronski
p) = c(vars,"N") outp } my_swiss = swiss[-1,] my_swiss$facto = rep(1:2,nrow(my_swiss)/2) ttable(Fertility + Agriculture ~ facto, data=my_swiss) On Sat, Jan 21, 2012 at 7:40 PM, Iuri Gavronski wrote: > Hi, > > I want to run t.test() for several variables among two groups, and I >

[R] Function for multiple t tests

2012-01-21 Thread Iuri Gavronski
Hi, I want to run t.test() for several variables among two groups, and I would like to skip the tedious process of collecting information to assemble a table, but I am not sure if the function I want already exists. Any suggestion would be appreciated. I have a working example, as required by the

[R] Autocorrelation in R

2011-06-08 Thread Iuri Gavronski
trend + yd_ts, correlation = corAR1(form= ~yd_ts),method="ML") summary(gls_ex32_ar1) _ Dr. Iuri Gavronski Assistant Professor Programa de Pós-Graduação em Administração Universidade do Vale do Rio dos Sinos – UNISINOS Av. Unisinos, 950 – São Leopold

[R] Meta-analysis of a correlation matrix

2011-04-11 Thread Iuri Gavronski
Sorry for the cross-posting, but I would like to know if anyone is aware of a package in R for this. -- Forwarded message -- From: John Antonakis Sent: Sunday, April 10, 2011 3:26 PM To: RMNET Subject: Meta-analysis of a correlation matrix (correct thread title) Hi: Does anyone

[R] Non-procedural access to columns of a matrix

2010-06-18 Thread Iuri Gavronski
Hi, I would like to have an index for a column in a matrix encoded in a cell of the same matrix. For example: x = matrix(c(11,12,13,1, 21,22,23,3, 31,32,33,2),byrow=T,ncol=4) In this case, column 4 is the index. I then access the column specified in the index by: > for (i in 1:3) print(x[i,x[i,4]

[R] Using pch with the RGL library

2010-04-05 Thread Iuri Gavronski
Hi, I am trying to compare two 3D plots. For that, I am trying to use the "pch" parameter in the "points3d" function, but it is not working. Is it implemented? Any suggestion? Here goes a reproducible code. I wanted the second plot having different symbols for the points. x <- rbind(matrix(rnorm

Re: [R] Models for Discrete Choice in R

2009-11-10 Thread Iuri Gavronski
E Harrell Jr wrote: > Emmanuel Charpentier wrote: >> >> Le dimanche 08 novembre 2009 à 19:05 -0600, Frank E Harrell Jr a écrit : >>> >>> Emmanuel Charpentier wrote: >>>> >>>> Le dimanche 08 novembre 2009 à 17:07 -0200, Iuri Gavronski a écr

[R] Models for Discrete Choice in R

2009-11-08 Thread Iuri Gavronski
Hi, I would like to fit Logit models for ordered data, such as those suggested by Greene (2003), p. 736. Does anyone suggests any package in R for that? By the way, my dependent variable is ordinal and my independent variables are ratio/intervalar. Thanks, Iuri. Greene, W. H. Econometric Anal

Re: [R] Plots with k-means

2009-11-02 Thread Iuri Gavronski
xt file (which should make it through the list-serv: > > > > > > -- David. > > sessionInfo() > R version 2.10.0 Patched (2009-10-29 r50258) > x86_64-apple-darwin9.8.0 > > locale: > [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base

[R] Plots with k-means

2009-10-30 Thread Iuri Gavronski
Hi, I'm doing a k-means cluster with 6 clusters and 15 variables. Any suggestions on how to plot the results? I've tried the standard xy plot, but couldn't get much of it. Thansk in advance, Iuri. __ R-help@r-project.org mailing list https://stat.eth

Re: [R] CFA in R/sem package

2009-04-09 Thread Iuri Gavronski
originally called it.  But they won't take . in the name of a package. > > On Apr 9, 2009, at 4:07 PM, Iuri Gavronski wrote: > >> Jarret, >> >> Look: >>> >>> install.packages("sem.additions", repos="http://R-Forge.R-project.org";)

Re: [R] CFA in R/sem package

2009-04-09 Thread Iuri Gavronski
cts/sem-additions/ > > -Jarrett > > On Apr 9, 2009, at 6:39 AM, Iuri Gavronski wrote: > >> Hi, >> >> I am not sure if R-help is the right forum for my question. If not, >> please let me know. >> >> I have to do some discriminant validity tests with

[R] CFA in R/sem package

2009-04-09 Thread Iuri Gavronski
Hi, I am not sure if R-help is the right forum for my question. If not, please let me know. I have to do some discriminant validity tests with some constructs. I am using the method of doing a CFA constraining the correlation of a pair of the constructs to 1 and comparing the chi-square of this c

Re: [R] Help with rgl

2009-02-18 Thread Iuri Gavronski
gt;>> (1) you'll need ImageMagick installed to use the command "convert" to >>>> convert image sequences into GIF animations; see ?movie3d >>>> (2) "viewport" is read only!! see ?open3d carefully >>>> >>>> Regards, >>&g

[R] Help with rgl

2009-02-16 Thread Iuri Gavronski
Hi, I don't know much about the RGL package, and I have read the documentation and tried some parameters, with no luck... I would like to generate a movie from a 3D object (code below), where the vortex A is closer to the observer, and then the object rotates and the B vortex gets closer. I would

[R] Converting rankings to paired-comparisons

2009-01-20 Thread Iuri Gavronski
Hi, I need to convert a ranking dataset (actually, it is an ipsative scale) to paired-comparisons. For example, if I have this data: x <- matrix(c(10,20,30,40,0, 10,10,10,10,50, 30,30,30,5,5), nrow=3, ncol=5, byrow=TRUE, dimnames = list(1:3, letters[1:5]) ) For every pair of data, I

[R] Multiple lm outputs consolidated

2008-01-03 Thread Iuri Gavronski
Hi, I would like to know if there is any function that reformats multiple lm objects into one only table. Say: data(swiss) model1=lm(Fertility ~ Education,data=swiss) model2=lm(Fertility ~ Education + Examination,data=swiss) ... modeln=lm(Fertility ~ Education + Examination + (many other vari