er than an
appropriate chosen threshold, you should not check whether a number is
bigger or equal to zero, but whether it is bigger or equal to an
appropriately chosen negative threshold. More information are given in
FAQ 7.31.
HTH.
Cheers,
Berwin
=== Full addre
G'day Benjamin,
On Mon, 6 Aug 2007 22:49:04 -0400
Benjamin Zuckerberg <[EMAIL PROTECTED]> wrote:
> Quick question...is there a way of specifying a y-intercept value
> within a lm statement. For example, if I wanted to specify the
> regression to pass through the origin I would enter lm(y~0+
Petal.Length, data=iris,
+ family=gaussian())
However, since you are using the gaussian family, why not use l1ce()
directly? The following command leads to the same output:
> l1ce(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length, data=iris,
+ absolute=TRUE)
Hope this helps.
C
t() returns the roots of a
polynomial.
Cheers,
Berwin
=========== Full address =
Berwin A TurlachTel.: +65 6515 4416 (secr)
Dept of Statistics and Applied Probability+65 6515 6650 (self)
Faculty of Science
be.
Alternatively, you could write a function that takes values of x3 and does all
the computations outline above (return -Inf if the value x3 is not feasible)
and then pass the function to optimise() for numerical optimisation...
Hope this helps.
Cheers,
Berwin
G'day Uwe,
On Tue, 03 Jul 2007 14:33:05 +0200
Uwe Ligges <[EMAIL PROTECTED]> wrote:
> Pietrzykowski, Matthew (GE, Research) wrote:
> > I saw the new book,
> > "The R Book", by Michael J. Crawley and wanted to know what R users
> > thoughts of it.
>
> The author seems to be an expert in (almost?
tend the course.
Thanks for your help.
Cheers,
Berwin
=== Full address =====
Berwin A TurlachTel.: +65 6515 4416 (secr)
Dept of Statistics and Applied Probability+65 6515
G'day Marc,
On Fri, 08 Jun 2007 14:11:48 -0500
Marc Schwartz <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-06-08 at 16:02 +0200, Giovanni Parrinello wrote:
> > Dear All,
> > discussing with a statistician of a pharmaceutical company I
> > received this answer about the statistical package that I have
G'day all,
On Tue, 8 May 2007 12:10:25 +0800
Berwin A Turlach <[EMAIL PROTECTED]> wrote:
> > I am trying to perform the below optimization problem, but getting
> > (0.5,0.5) as optimal solution, which is wrong;
>
> Why?
>
> As far as I can tell you are
G'day Paul,
On Mon, 7 May 2007 23:25:52 +0100
"Paul Smith" <[EMAIL PROTECTED]> wrote:
[...]
> Furthermore, X^2 is everywhere differentiable and notwithstanding the
> reported problem occurs with
>
> myfunc <- function(x) {
> x1 <- x[1]
> x2 <- x[2]
> (x1-x2)^2
> }
Same argument as with ab
G'day Paul,
On Mon, 7 May 2007 22:30:32 +0100
"Paul Smith" <[EMAIL PROTECTED]> wrote:
> I am trying to perform the below optimization problem, but getting
> (0.5,0.5) as optimal solution, which is wrong;
Why?
As far as I can tell you are trying to minimize |x1-x2| where x1 and x2
are between 0
On Wed, 02 May 2007 11:37:22 +1000
Kate Stark <[EMAIL PROTECTED]> wrote:
> [...] My model is:
>
> fit <- glm(Mature ~ Season * Size - 1, family = binomial, data=dat)
>
> where Mature is a binary response, 0 for immature, 1 for mature. There
> are 3 Seasons.
I would use:
fit <- gl
G'day Kaltja,
On Sat, 31 Mar 2007 10:19:00 +0300 (EEST)
[EMAIL PROTECTED] wrote:
> [...] I did not even now there was R wiki. I couldn't find a link
> from the R organization pages to it or am I just blind?
If you talk about CRAN (e.g. http://cran.r-project.org/) then no, but
if you really talk
G'day John,
On Tue, 27 Mar 2007 04:52:03 -0700 (PDT)
John McHenry <[EMAIL PROTECTED]> wrote:
> I downloaded the source code for the package zoo (zoo_1.2-2.tgz from
> CRAN).
Are you sure? How did you download it and from where exactly?
As far as I know, and as far as I can tell, CRAN has all s
G'day Dave,
On Tue, 20 Mar 2007 14:59:38 +
Dave Ewart <[EMAIL PROTECTED]> wrote:
> All help/suggestions/appreciated!
The calculations are done in floating point arithmetic, not integer
arithmetic. From the help page on `choose' one might already guess
so much, but reading "R-2.4.1/src/nmath/
G'day Tord,
On Mon, 19 Mar 2007 10:05:47 +0100
Tord Snäll <[EMAIL PROTECTED]> wrote:
> but I was hoping to get this:
> x
> [1,] 2 20
> [2,] 3 30
> [3,] 5 50
> [4,] 4 40
> [5,] 6 60
> [6,] 1 10
You did try rank(), didn't you?
> x= c(20,30,50,40,60,10)
> cbind(rank(x), x)
x
[1,] 2
ge relax by
Peter Wolf. See:
http://www.wiwi.uni-bielefeld.de/~wolf/software/relax/relax.html
And, for an example output just like you what you want:
http://www.wiwi.uni-bielefeld.de/~wolf/software/relax/hello-world.pdf
HTH.
Cheers,
Berwin
=== Full add
G'day Jenny,
On Wed, 28 Feb 2007 16:41:18 -0600 (CST)
<[EMAIL PROTECTED]> wrote:
> I am going to be teaching a workshop next week using R and
> Bioconductor in one of our university's computer labs. They have
> recently installed R 2.4.1 for me, and I'm checking all my scripts. I
> just noticed t
256 0.000 0.000
> system.time(for (i in 1:1) erg<-myfun2(c(3, 4, 10,14,8,3,4,6,9)))
[1] 0.280 0.000 0.283 0.000 0.000
Cheers,
Berwin
=== Full address =
Berwin A TurlachTel.: +65 6515 4416 (secr)
are possible.
Hope this helps.
Cheers,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics+61 (8) 6488 3383 (self)
The University of Western
d this one
works, I have tested it):
<<>>=
str(women)
women$height
women[,1]
@
\begin{Sinput}
> "["(women,1)
\end{Sinput}
<>=
"["(women,1)
@
HTH
Cheers,
Berwin
== Full address
Berwin A
> "AT" == kone <[EMAIL PROTECTED]> writes:
AT> but how to send the information from different plot- and
AT> lines-commands to a certain window?
?dev.set
?dev.next
?dev.prev
?dev.cur
HTH.
Cheers,
Berwin
__
R-help@stat.math.ethz.c
G'day Yingfu,
> "YX" == Yingfu Xie <[EMAIL PROTECTED]> writes:
YX> Thanks a lot for answering! I prefer the first method, which
YX> seems easier to carry out. So, what I need now is some method
YX> to solve the non-linear equation [...] I searched the R
YX> archive somehow, b
ng on M_11, infinitely many.
Hope this helps.
Cheers,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics+61 (8) 6488 3383 (self)
The Universi
uot; of "The R Language Definition" (and all
though this is a draft, that part seems to be authoritative :) ).
Cheers,
Berwin
====== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathe
y change the values for
'iter.max' and 'trace' in the call to 'nlminb()' by setting values for
'msMaxIter' and 'msVerbose', using 'lmeControl', when calling 'lme()'.
Cheers,
Berwin
== Full addres
n GLM that Murray wants to fit is:
glm(deaths~ age*Smoke+I(age^2)+offset(l), family=poisson)
Cheers,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics+6
G'day John,
> "JF" == John Fox <[EMAIL PROTECTED]> writes:
JF> Simply stacking the problems and treating the resulting
JF> observations as independent will give you the correct
JF> coefficients, but incorrect coefficient variances
Yes, after Andrew's (off-list) answer I realised t
Dmat, dvec, Amat, bvec = bvec, meq = 2) :
matrix D in quadratic function is not positive definite!
The Goldfarb-Idnani algorithm starts off by calculating the
unconstrained solution. Thus, it requires that the matrix D in the
objective function is positive definite. In your problem the
appreciated.
Cheers,
Berwin
== Full address ====
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics+61 (8) 6488 3383 (self)
The University of Western Australia FAX :
quot;speaking for
the R community".
Even if it had been an e-mail to the R mailing list, such e-mails nly
express the opinions of the sender, not that of the members of the
mailing list and not that of the R community (which could encompass
more than the readers of a mailing list) at large.
Cheers
ted parameters, the quality of
LI> the fit etc... but what if you want to get the fitted
LI> parameters as a vector to re-use them straight away in the
LI> following computations?
?coef ??
Cheers,
Berwin
========== Full address ==
G'day Deepayan,
>>>>> "DS" == Deepayan Sarkar <[EMAIL PROTECTED]> writes:
DS> On 5/22/06, Berwin A Turlach <[EMAIL PROTECTED]> wrote:
DS> [...]
>> [...] Should perhaps better be formulated as:
>>
>> My under
G'day Duncan,
>>>>> "DM" == Duncan Murdoch <[EMAIL PROTECTED]> writes:
DM> On 5/22/2006 3:55 AM, Berwin A Turlach wrote:
>> I agree with you on this. Probably I was to terse in my
>> writing and produced misunderstandings. I neve
G'day Deepayan,
> "DS" == Deepayan Sarkar <[EMAIL PROTECTED]> writes:
DS> let me first summarize this sub-discussion so far: [...]
Sound like a perfect summary. :)
DS> As far as I can tell (and please correct me if I'm wrong),
DS> your contention is that by linking a GPL componen
G'day Deepayan,
>>>>> "DS" == Deepayan Sarkar <[EMAIL PROTECTED]> writes:
DS> On 5/21/06, Berwin A Turlach <[EMAIL PROTECTED]> wrote:
DS> A user can never violate the GPL. The GPL does not govern use,
DS> it governs distribution
G'day Deepayan,
> "DS" == Deepayan Sarkar <[EMAIL PROTECTED]> writes:
DS> A user can never violate the GPL. The GPL does not govern use,
DS> it governs distribution. Specifically,
As I said, I stopped reading gnu.misc.discuss long time ago, but if I
remember correctly sometimes in the
G'day Brian,
> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> writes:
BDR> The issue in the glmmADMB example is not if they were
BDR> required to release it under GPL
I should probably bow to your superior command of the English language
and trust that you can interpret Spencer's ques
SG> to know.
I guess the above indicates that I have partly a different
interpretation than you have. But, as I said, I am not a lawyer.
And as the German proverb goes "Wo kein Klaeger ist, ist auch kein
Richter"---which means that you will probably only get definite
answers to these l
quot;(4.6,4.87]"
[1] 4.60 4.87
$"(4.87,5.15]"
[1] 4.87 5.15
$"(5.15,5.43]"
[1] 5.15 5.43
$"(5.43,5.7]"
[1] 5.43 5.70
$"(5.7,5.98]"
[1] 5.70 5.98
$"(5.98,6.25]"
[1] 5.98 6.25
$"(6.25,6.53]"
[1] 6.25 6.53
$"(6.53,6.8]&
or the file. How do you select that one? ;-)
Cheers,
Berwin
PS: I heard rumours that Wiwi had HU-Berlin was using R instead of
XploRe for some tasks..... Slowly I start to believe it... :-))
== Full address
Berwin A Turlach
.6435816 -0.6435816
2
-0.9267021
> tapply(vec, Fac, sum)[Fac]
2 1 1 2 2 1 1 2
-3.706808 -2.574326 -2.574326 -3.706808 -3.706808 -2.574326 -2.574326 -3.706808
Cheers,
Berwin
====== Full add
930 133.9723 <2e-16 ***
x1 1 0.0196 0.0196 0.5261 0.47
Residuals 97 3.6151 0.0373
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Cheers,
Berwin
== Full add
G'day Rolf,
> "RT" == Rolf Turner <[EMAIL PROTECTED]> writes:
RT> Is there a way of calculating the derivative of a function
RT> returned by splinefun()?
Yes, of course. :)
As somebody else once said: "this is R, anything can be done, the
question is just how easy it is to do so".
It
G'day Martin,
> "MM" == Martin Maechler <[EMAIL PROTECTED]> writes:
MM> [...]
MM> The grain of truth in Henrik's statement is that for a generic
MM> function, S3 or S4, one should carefully consider which
MM> arguments should be shared by all methods and which not. But
MM
tatistician
(or someone with sufficient statistical training) at Washigton State
University who could explain all this to you.
Best wishes,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
S
ee: http://www.gnu.org/software/emacs/emacs.html
In fact, I got so used to command line completion, that I am hopeless
on any other interface to R since I cannot remeber the correct spelling
of (some) commands ;-)
HTH.
Cheers,
Berwin
== Full address ====
collapse=" ")
> tt1
$ID1
[1] "num1"
$ID2
[1] "num2 num3"
$ID3
[1] "num4"
$ID4
[1] "NA"
LD> What I want to get is:
>> list[1:4]
LD> $ID1
LD> [1] "num1"
LD> $ID2
LD> [1] "num2 num3&q
>>>>> "BAT" == Berwin A Turlach <[EMAIL PROTECTED]> writes:
>>>>> "TM" == Taka Matzmoto <[EMAIL PROTECTED]> writes:
TM> and then assign the character vector to the numeric vector by
TM> names<-first.10
TM&
G'day Taka,
> "TM" == Taka Matzmoto <[EMAIL PROTECTED]> writes:
TM> and then assign the character vector to the numeric vector by
TM> names<-first.10
TM> first.10 = numeric.vector
TM> combined.one <- cbind(names,first.10)
TM> container <- diag(10)
TM> for (i in 1:(10*
G'day Muhammad,
> "MS" == Muhammad Subianto <[EMAIL PROTECTED]> writes:
MS> Are there any functions to convert decimals to fractions in R?
MS> I have the result:
Something like:
> library(MASS)
> as.fractions(c(0, 0.0133, 0.04,
0.0667, 0.093
G'day Spencer,
> "SG" == Spencer Graves <[EMAIL PROTECTED]> writes:
SG> I'm not qualified to make this suggestion since I'm incapable
SG> of turning it into reality, [...]
This statement applies to me too, nevertheless I would like to point
out the following GPL library:
http
an R package) (parts of) the HSL archive routines.
Cheers,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics+61 (8) 6488 3383 (self)
The University of
png
> dev.print(file=fname, device=FOO, width=DEVw, height=DEVh, bg="transparent")
X11
2
> FOO <- pdf
> dev.print(file=fname, device=FOO, width=DEVw, height=DEVh, bg="transparent")
X11
2
all seem to work.
HTH.
Cheers,
Berwin
==
the joint distribution to be. :)
If you want the joint distribution to be normal, you could use the
function mvrnorm() from the MASS package.
HTH.
Cheers,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8)
> "vic" == vincent <[EMAIL PROTECTED]> writes:
vic> ronggui a __
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
G'day Robin,
> "RH" == Robin Hankin <[EMAIL PROTECTED]> writes:
RH> How do I rewrite jj() so that it consistently returns a
RH> matrix?
How about explicitly returning a matrix with the desired dimensions?
> jj
function(m1,m2,f,...)
matrix(apply(m1, 1, function(y)
umably be found in
format.data.frame().
RH> (3) Can I structure my dataframe in a better way, so that
RH> this problem does not occur?
Not really, it's more a question of the appropriate use of
as.vector(). :-))
Cheers,
Berwin
== Full address
)*100 - 5
[1] -1.776357e-14
and read FAQ 7.31
Cheers,
Berwin
========== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics+61 (8) 6488 3383 (self)
The University of W
G'day Robin,
> "RH" == Robin Hankin <[EMAIL PROTECTED]> writes:
RH> Still, it's a little disconcerting that apply() as generally
RH> used can return a list 99.9% of the time and a matrix the
RH> other 0.1%.
It probably depends on how it is used. :-)
I usually use apply in situati
s not a good idea to have statements in such chunks that
produce (pseudo-)random results.
SD> Thanks a lot !
My pleasure. HTH.
SD> R version 2.1.0 (Debian).
Well, I guess the standard on this mailing list is to point out that
this is quite an old version of R and that the current o
> "AD" == Alexis Diamond <[EMAIL PROTECTED]> writes:
AD> I have a follow-up from Jens's question and Professor Ripley's
AD> response.
AD> Jens wants to do quadratic optimization with 2 constraints:
>> > > # I need two constraints:
>> > > # 1. each element in par needs to
G'day Ronaldo,
> "RRJ" == Ronaldo Reis-Jr <[EMAIL PROTECTED]> writes:
RRJ> I reading about Sweave and it make a good output. But all
RRJ> example is made with R commands mades in a file. Is possible
RRJ> to make an output with sweave interactively in R and after
RRJ> the analy
G'day Brian,
>>>>> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> writes:
BDR> On Wed, 31 Aug 2005, Berwin A Turlach wrote:
>> available.packages() does not seem to have a type argument
>> according to its documentation, so I guess
n't know where you run (or
what to run) R-devel ;-) ).
Hope this helps.
Cheers,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics
G'day Daniel,
> "DR" == daniel <[EMAIL PROTECTED]> writes:
DR> First: I think coefficients from lm(Employed~.,data=longley)
DR> should be equal coefficients from
DR> lm.ridge(Employed~.,data=longley, lambda=0) why it does not
DR> happen?
Which version of R and which version o
>>>>> "BT" == Berwin A Turlach <[EMAIL PROTECTED]> writes:
>> tmp <- sapply(1:length(L), function(j, mat, list)
kronecker(X[j,,drop=FALSE], L[[j]]), mat=X, list=L)
Uups, should proof read more carefully before hitting the send
button. This should
2
[4,]5522
[5,]5 502 20
>
HTH.
Cheers,
Berwin
== Full address
Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr)
School of Mathematics and Statistics+61 (8) 6488 3383
2.730e+009.690e-066.886e-03
Degrees of Freedom: 8 Total (i.e. Null); 6 Residual
Null Deviance: 0.09894
Residual Deviance: 0.0005474 AIC: -53.83
HTH.
Cheers,
Berwin
== Full address
> "BN" == Balasubramanian Narasimhan <[EMAIL PROTECTED]> writes:
BN> Trevor's problem is reproducible on R 1.8.1 (which is what he
BN> was using) on both Linux RHEL 3.0 and Solaris and R 1.8.0 on
BN> Windows.
Yep, on my Linux box (details below) I have the same problem with R
1.8.1
G'day Stefano,
> "SC" == Stefano Calza <[EMAIL PROTECTED]> writes:
SC> Hi. I'm experiencing a problem with updating packages on R
SC> 1.8.1 (2003-11-21) on Debian testing. I get the following
SC> message when updating for example Design:
SC> ... ... /usr/bin/ld: cannot fi
look at the output, adding the SE:Edge term decreases RSS but
increases AIC. The increase in parameters is not worth the decrease
in RSS, according to the AIC criterion. step tries to find the best
AIC model, i.e., the current model is the best.
Cheers,
Berwin
=
> "AM" == Arnab mukherji <[EMAIL PROTECTED]> writes:
AM> Any advice would be really helpful.
Read the documentation of predict and then the one of predict.glm? ;-)
I guess you actually wanted to do one of the following:
> yhat<-predict(g, dat, type="response")
> range(yhat)
[1] 0.276023
73 matches
Mail list logo