Perhaps
xnew <- x[1:length(x)+c(1,-1)]
will do it.
Ben Fairbank
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of David Afshartous
Sent: Friday, June 27, 2008 9:11 AM
To: r-help@r-project.org
Subject: [PS] [R] Switching entries in vector in by gro
"S programming"?), would be most recommended as the next
book for one who would move beyond advanced beginner status?
(Programming experience in Fortran, APL, Python, small-system assembly
language, but not C).
Ben Fairbank
San Antonio, Texas
[EMAIL PROTECTED]
cumulative
distribution to the first one.
Any suggestion would be very welcome.
x1 <- sort(rnorm(1000,50,10))
x2 <- sort(rnorm(1000,40,8))
plot(x1,1:length(x1)/length(x1),type="l")
plot(x2,1:length(x2)/length(x2),type="l")
grid(col = "black")
Ben Fair
Quite right, there is an optional 4th argument, and the table must be
sorted ascending on the first column in Excel. Thus these functions
only approximately duplicate the Excel functions (improve on them IMHO).
BTW, I pasted the wrong formula in my reply; though it works, simpler is
ID <- 4
Another way:
If x is a two column matrix, as suggested by Henrique D.,
IDValue
1 7 0.000656733
2 6 0.201764789
3 1 0.671113391
4 10 -0.739727826
5 9 -1.111310154
6 5 -0.859455833
7 2 -1.408229877
8 8 0.993126295
9 3 -0.171906808
10 4 -0.140107677
And you are loo
Mary --
The dmultinomial function (try ?Multinomial, noting that it is an upper
case M) has a "log" option, which, if set to TRUE, returns logarithms of
probabilities, but that is for computing probabilities, not generating
samples. Perhaps the "long" you referred to is a misprint for "log?"
In
Look at ?tapply, based on your description, it is what you want.
Ben
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ng Stanley
Sent: Thursday, March 13, 2008 9:25 AM
To: r-help
Subject: [PS] [R] How to manipulate data according to groups ?
Hi,
I have
Monica --
There has been a virtual population explosion of R books in recent years
and we all have our favorites. You may wish to pick one oriented toward
your specialty, but the absolute minimum lowest common denominator (by
which I mean that it has the ground zero essential information that all
it rands), then do comparisons, thus,
draws <- 0 + (rands < probs)
Ben Fairbank
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Economics Guy
Sent: Tuesday, March 11, 2008 10:16 AM
To: [EMAIL PROTECTED]
Subject: [PS] [R] Generating a new matrix
Try table(), with the name of your vector inside the parentheses.
Ben
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Pete Dorothy
Sent: Sunday, March 02, 2008 2:27 PM
To: r-help@r-project.org
Subject: [PS] [R] discrete variable
Hello,
I am sorry for a
as.vector(col.Sums())
Ben
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jason Horn
Sent: Friday, February 29, 2008 11:03 AM
To: [EMAIL PROTECTED]
Subject: [PS] [R] Column sums from a data frame (without the headers)
Does anyone know how to get a vecto
ar not to cover this situation. Can any of the R optimization
packages handle optimization when the manipulated variables are binary
and numerous?
With thanks for any suggestions,
Ben Fairbank
Technical Director
Sinclair Customer Metrics
[EMAIL PROTECTED]
[[alternative
Version 2.5.0, Windows XP professional
Ben Fairbank
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-g
And another problem, in addition to the points made by others, is that
the formula for the SD gives a biased estimate (it underestimates it) of
the population SD for small n when sampling from a normal distribution.
When n is about twelve or so or more, the bias can usually be ignored
(it is about
14 matches
Mail list logo