Hello All: I am trying to replicate the results of an example found in Alan Agresti's "Categorical Data Analysis" on pages 267-269. The example is one of a 2 x 2 cross-classification table of ordinal counts: job satisfaction and income. I am able to get Agresti's results for the independence model (G^2 = 12.03 with df = 9) assuming as he does that the data is nominal, but I'm unable to derive his model of uniform association (linear-by-linear association, p. 263-269) for which he gets a value of G^2 = 2.39 with df = 8. The observed data is represented by table 8.2 on page 268 as follows: > Freq <- c(20, 24, 80, 82, + 22, 38, 104, 125, + 13, 28, 81, 113, + 7, 18, 54, 92) > > data.3 <- t(matrix(Freq, nrow = 4)) > > list.3 <- list(Income = c("< 6,000", + "6,000-15,000", + "15,000-25,000", + "> 25,000"), + Satisfaction = c("Very dissatisfied", + "Little dissatisfied", + "Moderately satisfied", + "Very satisfied")) > > dimnames(data.3) <- list.3 > > ftable(data.3) Satisfaction Very dissatisfied Little dissatisfied Moderately satisfied Very satisfied Income < 6,000 20 24 80 82 6,000-15,000 22 38 104 125 15,000-25,000 13 28 81 113 > 25,000 7 18 54 92 > I am able to obtain Agresti's results for the independence model which assumes the data is nominal, not ordinal, using either glm() or loglm(). > library(MASS) > options(contrasts=c("contr.sum", "contr.poly")) > > X <- as.integer(gl(4, 4, 16)) - 1 > Y <- as.integer(gl(4, 1, 16)) - 1 > > data.2 <- data.frame(Freq, X = factor(X), Y = factor(Y)) > > summary(fm3 <- glm(Freq ~ X + Y, data = data.2, + family = poisson())) Call: glm(formula = Freq ~ X + Y, family = poisson(), data = data.2) Deviance Residuals: Min 1Q Median 3Q Max -1.50416 -0.67501 -0.08592 0.53800 1.51852 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 3.74425 0.04444 84.259 < 2e-16 *** X1 -0.07101 0.05982 -1.187 0.235 X2 0.26754 0.05368 4.984 6.22e-07 *** X3 0.06070 0.05726 1.060 0.289 Y1 -1.02174 0.09995 -10.222 < 2e-16 *** Y2 -0.46674 0.08101 -5.761 8.35e-09 *** Y3 0.61632 0.05917 10.416 < 2e-16 *** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 (Dispersion parameter for poisson family taken to be 1) Null deviance: 445.763 on 15 degrees of freedom Residual deviance: 12.037 on 9 degrees of freedom AIC: 115.07 Number of Fisher Scoring iterations: 3 > dummy.coef(fm3) Full coefficients are (Intercept): 3.744253 X: 0 1 2 3 -0.07101181 0.26753870 0.06069753 -0.25722441 Y: 0 1 2 3 -1.0217353 -0.4667389 0.6163210 0.8721532 > > fm4 <- loglm(Freq ~ X + Y, data = data.2, param = T, fit = T) > fm4; fm4$param Call: loglm(formula = Freq ~ X + Y, data = data.2, param = T, fit = T) Statistics: X^2 df P(> X^2) Likelihood Ratio 12.03686 9 0.2112391 Pearson 11.98857 9 0.2139542 $"(Intercept)" [1] 3.744253 $X 0 1 2 3 -0.07101181 0.26753871 0.06069753 -0.25722443 $Y 0 1 2 3 -1.0217356 -0.4667388 0.6163211 0.8721533 > My question is this: can glm() or some other function be used in the manner Agresti employed for ordinal count data? Thank you, ANDREW Andrew Criswell Professor of Finance Graduate School Bangkok University -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi R users! Is there a way to call the editor with command line options? I.e. I want to use Vim and set it automatically in R mode when it is started. This requires something like vim -c "set syn=r" as the start command. Any ideas? I am using R 1.5.1 under Win 2000. Thanks in advance! -- Ulf Martin ulf.martin at gmx.net -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello R users: I have two questions: 1. How can I perform Nested (several levels) mixed experimental models in R? 2. Where can I find the fac.design, design functions in R? Thank you very much. -- Kenneth Roy Cabrera Torres Unviersidad Nacional de Colombia, Sede Medell?n Instituto de Ciencias Naturales y Ecolog?a Escuela de Geociencias e-mail krcabrer at unalmed.edu.co Tel +57 (4) 430-9308 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hola! This cvan be done with the nlme package, function lme, quiet easily, but it is a goog idea to buy the Pinheiro/Bates book. Or mayby MASS4 covers this enough for a start? 2. AFAIK, this doesnt exist in R. Kjetil Halvorsen Kenneth Cabrera wrote:> > Hello R users: > > I have two questions: > > 1. How can I perform Nested (several levels) mixed experimental models in R? > > 2. Where can I find the fac.design, design functions in R? > > Thank you very much. > > -- > Kenneth Roy Cabrera Torres > Unviersidad Nacional de Colombia, Sede Medell?n > Instituto de Ciencias Naturales y Ecolog?a > Escuela de Geociencias > e-mail krcabrer at unalmed.edu.co > Tel +57 (4) 430-9308 > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 22 Aug 2002, kjetil halvorsen wrote:> Hola! > > This cvan be done with the nlme package, function lme, quiet easily, > but it is a goog idea to buy the Pinheiro/Bates book. Or mayby MASS4 > covers this enough for a start?If you have balanced nested mixed models, aov using Error may be a bit easier. MASS3 and MASS4 have examples done both ways.> > 2. AFAIK, this doesnt exist in R. > > Kjetil Halvorsen > > > Kenneth Cabrera wrote: > > > > Hello R users: > > > > I have two questions: > > > > 1. How can I perform Nested (several levels) mixed experimental models in R? > > > > 2. Where can I find the fac.design, design functions in R? > > > > Thank you very much. > > > > -- > > Kenneth Roy Cabrera Torres > > Unviersidad Nacional de Colombia, Sede Medellín > > Instituto de Ciencias Naturales y Ecología > > Escuela de Geociencias > > e-mail krcabrer at unalmed.edu.co > > Tel +57 (4) 430-9308 > > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > > Send "info", "help", or "[un]subscribe" > > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hola! Can the foreign package now read data from spss 10? Kjetil Halvorsen -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Kjetil, It seems to work for me. (I believe that I've imported such files in the past, and I just checked on one of the data files distributed with SPSS.) John At 04:45 PM 8/27/2002 -0400, kjetil halvorsen wrote:>Hola! > >Can the foreign package now read data from spss 10? > >Kjetil Halvorsen----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox ----------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello R users and developers: I want to know if anybody have make any implementation of QUEST (Quick, Unbiased and Efficient Statistical Tree, Low and Vinichesetakul) or CHAID (Chi-square Automatic Interaction Detector) in R. Thank you for your help -- Kenneth Roy Cabrera Torres Unviersidad Nacional de Colombia, Sede Medell?n Instituto de Ciencias Naturales y Ecolog?a Escuela de Geociencias e-mail krcabrer at unalmed.edu.co Tel +57 (4) 430-9351 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello Dear R List: Is there an easy way (one line command, or at least without "for") to make a categorization of a continuos variable that I have in a vector, say "x", and the limits of the categories in other vector, say "y". The vector "x" is 10000 length and the "y" vector is 101 length for 100 categories, where rank of "x" is narrow or at least the same than the rank of "y". Thank you for your ideas. Kenneth -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Kenneth, At 05:50 AM 10/8/2002 -0500, Kenneth Cabrera wrote:>Is there an easy way (one line command, or at least without "for") to make a >categorization of a continuos variable that I have in a vector, say "x", >and the >limits of the categories in other vector, say "y". The vector "x" is 10000 >length >and the "y" vector is 101 length for 100 categories, where rank of "x" is >narrow >or at least the same than the rank of "y".cut(x, breaks=y) or, if you want an ordered factor, ordered(cut(x, breaks=y)) Be careful to set the first entry of breaks below min(x). See ?cuts for details. I hope that this helps, John ----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox ----------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello Dear R List:> > Is there an easy way (one line command, or at least without "for") to > make a > categorization of a continuos variable that I have in a vector, say > "x", and the > limits of the categories in other vector, say "y". The vector "x" is > 10000 length > and the "y" vector is 101 length for 100 categories, where rank of "x" > is narrow > or at least the same than the rank of "y". > > Thank you for your ideas.-- Kenneth Roy Cabrera Torres Unviersidad Nacional de Colombia, Sede Medell?n Instituto de Ciencias Naturales y Ecolog?a Escuela de Geociencias e-mail krcabrer at unalmed.edu.co Tel +57 (4) 430-9351 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
something like cut(x, br=y) ? Kjetil Halvorsen Kenneth Cabrera wrote:> > Hello Dear R List: > > Is there an easy way (one line command, or at least without "for") to > make a > categorization of a continuos variable that I have in a vector, say "x", > and the > limits of the categories in other vector, say "y". The vector "x" is > 10000 length > and the "y" vector is 101 length for 100 categories, where rank of "x" > is narrow > or at least the same than the rank of "y". > > Thank you for your ideas. > > Kenneth > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello, dear R-users: When I use the package waveslim and I call a database. >data(ibm) It appears the following message: Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `ibm.txt' But all the data files are on the rw1060\library\waveslim\data path. In LINUX it works fine! What should I do? Thank you for your help. Im using R in W2K platform: $platform [1] "i386-pc-mingw32" $arch [1] "i386" $os [1] "mingw32" $system [1] "i386, mingw32" $status [1] "" $major [1] "1" $minor [1] "6.0" $year [1] "2002" $month [1] "10" $day [1] "01" $language[1] "R" -- Kenneth Roy Cabrera Torres Unviersidad Nacional de Colombia, Sede Medell?n Instituto de Ciencias Naturales y Ecolog?a Escuela de Geociencias e-mail krcabrer at unalmed.edu.co Tel +57 (4) 430-9351 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I'm using R 1.6.1 under Redhat Linux 8.0. I'm following the example from V&R (1994) pp. 177-181. I get the split-plot ANOVA table: > summary(oats.aov) Error: B Df Sum Sq Mean Sq F value Pr(>F) Residuals 5 15875.3 3175.1 Error: B:V Df Sum Sq Mean Sq F value Pr(>F) V 2 1786.4 893.2 1.4853 0.2724 Residuals 10 6013.3 601.3 Error: Within Df Sum Sq Mean Sq F value Pr(>F) Nf 3 20020.5 6673.5 37.6856 2.458e-12 *** Nf:V 6 321.7 53.6 0.3028 0.9322 Residuals 45 7968.7 177.1 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 I need to get hold of the residuals and fitted values. The usual way of using "resid" and "fitted" doesn't work I guess because this is a multistratum model. The "studres" function shows up if I load the MASS library. But I cannot get the "proj" and "update" functions to work as they do in S-Plus: > oats.fm <- update(oats.aov,qr=TRUE) Error in update.default(oats.aov, qr = TRUE) : need an object with call component How can I get the residuals and fitted values? Wouldn't there be three sets of residuals? One for the blocks (6 residuals), one for the varieties (18 resduals), and another for the subplots (72 residuals)? If we only looked at the varieties and blocks, this would be a randomized block design using the average for each plot as the observations. There would be 18 residuals. The F-statistic and p-value match the split-plot ANOVA results for variety. Thanks. Rick B.