Re: [R] Printing vector

2019-07-23 Thread Michael Friendly
Nice to see William Dunlap take the trouble to mimic the classic Fortran behavior of printing for numbers that don't fit in the given width :) -Michael On 7/22/19 6:33 p.m., William Dunlap via R-help wrote: The following mimics Fortran printing with format F.. print1 <- function (x, perL

Re: [R] Using options(max.print = 1000000) to read in data

2019-07-09 Thread Michael Friendly
usion, I was expecting the whole dataset to load into my > console and was concerned that perhaps if I had to set the data in the > data frame as a matrix (if not already), then I would not achieve this > result. > > Thanks, > > Spencer > > On Tue, Jul 9, 2019 at

Re: [R] Using options(max.print = 1000000) to read in data

2019-07-09 Thread Michael Friendly
Why do you need it to be a matrix? A data.frame is like a matrix, but allows columns of mixed types. as.matrix() will coerce your data frame to a matrix if you really need this. On 7/08/19 4:43 p.m., Spencer Brackett wrote: Using str(GBM.txt) produced the same output as last time, which lists

Re: [R] R 3.6.1 is released

2019-07-05 Thread Michael Friendly
On a nice summer day in the Fitou region of France, I feel like asking all R-help folks to raise a glass of their favorite beverage in a toast to the R / CRAN maintainers. Thanks for your efforts! -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept

Re: [R] Structuring data for Correspondence Analysis

2019-03-30 Thread Michael Friendly
8-20 In SAS I would simply do this: proc corresp data=table dim=2 outc=_coord; table Preference, Sex Age Time; run; I don't know how convert in R a data frame to a frequency table to execute properly this function: ca <- ca(, graph=FALSE) [[alternative HTML ver

Re: [R] Tinn-R: new website under https protocol / fortune nomination

2019-01-19 Thread Michael Friendly
... the height of your flight depends only on you! -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, ASA Statistical Graphics Section York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavi

Re: [R] Printing a list of simultaneous equations

2019-01-19 Thread Michael Friendly
statistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing

[R] ANNOUNCE: ASA Data Challenge Expo, 2019

2018-11-14 Thread Michael Friendly
ortion of the New York City Housing and Vacancy Survey data, but can also combine other data sources in the analysis. If you have any questions on the Data Challenge Expo 2019 please reach out to Wendy Martinez. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psycholog

Re: [R] Genuine relative paths with R

2018-10-11 Thread Michael Friendly
Olivier: Readers of R-Help generally are patient and try to be helpful. Numerous solutions to your initial query were proposed, but for some reason you either reject them or take the discussion down some different rabbit hole of claims about R vs. other software environments, to which kind peo

Re: [R] Strange paradox

2018-10-06 Thread Michael Friendly
usted R-square. Yet the p-value associated with the deviance statistic is highly significant (p=0.0047), suggesting that the confounders (x3 and x4) account for the prediction of the dependent variable. Does anyone have an explanation of this strange paradox? Thank you for any suggestion. Anne

Re: [R] Smallest Space Analysis (SSA) in R

2018-09-23 Thread Michael Friendly
is another: http://whatzcookinlab.blogspot.com/2013/05/spinning-3d-mds-plot.html The vegan and ade4 packages also have a variety of plots and related methods. -Michael Thank you again, and to all of those who responded. Best wishes Andrew On 21/09/18 14:07, Michael Friendly wrote: Smallest

Re: [R] Smallest Space Analysis (SSA) in R

2018-09-21 Thread Michael Friendly
Smallest space analysis (SSA) is just the name given to software developed by Guttman & Lingoes around the time the various versions of multidimensional scaling were being developed. Call it Israeli MDS or Falafel MDS if you prefer. The reason you encountered it in your course is presumably that

Re: [R] Automate running files in R

2018-07-23 Thread Michael Friendly
Hi Serena I'll add one more "in addition" to this list of suggestions. It may not be what you were thinking of, but may be far simpler in the long run. The complexity of your approach comes from having separate data files for each subject and trial, for which you have to have a convention for

Re: [R] TukeyHSD for multiple response

