3 general questions: 1) How can I have the plot History Recording automatically turned on each time I start R (Windows)? 2) How can I have some libraries automatically loaded at R start? 3) As far as I know weights can be specified only for lm. How can I take account of weights with a weighted sample in other models or functions (table but also other multivariate and cluster techniques)? Thanks --------------- Charles RAUX, Laboratoire d'Economie des Transports CNRS-Universit? Lumi?re Lyon 2-ENTPE email : charles.raux at let.ish-lyon.cnrs.fr http://www.ish-lyon.cnrs.fr/let -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 Mon, 4 Sep 2000, Charles Raux wrote:> 3 general questions: > 1) How can I have the plot History Recording automatically turned on > each time I start R (Windows)?You can't. We'll treat that as an enhancement request. It's actually a per-device switch, so it could be part of the windows() function arguments.> 2) How can I have some libraries automatically loaded at R start?Use .Rprofile. See ?Startup> 3) As far as I know weights can be specified only for lm. How can I > take account of weights with a weighted sample in other models or > functions (table but also other multivariate and cluster techniques)?It can be specified for lots of modelling functions. Beware though, that what `weights' means needs careful definition, and Stata (I believe) manages to have four kinds of weights. In regression weights=4 could mean `I have four of these cases' or `give this case weight 4 in weighted LS', for example. Fortunately in regression it rarely matters, but it can do in other settings. -- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 4 Sep 2000, Charles Raux wrote:> 3 general questions: > 1) How can I have the plot History Recording automatically turned on > each time I start R (Windows)? > 2) How can I have some libraries automatically loaded at R start?The .Rprofile file is executed at start-up. Load the packages there. It's described in the Windows readme file.> 3) As far as I know weights can be specified only for lm. How can I > take account of weights with a weighted sample in other models or > functions (table but also other multivariate and cluster techniques)?Some other functions have weights (eg glm, some survival functions). Most don't. Also, most of the functions that have weights have frequency weights rather than probability weights: that is, setting a weight equal to 2 has exactly the same effect as replicating the observation. We don't have (and IMO do need) facilities for probability weights, where a weight of 2 means that sampling probability for that unit was half the probability for a unit with weight 1. If you have frequency weights you may have to expand your dataset. expanded.data<-as.data.frame(lapply(compressed.data, function(x) rep(x,compressed.data$weights))) should do it. -thomas Thomas Lumley Assistant Professor, Biostatistics University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._