Displaying 20 results from an estimated 10000 matches similar to: "add a point to regression line and cook's distance"
2003 Mar 19
3
r-help using random generating
To whom it may concern:
Given that my sample size is n, my mean is 100, and my sd is 10, I need to
use a random number generator (which I believe is the function
rnorm(5,100,10)), but I need to repeat it a large number of times, and then
plot the sampling distributions of the sample means, sd's, and variances of
those generated sets. I'm having a real hard time trying to figure out how
2003 Apr 28
4
how to present a table in powerpoint?
Hi,
I have a nicely printed table of results generated by R's
> print(myresult)
where myresult is a "data frame".
I am trying to put this table into a powerpoint slide for presentation without re-typing and re-formating, i.e.,
present it as it is in the R window. This saves time when there are a lot of tables to be presented.
I tried
> sink("myresult.txt")
>
1999 Dec 01
3
Installing R on Slackware Linux
I mostly use Windows, but I am slowly learning to use Linux on my second
machine. (It came in handy a couple of weeks ago when I had two files to
sort, each of length about 2 million. Windows sort died after an hour, but
the Linux sorts took 2-3 minutes each.)
Anyway the last time I tried installing R in Linux I found out from a
helpful computer support person that with my distribution
2006 Oct 24
1
Cook's Distance in GLM (PR#9316)
Hi Community,
I'm trying to reconcile Cook's Distances computed in glm. The
following snippet of code shows that the Cook's Distances contours on
the plot of Residuals v Leverage do not seem to be the same as the
values produced by cooks.distance() or in the Cook's Distance against
observation number plot.
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
2013 Mar 12
1
Cook's distance
Dear useRs,
I have some trouble with the calculation of Cook's distance in R.
The formula for Cook's distance can be found for example here:
http://en.wikipedia.org/wiki/Cook%27s_distance
I tried to apply it in R:
> y <- (1:400)^2
> x <- 1:100
> lm(y~x) -> linmod # just for the sake of a simple example
>
2005 Feb 11
1
cook's distance in weighted regression
I have a puzzle as to how R is computing Cook's distance in weighted linear
regression.
In
this case cook's distance should be given not as in OLS case by
h_ii*r_i^2/(1-hii)^2 divided by k*s^2 (1)
(where r is plain unadjusted residual, k is number of parameters in model,
etc. )
but rather by
w_ii*h_ii*r_i^2/(1-hii)^2 divided by k*s^2,
2009 Feb 17
1
plot.lm: "Cook's distance" label can overplot point labels
The following code demonstrates an annoyance with plot.lm():
library(DAAGxtras)
x11(width=3.75, height=4)
nihills.lm <- lm(log(time) ~ log(dist) + log(climb), data = nihills)
plot(nihills.lm, which=5)
OR try the following
xy <- data.frame(x=c(3,1:5), y=c(-2, 1:5))
plot(lm(y ~ x, data=xy), which=5)
The "Cook's distance" text overplots the label for the point with the
2002 Mar 11
2
gif, jpeg and png image files reader
Hi all,
Although R seems to have jpeg() and png() functions that converts data into
jpeg and png formated files, it
doesn't have functions the other way around.
Does one of R contributed packages have gif, jpeg and png image readers? I
did help.search() but no luck
Regards,
Jonathan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2004 Sep 22
3
RMySQL and Blob
Dear R experts,
Does RMySQL package handle Blob datatype in a MySQL database? Blob can represent an image, a sound or some other
large and complex binary objects. In an article published by R-database special interest group, named "A common database interface (DBI)" (updated June 2003), it's mentioned in "open issues and limitations" that "We need to carefully plan
2010 Jul 27
4
Sweave and scan()
I am introducing the scan() function to my class. Consider the following
file (Scanexamp.Rnw )
\documentclass[12pt]{article}
\begin{document}
<<>>=
height = scan()
64 62 66 65 62
69 72 72 70
part = scan(what = character(0))
"Soprano" "Soprano" "Soprano"
"Alto" "Alto" "Tenor"
"Tenor" "Bass"
2006 Apr 14
5
vector-factor operation
I found myself wanting to average a vector [vec] within each level of a
factor [Fac], returning a vector of the same length as vec. After a
while I realised that
lm1 <- lm(vec ~ Fac)
fitted(lm1)
did what I want.
But there must be another way to do this, and it would be good to be
able to apply other functions than mean() in this way.
Cheers, Murray
--
Dr Murray Jorgensen
2003 Sep 17
5
Quit asking me if I want to save the workspace!
How do you stop R from putting up a dialog box when you quit Rgui?
(I use Windows and I never save workspaces that way)
Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz Fax 7 838 4155
Phone +64 7 838 4773 wk +64 7 849 6486 home
2001 May 22
2
MASS data sets
I'm running R 1.2.2 under windows 98 on a Pentium 133 laptop.
I can't seem to retrieve the package MASS data sets:
> library(MASS)
> data(wtloss)
Warning message:
Data set `wtloss' not found in: data(wtloss)
> data(abbey)
Warning message:
Data set `abbey' not found in: data(abbey)
And yet all the .rda files for the MASS datasets are in
D:\Program
2003 Aug 20
5
Interlacing two vectors
I want to interlace two vectors. This I can do:
> x <- 1:4
> z <- x+0.5
> as.vector(t(cbind(x,z)))
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5
but this seems rather inelegant. Any suggestions?
Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz
2011 Jan 05
4
Converting Fortran or C++ etc to R
I'm going to try my hand at converting some Fortran programs to R. Does
anyone know of any good articles giving hints at such tasks? I will post
a selective summary of my gleanings.
Cheers, Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz
2003 Dec 30
4
Assignments in loops
Greetings all. Any help with the following would be appreciated.
I want to create a data frame for each file in a directory. The following
code does not work but it may show what I am trying to do:
carmakes <- c('BMW','Chrysler','Citroen','Fiat','Ford','Holden','Honda',
2003 Sep 23
2
R-project [.com?] [.net?]
I got a shock a few days ago when I accidentally visited
www.r-project.com . I thought that the r-project site had been hacked
until I realised my mistake. There is also a site www.r-project.net.
Both of these sites appear to be Japanese. Does anyone know anything
about them? I suppose that it is not unusual for names close to those of
popular sites to be used. It is good that they use a
2001 Oct 10
2
How to comment out multiple lines in R source code?
Hi,
Is there a way to comment out multiple lines at once in R source code like C
language's /* */ struct?
This is quite useful when one is testing different sections of a source
code.
Thanks,
Jonathan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2001 Nov 12
3
Plotting symbols
Has anyone got a cute way of compiling a table of the available plotting
symbols?
I've been repeatedly pasting in
cno <- cno + 1
cno
plot(x,y,pch=cno)
which is tedious, and besides I have to note down the symbols by hand.
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at
2006 Nov 13
2
A printing "macro"
I am exploring the result of clustering a large multivariate data set
into a number of groups, represented, say, by a factor G.
I wrote a function to see how categorical variables vary between groups:
> ddisp <- function(dvar) {
+ csqt <- chisq.test(G,dvar)
+ print(csqt$statistic)
+ print(csqt$observed)
+ print(round(csqt$expected))
+ round(csqt$residuals)
+ }
>
> x