2018-05-26 Thread Michael Friendly
'model.tables' is not implemented for multiple responses So this has to do with the fact that I have a multivariate independent variable. Is there an alternative function to this? Thanks in advance, Sérgio. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychol

Re: [R] Linear regression with tranformed dependant variable

2017-10-24 Thread Michael Friendly
Step back a minute: normality is NOT required for predictors in a multiple regression model, though the sqrt(x) transformation may also make the relationship more nearly linear, and linearity IS assumed when you fit a simple model such as y ~ x + w + z. (Normality is only required for the residu

Re: [R] How long to wait for process?

2017-07-27 Thread Michael Friendly
Rather than go to a penalized GLM, you might be better off investigating the sources of quasi-perfect separation and simplifying the model to avoid or reduce it. In your data set you have several factors with large number of levels, making the data sparse for all their combinations. Like mult

Re: [R] Creating/Reading a complex string in R

2017-07-19 Thread Michael Friendly
It was suggested to quote your string with *backticks* (` ... `) rather than single quotes. String <- ` ... ` On 7/18/2017 1:05 PM, Christofer Bogaso wrote: Thanks for your pointer. Is there any way in R how to replace " ' " with " /' " programmatically? My actual string is quite

Re: [R] label sunflower point

2017-07-17 Thread Michael Friendly
On 7/16/2017 9:36 AM, Nada Gh wrote: Hi, I create a plot using sunflowerplot, I need to highlight one point to show its importance. What suggestion you have to accomplish this? Thanks, In general, the way to answer such a question for yourself is to read the documentation for arguments relat

Re: [R] R and UBUNTU startup

2017-07-04 Thread Michael Friendly
On 7/04/17 11:15 AM, PIKAL Petr wrote: Dear all I have 3 questions. Due to some reason I switched from Vista to Ubuntu on home PC. I was used to start with Rgui.exe. However I am not able to find it under Ubuntu and R starts as terminal (probably Rterm). Question 1. Is Rgui.exe available on l

Re: [R] R package for scorecard development

2017-06-29 Thread Michael Friendly
Hi I'm sure there are valid reasons for wanting to use a scorecard model, but a more straightforward approach would just be a logistic regression or logistic discriminant analysis. Compared to that, a scorecard model can be considered to be throwing away information by binning the predictors.

Re: [R] Help : glm p-values for a factor predictor

2017-06-29 Thread Michael Friendly
On 6/29/17 11:13 AM, Benoît PELE wrote: My question is about the factor predictors with several levels. R provides only the pvalues for each level whereas i need an overall pvalue for testing the predictor. What you ask is provided by anova() -- type I tests, and car::Anova() -- Type II & III

Re: [R] loading edited functions already in saved workspace automatically

2017-05-09 Thread Michael Friendly
ichael On 5/9/2017 10:20 AM, Ralf Goertz wrote: Am Sat, 6 May 2017 11:17:42 -0400 schrieb Michael Friendly : On 5/5/2017 10:23 AM, Ralf Goertz wrote: Am Fri, 05 May 2017 07:14:36 -0700 schrieb Jeff Newmiller : R normally prompts you to save .RData, but it just automatically saves .Rhistory.

Re: [R] loading edited functions already in saved workspace automatically

2017-05-06 Thread Michael Friendly
;),sep=" ") } } .Last <- function() if(interactive() && .Platform$GUI == "Rgui") { histfile <- if (file.exists(".Rhistory")) ".Rhistory" else "c:/R/.Rhistory" try(utils::savehistory(histfile)) } -- Michael

Re: [R] "found 4 marked UTF-8 strings" during check of package... but where !

2017-03-10 Thread Michael Friendly
Try: tools:::showNonASCIIfile(file) On 3/10/2017 5:52 AM, Marc Girondot via R-help wrote: Based on the message, "Note: found 4 marked UTF-8 strings", it seems that "4 marked UTF-8 strings" are present in the package and it is a problem... Is there any solution to know in which file?

Re: [R] testing whether clusters in a PCA plot are significantly different from one another

2017-01-07 Thread Michael Friendly
this, AFAIK. The cluster "group" assignment was also chosen to optimize some (other) criterion. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700

