Re: [R] Maximum likelihood estimate ofbivariatevonmises-weibulldistribut
r-help@stat.math.ethz.ch on Saturday, May 13, 2006 at 6:00 AM -0500 wrote: One of my friends recently wrote his PhD thesis from University of Leeds under Kanti Mardia's direction. I bet your friend was really angling for that. -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R-help Digest, Vol 39, Issue 13
r-help@stat.math.ethz.ch on Saturday, May 13, 2006 at 6:00 AM -0500 wrote: lme(biomass~age, random=~woods/age)? Jörn Consult Pinheiro and Bates (2000, Mixed-effects models in S and S-Plus, Springer, ISBN 0-387-98957-0 ref 7 at http://www.r-project.org/doc/bib/R-books.html ) for how to fit more elaborate models, but two straightforward ones that might be adequate are lme( biomass~age, random=~1|woods ) and lme( biomass~age, random=~age|woods ) In the lme4 library corresponding syntax is lmer( biomass~age+(1|woods) ) and lmer( biomass~age+(age|woods) ) For vignettes on the lme4 library see the mlmRev library and @ARTICLE{Rnews:Bates:2005, AUTHOR = {Douglas Bates}, TITLE = {Fitting Linear Mixed Models in {R}}, JOURNAL = {R News}, YEAR = 2005, VOLUME = 5, NUMBER = 1, PAGES = {27--30}, MONTH = {May}, URL = {[ http://CRAN.R-project.org/doc/Rnews/ ]http://CRAN.R-project.org/doc/Rnews/} } alan -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] monochrome mosaic plot in vcd package
Michael, How about using grayscale shading and setting the background color (the gaps between the tiles) to middle gray? -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception r-help@stat.math.ethz.ch on Saturday, January 28, 2006 at 6:00 AM -0500 wrote: Content-Type: message/rfc822 MIME-Version: 1.0 From: Mike Townsley [EMAIL PROTECTED] Precedence: list MIME-Version: 1.0 To: r-help@stat.math.ethz.ch Date: Fri, 27 Jan 2006 11:28:10 + Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii; format=flowed Subject: [R] monochrome mosaic plot in vcd package Message: 5 helpeRs, I have a nice looking mosaic plot in an article to be published soon. Sadly, the published version will be in black and white and so ruin the advantage of the default shading scheme of tiles. What would readers suggest as an alternative shading scheme? If I have a black-and-white shading scheme graduated according to suitable cutoffs I won't be able to tell positive from negative residuals. The tile borders can be changed of course, but I'm uncertain that is will be clear enough for a reader. Another option may be to use a fill pattern of sloping lines with different orientations for the sign and density for the magnitude. The problem with this option is I wouldn't know where to start to incorporate into a legend. The shading_binary function is no good as I would like the cells with residuals less than absolute 2 to be different from other cells. How would readers of this list represent a mosaic plot so that it was easily interpretable in monochrome? My data can be used as an example: library(vcd) library(MASS) term.1 - gl(2,1,8, labels = LETTERS[1:2]) term.2 - gl(2,2,8, labels = LETTERS[3:4]) term.3 - gl(2,4,8, labels = LETTERS[5:6]) cell.count - c(72, 19, 5, 8, 117, 115, 81, 85) mosaic(loglm(formula = cell.count ~ term.1 + term.2 + term.3), shade = TRUE, gp = shading_hcl, legend = TRUE, labeling_args = list(rot_labels = rep(0,4)), gp_args = list(lty = 1:2),legend_width = unit(0.2, npc)) Dr Michael Townsley Senior Research Fellow Jill Dando Institute of Crime Science University College London Second Floor, Brook House London, WC1E 7HN Phone: 020 7679 0820 Fax: 020 7679 0828 Email: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R-help Digest, Vol 32, Issue 26
r-help@stat.math.ethz.ch on Wednesday, October 26, 2005 at 6:00 AM -0500 wrote: Ronaldo, Try Harold's suggestion. The df still won't agree, because lmer (at least in its current version) just puts an upper bound on the df. But that should be OK, because all those t tests are approximations anyways, and you can get better confidence intervals (credible intervals, whatever) by using the mcmcsamp() function that works with lmer() alan Doran, Harold [EMAIL PROTECTED] responded: There is an issue with implicit nesting in lmer. In your lme() model you nest block/irrigation/density/fertilizer. In lmer you need to do something like (I dind't include all of your variables, but I think the makes the point) lmer(yield~irrigation*density*fertilizer+(1|fertilizer:density)+(1|density), data) Which notes that fertilizer is nested in density. Try this and then compare the results. Ronaldo Reis-Jr. [EMAIL PROTECTED], wrote: I make the correct model with aov, lme do compare with lmer. But I cant make a correct model in lmer. Look that the aov and lme results are similars, but very different from lmer. In aov and lme is used the correct DF for each variable, in lmer it use a same DF for all? Denom=54. -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Any package to perform HLM (PROC GENMOD) like logistic
I think you're looking for lmer( ... family=binomial ) in package lme4 by Bates Sarkar. William M. Grove [EMAIL PROTECTED] wrote: I know there are very nice facilities in Pinhiero and Bates for doing HLM-type modeling for continuous dependent variables. But I would like to be able to do repeated measures logistic regression, or LR on clustered observations alan -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anova on binomial LMER objects
On Wed, 28 Sep 2005, Robert Bagchi wrote: Hi Patrick thanks for your advice. I have now tried glmmPQL, and it worked fine - I'm getting consistent results between plots and models fitted by glmmPQL. Plus it allows predict() and resid() which is another advantage over lmer at present. quick question though: why does one need to use PQL for binomial models? Is there a good reference for this? You don't have to use PQL for binomial models, but you can't use least-squares. PQL is an approximate solution. Laplace and Adaptive Gaussian Quadrature options in lmer are better approximations. So lmer would likely become the better option as it progresses in its development (though the current issues you've found with the F ratios certainly sound like maybe lmer isn't better for you in its current incarnation). alan -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Re: R-help Digest, Vol 16, Issue 11
[EMAIL PROTECTED] writes: I make a study in health econometrics and have a categorical dependent variable (take value 1-5). I would like to fit an ordered probit or ordered logit but i didn't find a command or package who make that. Does anyone know if it's exists ? Try polr() from the MASS package (part of the standard install, also available from r-project.org) Or try vglm() from Thomas Yee's VGAM package (in beta, available from Yee's web page, which you can find by googling Yee and VGAM) -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Re: Use of the Foreign package to import Stata files
Regarding an old version of foreign allegedly being able to read the file at http://www.ats.ucla.edu/stat/stata/examples/rwg/concord1.dta Thomas Lumley [EMAIL PROTECTED] responded to my call for help: I don't know why it used to work. The file begins with 'h' (0x68), which isn't in my list of valid Stata file types. On the other hand, Stata has no problem with it. It's possible that it is a version 4 file (which would make sense, since version 5 file start with 'i' and increase from there) but that wouldn't explain why it used to work. With the stataread package (which predates 0.5-x of foreign) I get Not a Stata version 5-7 data file. Thomas Lumley [EMAIL PROTECTED] continued: I just found an old 1.6.2 (Mac OS/Darwin) lying around and it doesn't recognize the file as a stata file (with foreign 0.5-8) Thomas, My apologies. It turns out that using R 1.6.2 and an old foreign library, I *can't* read the concord1.dta file at that url, though I *can* read a concord1.dta file that I'd downloaded several months ago. So either the archive at www.ats.ucla.edu overwrote good files with bad, or maybe their site doesn't match an alternate source for the same data files. Either way, I'm sorry to have sent you on a wild goose chase. The error was not in your package. Thank you for your prompt replies. alan -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Re: Use of the Foreign package to import Stata files
Long ago (Sat, 2 Nov 2002), Bill Hart [EMAIL PROTECTED] wrote: An R newbie here. I am using R 1.6 currently and have (successfully, I think) installed the Foreign package. Tried to import a data file created with Stata 7.0 SE. Had minor problems with syntax then R decided that my file was not really a Stata file. It rejected the file saying 'Not created by Stata 5-7/SE'. Any suggestions on how to convince R that this is really, truly a Stata file? Thomas Lumley ([EMAIL PROTECTED]) responded: You need the version of read.dta that I wrote yesterday after finally obtaining some 7/SE datasets for debugging. If you can compile packages then I can send you the code, otherwise you will have to wait for the next version of the foreign package. But sometimes older works better than newer. The read.dta() function in R 1.7.0's foreign package (package 0.6-3) fails to recognize as a Stata file what seems to be a genuine Stata file, even though R 1.6.2's foreign package (package 0.5-9) imports the same file just work fine. Using R 1.7 and rolling the package back to foreign 0.5 doesn't seem to fix the problem (haven't been able to roll R1.7 all the way back to foreign 0.5-9 yet, just to a newer 0.5 whose binary is still posted on cran). An example of such a Stata file it at http://www.ats.ucla.edu/stat/stata/examples/rwg/concord1.dta Does anyone have a hint or fix? alan -- Alan B. Cobo-Lewis, Ph.D. (207) 581-3840 tel Department of Psychology(207) 581-6128 fax University of Maine Orono, ME 04469-5742[EMAIL PROTECTED] http://www.umaine.edu/visualperception __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help