[R] Extracting the dispersion parameter
I have been unsuccessful in extracting the dispersion parameter in SPLUS 6.1 using summary or summary.glm(modelobj$dispersion) from a glm object in which the family was set to quasi. This is the syntax given in the manual. I want to write a script to bootstrap the estimate of the dispersion parameter, but cannot seem to access that value. Any suggestions? Thanks, Ed -- Edward F. ConnorOffice Phone415-338-6997 Department of Biology Lab Phone 415-338-3873 San Francisco State University Fax 415-405-0306 1600 Holloway Avenueemail: [EMAIL PROTECTED] San Francisco, CA 94132 web: http://userwww.sfsu.edu/~efc -- [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Extracting the dispersion parameter
"Edward F. Connor" wrote: > > I have been unsuccessful in extracting the dispersion parameter in SPLUS > 6.1 using > > summary or summary.glm(modelobj$dispersion) > > from a glm object in which the family was set to quasi. This is the syntax > given in the manual. I want to write a script to bootstrap the estimate of > the dispersion parameter, but cannot seem to access that value. > > Any suggestions? summary() calculates it, hence it's part of the summary object: summary(modelobj)$dispersion Uwe Ligges > Thanks, > > Ed > > -- > > Edward F. ConnorOffice Phone415-338-6997 > Department of Biology Lab Phone 415-338-3873 > San Francisco State University Fax 415-405-0306 > 1600 Holloway Avenueemail: [EMAIL PROTECTED] > San Francisco, CA 94132 web: http://userwww.sfsu.edu/~efc > > -- > > [[alternate HTML version deleted]] > > __ > [EMAIL PROTECTED] mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Extracting the dispersion parameter
On Sun, 23 Feb 2003, Edward F. Connor wrote: > I have been unsuccessful in extracting the dispersion parameter in SPLUS > 6.1 using > > summary or summary.glm(modelobj$dispersion) > > from a glm object in which the family was set to quasi. This is the syntax > given in the manual. What is `the manual'? If this is an accurate transcription then `the manual' is incorrect. > I want to write a script to bootstrap the estimate of > the dispersion parameter, but cannot seem to access that value. > > Any suggestions? Ask on S-news about S-PLUS questions! You may have meant summary(glmobject)$dispersion but as glm is one area where S-PLUS and R differ considerably it does help to ask in the correct forum. -- Brian D. Ripley, [EMAIL PROTECTED] 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 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] expression for simple EM
Dear R users, I know this is the wrong forum for such a question but I need help. I would like to write down the likelihood expression for a simple EM problem. I have one categorical covariate with 5 levels and a missing count which can fall in any of the categories. I know the solution to the problem but can't seem to get the likelihood expression correct (if it is possible). Thanks. Vumani Dlamini, Student Faculty of Health Sciences University of Natal __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] A Guide for the Unwilling S User
"A Guide for the Unwilling S User" is available at http://www.burns-stat.com/pages/Tutor/unwilling_S.pdf (Or click on Tutorials from the main web page.) This is an improved version of the document that was put in the same location a few days ago. It has dropped the "draft" status, but I am always interested in suggestions for improvements. The 8 page document has the aim of allowing a novice user to get some useful work done fast enough that they don't give up. This could be a student with an assignment, a worker with a graph to produce before they go home, or a prospective user of some specific S functionality. It applies equally to S-PLUS and R. It may be redistributed as long as there is no more than a nominal charge for the media. Patrick Burns Burns Statistics [EMAIL PROTECTED] +44 (0) 208 525 0696 http://www.burns-stat.com/(new home of S Poetry) __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Subpopulations in Complex Surveys
On Wed, 19 Feb 2003 [EMAIL PROTECTED] wrote: > Hi, > is there a way to analyze subpopulations (e.g. women over 50, those who > answered "yes" to a particular question) in a survey using Survey package? > Other packages (e.g. Stata, SUDAAN) do this with a subpopulation option to > identify the subpopulation for which the analysis shoud be done. I did not > see this option in the Survey package. Is there another way to do this? > Not directly. This only really matters for svymean. For the regression models it's just a convenience as you can specify a model that has an interaction with the subpopulation indicator to get estimates and standard errors in the subpopulation. For svymean you can use a regression model too: Instead of a hypothetical svymean(~x, design=d, subpop=race==2) do svyglm(x~I(race==2)+0, design=d) I need to work out if there's a general way to handle subpopulations or whether it needs to be coded on a case by case basis. -thomas __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] grid.grill?
Hi M.Kondrin wrote: Why this command does not return grob? What is special about grill and what makes it different from axis, lines, rectangles... Most of the predefined grid drawing functions do two things: draw something and create and (invisibly) return a grob (graphical object). This means that they can be used in several different ways: "procedurally" just for their side effect (drawing something); or "functionally" for the object they produce (e.g., to use in the placement or sizing of another object); or both (e.g., to have a record of what has been drawn that can be uniquely identified and edited). The default behaviour is "both" so that grid functions appear to work like their standard graphics counterparts (i.e., they just draw something). Functions that call the grid drawing functions can choose to just draw something, or they can choose to use the graphical objects from the grid functions to produce a graphical object of their own. Ideally, a new function will do the latter so that functions that want to call it also have a choice. But it is easier to write a function that just does drawing. grid.grill is an example of a function that just does drawing. It's a convenience function that was easy to write. It should be rewritten to produce a graphical object at some stage -- perhaps a good exercise for someone learning grid? :) Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] 4-parameter logistic model
Christian - I acknowledge Prof. Bates' answer and his superior knowledge. But for the first equation you have typed below, theta1 is clearly the asymptote as x goes to minus infinity, and theta2 is the asymptote as x goes to plus infinity. The equation you have typed and the excerpt you have quoted from the book clearly disagree. I don't know anything about the function SSfpl(), inparticular whether it agrees with the book or not. - tom blackwell - u michigan medical school - ann arbor - On Fri, 21 Feb 2003, Christian Mora wrote: > Dear R users > > I'm a new user of R and I have a basic question about the 4-parameter > logistic model. According to the information from Pinheiro & Bates the model > is: > > y(x)=theta1+(theta2-theta1)/(1+exp((theta3-x)/theta4)) == > y(x)=A+(B-A)/(1+exp((xmid-input)/scal)) > > from the graph in page 518 of the book of the same authors (mixed models in > S) theta 1 corresponds to the horizontal asymptote as x goes to infinity and > theta2 the horizontal asymptote as x goes to -infinity. When I use the > function SSfpl(input,A,B,xmid,scal), I'm not sure why the value of A is the > lower of the two asymptotes if according to the original function A should > be equal to theta1 (upper asymptote).. or maybe I'm wrong. > > I'll appreciate any comment on this. > > Best Regards > > CM > > __ > [EMAIL PROTECTED] mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help > __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Subpopulations in Complex Surveys
In a message dated 2/23/03 1:19:39 PM Eastern Standard Time, [EMAIL PROTECTED] writes: > On Wed, 19 Feb 2003 [EMAIL PROTECTED] wrote: > > > Hi, > > is there a way to analyze subpopulations (e.g. women over 50, those who > > answered "yes" to a particular question) in a survey using Survey > package? > > Other packages (e.g. Stata, SUDAAN) do this with a subpopulation option > to > > identify the subpopulation for which the analysis shoud be done. I did > not > > see this option in the Survey package. Is there another way to do this? > > > > Not directly. > > This only really matters for svymean. For the regression models it's just > a convenience as you can specify a model that has an interaction with the > subpopulation indicator to get estimates and standard errors in the > subpopulation. > > For svymean you can use a regression model too: > Instead of a hypothetical svymean(~x, design=d, subpop=race==2) do >svyglm(x~I(race==2)+0, design=d) > > I need to work out if there's a general way to handle subpopulations or > whether it needs to be coded on a case by case basis. > > > -thomas > Thanks a lot for the answer. Is there a way to get quantiles and cross-tabulations in subpopulations? If I think of proportion as mean of binary indicator (y: "got milk?"=1), can I use the solution above for proportions in subpopulations? svyglm(y~I(race==2)+0, design=d) If I create a binary indicator for a subpopulation (men over 50), can I use it with svytable? svytable( ~y+z,design=d) --anupam. * Prediction is very difficult, especially about the future. -- Niels Bohr * [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] time series outbreak detection
Dear all, i have multivariate timeseries (weekly data). 1)"Moving standard deviation" With the "filter function" together with "lag" from package ts it is possible to calculate a moving average for the time series for each week at once (6 weeks back from the actual week and 12 weeks from the last two years). But i also need the associated standard deviations. Is there a function for this? 2)"Robust Regression" The time series derives from reported cases due to different pathogens. Some of them with saisonal pattern. There are huge differences in counts (depending on the pathogen) from zero up to several hundred counts per week. I have only data since 2001. I want to realize outbreak detection algorithms (so far, depending on the pathogen with Standard Deviation / Poisson and CUSUM). Beforehand i have to "clean" the data from past outbreaks. Has anybody experience with a rather robust regression model which cuts former "outliers"? Thank you very much for advice. Johannes Schnitzler Germany Berlin [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] trellis.datasets help
I've looked every way I can think of for help on trellis.datasets, but nothing comes up for me. Please help me find information on what is included, and how to get at those data. Thanks. Dave Parkhurst __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] trellis.datasets help
In a message dated 2/23/03 7:19:07 PM Eastern Standard Time, [EMAIL PROTECTED] writes: > I've looked every way I can think of for help on trellis.datasets, but > nothing comes > up for me. Please help me find information on what is included, and how to > get at > those data. Thanks. > > Dave Parkhurst Look at William Cleveland's web page: http://cm.bell-labs.com/cm/ms/departments/sia/wsc/index.html And at the Trellis homepage (see last sentence there): http://cm.bell-labs.com/cm/ms/departments/sia/project/trellis/software.example s.html Hope that helps. * Prediction is very difficult, especially about the future. -- Niels Bohr * [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] trellis.datasets help (lattice ?)
Are you talking about lattice ? If so, help(singer) brings up the following: trellis.datasets package:lattice R Documentation Data Sets in the Lattice library Description: These data sets are included to facilitate the same examples as S-Plus trellis. (Detailed descriptions of the datasets are omitted for now.) Usage: data(singer) data(melanoma) data(ethanol) data(sunspot) data(environmental) Source: These datasets are part of the collection of datasets used in the book Visualizing Data by Bill Cleveland, and are available at Bill Cleveland's Homepage http://cm.bell-labs.com/cm/ms/departments/sia/wsc/index.html> as well as in Statlib. -- which should point you to Bill Cleveland's website and book. On Sunday 23 February 2003 06:15 pm, David Parkhurst wrote: > I've looked every way I can think of for help on trellis.datasets, but > nothing comes up for me. Please help me find information on what is > included, and how to get at those data. Thanks. > > Dave Parkhurst > > __ > [EMAIL PROTECTED] mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] fill prob. in legend
Hi, I'm trying to construct a legend which has four lines of text and associated symbols. The first two symbols need to be normal lines which vary only in colour. The second two symbols should have filled boxes. How do I suppress the fill boxes in the first two lines? J. __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Mass: lda and collinear variables
hello list, when I use method lda of the MASS package I experience a warning: variables are collinear in: lda.default(data[train, ], classes[train]) Is there an easy way to recover from this issue within the MASS package? Or how can I tell how severe this issue is at all? I understand that I shouldn't use lda at all with collinear data and should use "quadratische" (squared?) discr. analysis (by Welch) instead. Or is this wrong? Could I do this in R? Thanks four your help, Till Baumgärtel Abos online bestellen. Oder Leser werben und Prämie aussuchen. http://www.epost.de/aboservice __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Subpopulations in Complex Surveys
I'm not familiar with the survey systems, any array or data.frame can be subsetted using a logical vector. For example, let Data = data.frame(sex = ..., age =, ..., ...). Then, Sel.fem50 <- (Data$sex=="Female") & (Data$age> 50) fem50Answers <- FUN(... data=Data[Sel.fem50,]) If you want to do this to many subgoups, consider "split", "by", "lapply", "sapply", "tapply", "aggregate", etc. See Venables and Ripley, Modern Applied Statistics with S, 4th ed. Hope this helps. Spencer Graves [EMAIL PROTECTED] wrote: In a message dated 2/23/03 1:19:39 PM Eastern Standard Time, [EMAIL PROTECTED] writes: On Wed, 19 Feb 2003 [EMAIL PROTECTED] wrote: Hi, is there a way to analyze subpopulations (e.g. women over 50, those who answered "yes" to a particular question) in a survey using Survey package? Other packages (e.g. Stata, SUDAAN) do this with a subpopulation option to identify the subpopulation for which the analysis shoud be done. I did not see this option in the Survey package. Is there another way to do this? Not directly. This only really matters for svymean. For the regression models it's just a convenience as you can specify a model that has an interaction with the subpopulation indicator to get estimates and standard errors in the subpopulation. For svymean you can use a regression model too: Instead of a hypothetical svymean(~x, design=d, subpop=race==2) do svyglm(x~I(race==2)+0, design=d) I need to work out if there's a general way to handle subpopulations or whether it needs to be coded on a case by case basis. -thomas Thanks a lot for the answer. Is there a way to get quantiles and cross-tabulations in subpopulations? If I think of proportion as mean of binary indicator (y: "got milk?"=1), can I use the solution above for proportions in subpopulations? svyglm(y~I(race==2)+0, design=d) If I create a binary indicator for a subpopulation (men over 50), can I use it with svytable? svytable( ~y+z,design=d) --anupam. * Prediction is very difficult, especially about the future. -- Niels Bohr * [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] faraway tutorial: cryptic command to newbie
c = concatenate / combine Try help(c) or under the 'Vector and Assignments' section of An Introduction to R. You have to put the folder 'faraway' into c:/.../R/rw1061/library/ where ... is your path to R and rw1061 could be rw1062 ect depending on your version. -Original Message- From: Christoph Lehmann [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 12:49 AM To: [EMAIL PROTECTED] Subject: [R] faraway tutorial: cryptic command to newbie I am just about working through Faraways excellent tutorial "practical regression and ANOVA using R" on page 24 he makes the x matrix: x <- cbind(1,gala[,-c(1,2)]) how can I understand this gala[,-c(1,2)])... I couldn't find an explanation of such "c-like" abbreviations anywhere. thanks for a hint. another problem: I couldn't load the faraway library, using the library() command, even though I specified the path, .. do I need to put library files into a certain directory? I always got an error: Error in library(faraway) : There is no package called `faraway' Thanks a lot christoph -- Christoph Lehmann Department of Psychiatric Neurophysiology University Hospital of Clinical Psychiatry Waldau CH-3000 Bern 60 Switzerland Phone: ++41 31 930 93 83 Mobile: ++41 31 570 28 00 Fax:++41 31 930 99 61 Email: [EMAIL PROTECTED] Web:http://www.puk.unibe.ch/cl/pn_ni_cv_cl.html __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] Mass: lda and collinear variables
What is the dimension of your data. i.e. how many observations and how many variables do you have? -Original Message- From: Till Baumgaertel [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 9:41 AM To: [EMAIL PROTECTED] Subject: [R] Mass: lda and collinear variables hello list, when I use method lda of the MASS package I experience a warning: variables are collinear in: lda.default(data[train, ], classes[train]) Is there an easy way to recover from this issue within the MASS package? Or how can I tell how severe this issue is at all? I understand that I shouldn't use lda at all with collinear data and should use "quadratische" (squared?) discr. analysis (by Welch) instead. Or is this wrong? Could I do this in R? Thanks four your help, Till Baumgärtel Abos online bestellen. Oder Leser werben und Prämie aussuchen. http://www.epost.de/aboservice __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help