Re: [R] Principle Component Analysis: Ranking Animal Size Based On Combined Metrics

2016-11-13 Thread Michael Friendly
Salvatore, I won't comment on whether to use log weight "to increase the correlation" -- that depends on whether that makes sense, and whether the relationships with other variables is more nearly linear. Try this with your pca of the correlation matrix: biplot(pca_morpho) You'll see that

Re: [R] How to plot predicted probabilities with 95% CIs

2016-10-03 Thread Michael Friendly
Why not use the effects package -- designed for this task. library(effects) plot(allEffects(mfit)) ?plot.eff # for details On 10/3/2016 3:15 AM, Faradj Koliev wrote: Dear all, I need a little help with plotting predicted probabilities (values). Consider the following example ** data(”mtca

Re: [R] R-specific Software Requirement Specification

2016-09-08 Thread Michael Friendly
h\\to\\file\\test.R') > And gives same error -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb:http://www.datavis.ca Toronto

Re: [R] R-specific Software Requirement Specification

2016-09-08 Thread Michael Friendly
You might also or instead look at the roxygen way of doing things, which maps to Rd files, but are much easier to write. In R Studio, Code -> Insert Roxygen skeleton does this for you from an existing function. See: http://r-pkgs.had.co.nz/man.html #' title goes here #' #' description goes he

[R] [R-pkgs] Lahman package v. 5.0.0 released to CRAN

2016-09-07 Thread Michael Friendly
lects some additional analyses and visualizations. -- Team Lahman: Chris Dalzell (maintainer), Michael Friendly (author), Denis Murphy, Martin Monkman, Sean Lahman -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University

[R] [R-pkgs] statquotes package released to CRAN

2016-09-07 Thread Michael Friendly
ps://github.com/friendly/statquotes/. Please report any problems or bugs at https://github.com/friendly/statquotes/issues. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416

Re: [R] Importint stata file and using value labels

2016-08-27 Thread Michael Friendly
native. Hint: use str() to see the class of what you've read. Then try as.data.frame() on the resulting object read from the .dta file. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-

Re: [R] Three way correspondence analyses?

2016-08-04 Thread Michael Friendly
You haven't supplied any data, and we can only guess which cca() function you are using (ade4::cca, ..., vegan::cca(), yacca::cca), and the term 'cca' generally refers to canonical correspondence analysis, which is not quite the same thing as 'three-way correspondence analysis'. For three-way t

Re: [R] dependent p.values in R

2016-07-10 Thread Michael Friendly
Hello Fernando First, ask yourself what Gosta Ekman would have said if you asked him this question. He would have asked "does it make any difference to your conclusion?" He might also have asked you "Did you do a visual test?" Plot your data as a QQ plot or density plot? If the test doesn't

Re: [R] biplot

2016-06-23 Thread Michael Friendly
On 6/22/2016 8:39 AM, Shane Carey wrote: Hey, Does anyone know how to remove labels from a biplot? I want to input them manually as they are currently overlapping. Rather than doing them manually, you might have better luck with ggbiplot, and the ggrepel package designed to 'repel' point lab

Re: [R] inverse table

2016-06-16 Thread Michael Friendly
://stat.ethz.ch/pipermail/r-help/2009-January/378521.html If memory serves, that code has made its way into one or more packages on CRAN but I don't recall which at the moment. Regards, Marc Schwartz -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. &a

[R] [R-pkgs] New versions of heplots, candisc, mvinfluence and matlib on CRAN

2016-06-09 Thread Michael Friendly
ion to draw eigenvectors superimposed on a dataEllipse [MF] matlib 0.7.2 - added argument `error.sphere` to `plot.regvec3d()` [JF] - remove use of `lengths()` in `corner()` to avoid R version dependency -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair

Re: [R] colored table

2016-05-29 Thread Michael Friendly
for (x = -1, y = -1) will be -20. This will be printed with a light color background. And so on. Thanks for your help, Naresh -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66

Re: [R] Change sum of squares type for ANOVA

2016-05-20 Thread Michael Friendly
Use car::Anova() for type II and type III sums of squares and F-tests. The sequential type I tests computed by anova() are rarely sensible On 5/20/2016 3:11 AM, michael.eisenr...@agroscope.admin.ch wrote: Dear R-list members, I compared my statistics with my supervisor yesterday. He is using ST

Re: [R] R simulation help pls

2016-05-11 Thread Michael Friendly
On 4/06/16 11:54 AM, tan sj wrote: Hi, i am student from malaysia, i am new in r programming field, now i am trying to conduct a robustness study on 2 sample test under several combination of factors such as sample sizes ,standard deviation ratio and also distribution.. but now i am stuckin

Re: [R] web scraping tables generated in multiple server pages / Best of R-help

2016-05-11 Thread Michael Friendly
award to Bob Rudis. Not only did he point me to RSelenium, but he wrote a complete solution to the problem, and gave me the generated data on a github link. It was slick, and I learned a lot from it. best, -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psycho

[R] web scraping tables generated in multiple server pages

2016-05-10 Thread Michael Friendly
2,13 267.075,77 3 0,00 624,99 70.212,93 4 0,00 395,64 44.447,18 5 0,00 719,68 41.764,46 6 0,00 446,52 85.152,92 thanks, -- Michael Friendly Email: friendly AT yorku DOT ca Professor,

Re: [R] R-dvel [robustness Simulation study of 2 sample test on several combination of factors ]

2016-04-06 Thread Michael Friendly
On 4/4/2016 9:15 PM, tan sj wrote: hi, i am new in this field. do favorite If I wish to conduct a simulation on the robustness of two sample test by using R language, is that a

Re: [R] Is there dpois equivalent for zero-inflated Poisson?

2016-03-24 Thread Michael Friendly
Neat! It would be nice to complete dzipois() with the corresponding rzipois() and pzipois() functions. I would have found these useful in my new book, http://ddar.datavis.ca -Michael On 3/23/2016 11:27 AM, Martin Maechler wrote: Thierry Onkelinx on Tue, 22 Mar 2016 13:58:09 +0100 write

Re: [R] Best Regression Technique to Use

2016-03-14 Thread Michael Friendly
On 3/13/2016 6:42 PM, Ajay Andrews wrote: I have a set of independent variables that are all BINARY, and my dependent variable is also BINARY. Should I use the logistic regression for this - using the glm function? [[alternative HTML version deleted]] glm(..., family=binomial) will gi

Re: [R] Statistical analysis of olive dataset

2016-03-13 Thread Michael Friendly
On 3/12/2016 12:39 PM, Axel wrote: The main goal of my analysis is to determine which are the fatty acids that characterize the origin of an oil. As a secondary goal, I wolud like to insert the results of the chemical analysis of an oil that I analyzed (I am a Chemistry student) in order to deter

Re: [R] Predicting correlated responses using canonical correlations in multivariate least squares

2016-02-27 Thread Michael Friendly
On 2/27/2016 1:34 PM, Michael Friendly wrote: You might also find that an HE plot (library (heplots)) is illuminating. Follow-up: Try the following with your example library(heplots) hs.mod <- lm(cbind(y1, y2) ~ x1 + x2, data=hs.r) heplot(hs.mod, fill=TRUE) uv.mod <- lm(cbind(u1, u2

Re: [R] Predicting correlated responses using canonical correlations in multivariate least squares

2016-02-27 Thread Michael Friendly
Hi Alex, Thanks for the detailed explanation and the reproducible example. But it is still not clear exactly what you wish to accomplish. You know how to calculate the scores on the canonical variates. These could be considered 'predicted scores', but in canonical space. What's wrong with that?

Re: [R] Specify order of groups negative binomial (glm.nb)

2016-02-26 Thread Michael Friendly
On 2/25/2016 1:53 PM, Katharine Miller - NOAA Federal wrote: The dependent variable is catch per unit effort (CPUE), and the independent variable is the the tributary (Trib_cat). CPUE is derived from the fish counts divided by the effort, so the response is not a count per se, but I think the

Re: [R] How to merge two tables

2016-02-23 Thread Michael Friendly
Hi Xiyan, You don't show your original data, so * If you produced `cross` and `age` tables by summing the counts from a single larger data set, go back to that and do it again. but now include age/ * Otherwise, you can use vcdeExtra::expand.dft()` on both of these data sets to expand to indi

Re: [R] Multivariate multiple linear regression question

2016-02-22 Thread Michael Friendly
Hi Vivendra A few suggestions: * You will get more interpretable tests by using Type II (partial) tests of terms in your model via library(car) Manova(MRI_model) as opposed to the Type I (sequential) tests available from manova() * You will be able to understand the results better by making h

Re: [R] [R-pkgs] New Package: stripless (V. 1.0)

2016-02-03 Thread Michael Friendly
Hi Burt This looks like an interesting package. However, you should know that 'strucplot()' might not be the best choice for your generic, because vcd::strucplot() is now well-established as the general name for functions plotting structured multi-way frequency tables, like mosaic plots and

Re: [R] R-help mailing list activity / R-not-help?

2016-01-24 Thread Michael Friendly
click the "Don't send" or "Save" button and think better of their replies. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100

[R] [R-pkgs] matlib package for linear algebra and multivariate statistics

2015-11-20 Thread Michael Friendly
etc. are invited there. best, -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb:http://www.datav

Re: [R] R wont accept my zero count values in the GLM with quasi_poisson dsitribution

2015-07-28 Thread Michael Friendly
On 7/28/2015 3:05 AM, Göran Broström wrote: On 28/07/15 08:33, Charlotte wrote: Hello I have count values for abundance which follow a pattern of over-dispersal with many zero values. I have read a number of documents which suggest that I don't use data transforming methods but rather than I

Re: [R] calculate adjacent log odds for a table

2015-07-22 Thread Michael Friendly
On 7/21/2015 11:14 AM, Michael Friendly wrote: More generally, for an I x J x K table, where the last factor is the response, my desired result is a data frame of IJ(K-1) rows, with adjacent log odds in a 'logodds' column, and ideally, I'd like to have a general function to do t

[R] calculate adjacent log odds for a table

2015-07-21 Thread Michael Friendly
x K table, where the last factor is the response, my desired result is a data frame of IJ(K-1) rows, with adjacent log odds in a 'logodds' column, and ideally, I'd like to have a general function to do this. Note that if T is the 10 x 3 matrix of frequencies shown by ftable(),

Re: [R] Usage of vcd packages.

2015-06-24 Thread Michael Friendly
On 6/23/15 4:07 PM, My List wrote: All, I am new to the vcd package and new to R too. Welcome to R and glad you found the vcd package. 1) I have a lickert analysis based data set. 2) I am doing a hypothesis tests on the variables ( like, is there a relationship between the choice of a Doctor

Re: [R] Joining two datasets - recursive procedure?

2015-03-18 Thread Michael Friendly
I'm not sure I understand completely what you want to do, but if the data were frequencies, it sounds like task for fitting a loglinear model with the model formula ~ V1*V2 + V3 On 3/18/2015 2:17 AM, Luca Meyer wrote: Hello, I am facing a quite challenging task (at least to me) and I was won

[R] subset a data frame by largest frequencies of factors

2015-03-05 Thread Michael Friendly
1 0 0 0 ... > For analysis, we'd like to subset the data to include only those that occur with frequency greater than a given value, or the top 10 (say) in frequency, or the highest frequency categories accounting for 80% (say) of the total. I'm not sure how to do any of these i

Re: [R] Fitting Legend to Matrix Plot

2015-03-05 Thread Michael Friendly
Why not make the legend fit on one line above or below the plot matrix? ?legend -- look at ncol=, horiz= and xpd= args On 3/4/2015 4:39 PM, Rich Shepard wrote: I have a matrix plot of ternary diagrams (pdf attached) generated with these commands: opar <- par(xpd=NA,no.readonly=T) plot(Wint

Re: [R] How to analyse nonlinear response to categorical and quantitative explanatory variables?

2015-02-20 Thread Michael Friendly
You want to use a generalized linear model of some sort glm(count ~ flow + gravity + group, data=mydata, family=poisson) would be a start, however, the effects of flow rate are nonlinear, so you might use a natural spline term like ns(flow,5) to allow nonlinearity, and there also seem to be in

Re: [R] how to draw paired mosaic plot?

2015-02-08 Thread Michael Friendly
mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept.

[R] poor man's scree plot for SVD: multiline labels and total lines

2015-02-06 Thread Michael Friendly
: atomic 89.4 9.5 1.1 ..- attr(*, "label")= chr "Percents" $ Cum: num 89.4 98.9 100 $ scree : chr " **" " *** " " " - attr(*, "heading")=

Re: [R] simplify code for dummy coding of factors

2014-12-30 Thread Michael Friendly
r, dummy.eye ) # Rich Heiberger, removing intercept, including haireye data haireye.df <- as.data.frame(haireye) haireye.df <- cbind( haireye.df, model.matrix(Freq ~ Hair + Eye, data=haireye, contrasts.arg=list(Hair=diag(4), Eye=diag(4)))[,-1] ) haireye.df -- Michael Friendly

[R] simplify code for dummy coding of factors

2014-12-30 Thread Michael Friendly
0 1 0 0 0 0 1 16 Blond Green 16 0 0 0 1 0 0 0 1 > -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele Street

Re: [R] merge coefficients from a glmlist of models

2014-10-28 Thread Michael Friendly
2:sexMale NA NA NA 28.8975876 Best, John -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Michael Friendly Sent: Tuesday, October 28, 2014 11:47 AM To: R-help Subject: [R] merge coefficients from

[R] merge coefficients from a glmlist of models

2014-10-28 Thread Michael Friendly
ly(age, 2)1 poly(age, 2)2 sexMale 0.7621901 -26.9688970 -30.5626032 -1.0995718 poly(age, 2)1:sexMale poly(age, 2)2:sexMale 22.7210591 28.8975876 The result I want is a data.frame with columns corresponding to the models, and rows corresponding to the unique coefficient names, with NA filled in wh

Re: [R] R Markdown (Rstudio) Limit Results in knit Pdf

2014-10-04 Thread Michael Friendly
nformation Rutgers University Office ANX A - 103 [[alternative HTML version deleted]] -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249

[R] get names of glm and related families from an object

2014-10-04 Thread Michael Friendly
overed that the object$family$family slot doesn't work the same way with glm.nb -- I get, e.g., > nmes.nbin2$family$family [1] "Negative Binomial(1.2354)" and the countreg functions don't return a family component. I think I have to also use class(object), and a more complicate

[R] plots on log="y" scale with smooths

2014-09-17 Thread Michael Friendly
's an attempt at a ggplot2 version, that actually looks more reasonable, but I'm not sure that it is correct: library(ggplot2) ggplot(CPpos, aes(x=length, y=intensity)) + geom_jitter(position=position_jitter(height=.1), alpha=0.25) + scale_y_log10(breaks=c(1,2,5,10,20,50,100

[R] [R-pkgs] Announce: Lahman baseball database archive package, v 3.0

2014-09-15 Thread Michael Friendly
vised. In particular: o HallOfFame$hofID is now HallOfFame$playerID o managerID is now playerID in all tables o Removed from Master: managerID, hofID, holtzID, lahmanID, lahman40ID, lahman45ID, nameNote, nameNick, and college -Michael -- Michael Friendly Email: friendly AT yorku D

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-03 Thread Michael Friendly
oints(as.numeric(names(f)), f, pch=16) abline(h=0) Best, John --- John Fox, Professor McMaster University Hamilton, Ontario, Canada http://socserv.socsci.mcmaster.ca/jfox/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org]

[R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread Michael Friendly
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 9L, 9L, 10L, 11L, 12L, 12L, 16L, 19L) -- Michael Friendly Email: friendly AT

Re: [R] shading cells in a latex table by value

2014-07-23 Thread Michael Friendly
ont weight) according to a function of the cell value is useful in the same way as visual attributes in plots, but, at present, far more difficult. best, -Michael On 07/23/2014 11:31 AM, Duncan Murdoch wrote: On 23/07/2014, 9:31 AM, Michael Friendly wrote: I want to create latex tables of va

[R] shading cells in a latex table by value

2014-07-23 Thread Michael Friendly
ueB} & \cell{-0.9}{redB} \\ b & \cell{0.6}{blueB} & \cell{1.0}{blueB} & \cell{2.2}{blueA} & \cell{4.5}{blueA} \\ c \cell{-2.5}{redA} & \cell{-2.5}{redB} & \cell{1.7}{blueB} & \cell{1.2}{blueB} \\ \end{tabular} \end{document} # --

Re: [R] canonical correlation

2014-07-14 Thread Michael Friendly
Perhaps what you are looking for is the visualization methods for canonical correlation provided in the candisc package. see ?candisc::cancor ?heplot.cancor -Michael On 13/07/2014 4:39 PM, Monaly Mistry wrote: Dear John, In my final model I have 10 independent variables that account for the

Re: [R] Cansisc: Error in eigen(eHe, symmetric = TRUE)

2014-07-10 Thread Michael Friendly
repente lo sabrás y la meditación te seguirá. Si amas el trabajo > que haces, > > si amas la manera como vives, entonces ya estás meditando y nada > puede > > distraerte." Osho > > > > [[alternative HTML version deleted]] > >

Re: [R] Package 'effects' plotting allEffects question

2014-06-07 Thread Michael Friendly
, which is useless. -- View this message in context: http://r.789695.n4.nabble.com/Package-effects-plotting-allEffects-question-tp4691817.html Sent from the R help mailing list archive at Nabble.com. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair

Re: [R] \ escape sequence and windows path

2014-05-21 Thread Michael Friendly
the possibility to use f.e path="C:\foo1\foo2\" I can import those paths with path = readline() but not directly in a script Regards Knut -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice

Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-17 Thread Michael Friendly
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Michael Friendly Verz

[R] ggplot2: using coord_trans for logit -> probability

2014-04-16 Thread Michael Friendly
t;: # doing it manually pred2 <- within(pred, { prob <- plogis(fit) lower <- plogis(fit - 1.96 * se.fit) upper <- plogis(fit + 1.96 * se.fit) }) gg2 <- ggplot(pred2, aes(x=Age, y=prob)) + geom_line(size = 2) + theme_bw() + g

Re: [R] The explanation of ns() with df =2

2014-04-15 Thread Michael Friendly
tr(,"knots") 50% 8 attr(,"Boundary.knots") [1] 1 15 attr(,"intercept") [1] FALSE attr(,"class") [1] "ns" "basis" "matrix" -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chai

Re: [R] adding a frequency variable to a data frame

2014-04-11 Thread Michael Friendly
Bingo! That's exactly the idiom I was looking for. Thanks, Andrija. -Michael On 4/11/2014 4:57 PM, Andrija Djurovic wrote: another: ave(as.numeric(Donner$family), Donner$family, FUN=length) -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. &a

[R] adding a frequency variable to a data frame

2014-04-11 Thread Michael Friendly
914 4 410 4 312 Other Reed 23 7 > Here, I want to create a new variable, family.size, where all the Breens have 9, the Donners, 14, and so on... -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psych

Re: [R] Sweave files into LaTex

2014-04-05 Thread Michael Friendly
ata(diamonds) head(diamonds) @ 2) Then, in the master.tex file add the following line: \include{Rcode.Rnw} But of course, that didn't work.Any help would be much appreciated. Best, Axel. [[alternative HTML version deleted]] -- Michael Friendly Email: friendly AT yorku D

Re: [R] ggplot: add points selectively to curves

2014-04-02 Thread Michael Friendly
geom_line(size=2.5) + theme_bw() + xlim(10,80) + geom_point(color="black", size=1.5) + facet_grid(Sex ~ Treatment, labeller = function(x, y) sprintf("%s = %s", x, y) ) Dennis On Wed, Apr 2, 2014 at 7:43 AM, Michael Friendly wrote: I'

[R] ggplot: add points selectively to curves

2014-04-02 Thread Michael Friendly
ad, I want to plot only one point for each case, for the value of Level that corresponds to the value of Improved in this data set. Somehow, this involves something like an aes() argument to geom_point(), with Level indexed by Improved, or some such. How can I do this? -- Michael Friendly Ema

[R] bi-monthly time series

2014-02-20 Thread Michael Friendly
ns, they would be something like names(vect) <- seq(as.Date('2005/01/01'),as.Date('2013/01/01'),by=14) but that's awkward to work with. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York Unive

Re: [R] association of multiple variables

2014-02-19 Thread Michael Friendly
ulate association statistics over more than 2 categorical (binary) variables? I mean something similar what cor(my.dataframe) does for continuous variables, i.e. to have a matrix of statistics and/or p-values as an output. Many thanks! Zdenek - - Zdenlk Skala INCOMA GfK [[alternative

Re: [R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Michael Friendly
n(x) loglm(Freq ~ memory + attitude, data=x) )) -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavis.ca

[R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Michael Friendly
mod.8 <- loglm(Freq ~ memory + attitude, subset=age=="25-39" & education=="high", data=Punishment) > mod.9 <- loglm(Freq ~ memory + attitude, subset=age=="40-" & education=="high", data=Punishment) > > mod.list <- list(mod.1, mod.2,mod.3, mod.4, mod.5, mod.6, m

[R] parallel coordinate plot showing density of curves

2014-02-03 Thread Michael Friendly
iris[1:4], iris, groups = Species, varnames = vnames, horizontal.axis = FALSE, lwd=8, col=c(rgb(1,0,0,.2), rgb(0,0,1,.2), rgb(0,205/255,0,.2) ) ) -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York Un

[R] keep track of variables created in each chapter of a knitr book

2014-01-24 Thread Michael Friendly
arn.conflicts = FALSE) @ content ... <>= remove(list=objects(pattern="array|mat|my|\\.tab|\\.df")) remove(list=c("A", "B", "age", "count", "ds", "n", "passed", "sex", "tab", &qu

Re: [R] recoding table dimensions interactively

2014-01-09 Thread Michael Friendly
2 1 0:6 0 0 0 0 0 1 0:8 0 0 0 0 0 1 1:1 3 0 0 0 4 0 1:2 0 2 0 0 2 1 1:3 0 0 0 0 0 0 1:4 0 2 0 0 0 0 1:6 0 0 0 0 0 0 1:8 0 0 0 0 0 0 Bill Dunlap Spotfire, TIBCO

[R] recoding table dimensions interactively

2014-01-09 Thread Michael Friendly
UCB.tab2 > UCB.tab2 Dept Admit:GenderA B C D E F Admitted:Female 89 17 202 131 94 24 Admitted:Male 512 353 120 138 53 22 Rejected:Female 19 8 391 244 299 317 Rejected:Male 313 207 205 279 138 351 > But maybe there is a simpler, more

Re: [R] p value of trends for odds ratios (or hazard ratios)

2014-01-05 Thread Michael Friendly
eathlessness and Wheeze in Coal Miners") age <- seq(25, 60, by = 5) mod <- lm(lodds ~ poly(age,2)) lines(fitted(mod), col = "red", lwd=2) Tests of the coefficients in mod give the tests of linear and quadratic changes in the odds ratio with age. -- Michael Friendly Email: f

[R] robust definition of \code{} for a knitr-produced document

2014-01-03 Thread Michael Friendly
A + B)^2|; url: \url{y ~ (A + B)^2} \item Underscored names-- code: \code{str_length()}; verb: \verb|str_length()|; url: \url{str_length()} \item \$ names-- code: \code{Arthritis$sex}; verb: \verb|Arthritis$sex|; url: \url{Arthritis$sex} \end{itemize} \end{document} --- end c

[R] format a matrix as fractions?

2013-12-31 Thread Michael Friendly
.333 0.167 0.111 > should print as 1 1/2 1/3 1/21/4 1/6 1/31/6 1/9 TIA -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x662

Re: [R] Categorial data analysis

2013-12-26 Thread Michael Friendly
-- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavis.ca Toronto, ONT M3J 1P3 CA

  1   2   3   4   5   >