Dear R developers,
sessionInfo() below
Please have a look at the following two versions of the same function:
1. Intended behavior:
> Su1 = function(u=100, l=u, mu=0.53, sigma2=4.3^2)
+ {
+ print(c(u, l, mu)) # here, l is set to u’s value
+ u = u/sqrt(sigma2)
+ l = l/sqrt(sigma2)
+ mu =
mu=0.53, sigma2=4.3^2) # instead of l=u
And maybe also „in-place“ changes of values…
Best regards,
Matthias
Von: William Dunlap
Gesendet: Samstag, 2. September 2017 19:41
An: Rui Barradas
Cc: Matthias Gondan; r-help@r-project.org
Betreff: Re: [R] Strange lazy evaluation of default argume
happen? [it’s documented
behavior, but still…]
So, I’ll stick with R. Still 25 years or so until retirement, but I’ll survive,
even without crossreferenced default arguments.
Best wishes,
Matthias
Von: S Ellison
Gesendet: Dienstag, 5. September 2017 16:17
An: Matthias Gondan; r-help@r-project.
Dear R users,
This works:
quantile(1:10, probs=0.5)
This fails (obviously):
quantile(factor(1:10), probs=0.5)
But why do quantiles for ordered factors not work either?
quantile(ordered(1:10), probs=0.5)
Is it because interpolation (see the optional type argument) is not defined? Is
there a
I found it:
quantile(ordered(1:10), probs=0.5, type=1)
works, because type=1 seems to round up or down, whatever. The default option
for is 7, which wants to interpolate, and then produces the error.
Two options come to my mind:
- The error message could be improved.
- The default type could
Dear R-Users,
Is anyone aware of a significance test which allows
demonstrating that one distribution dominates another?
Let F(t) and G(t) be two distribution functions, the
alternative hypothesis would be something like:
F(t) >= G(t), for all t
null hypothesis: F(t) < G(t), for some t.
Best
Dear R developers,
A great R feature is that elements of vectors, lists and dataframes can
have names:
vx = c(a=1, b=2)
lx = list(a=1, b=2)
Accessing element "a" of vx: vx['a']
Accessing element "a" of lx: lx[['a']] or lx$a
Might be a matter of taste, but I like the $ very much. Unfortunatel
are some R scripts from Brunner et al. available on his website
http://www.ams.med.uni-goettingen.de/de/sof/ld/index.html
But they seem not to be working with current R versions.
Best regards,
Matthias Gondan
--
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt koste
. rer. nat. Matthias Gondan
Institut für Psychologie
Universität Regensburg
D-93050 Regensburg
Tel. 0941-943-3856
Fax 0941-943-3233
Email: matthias.gon...@psychologie.uni-regensburg.de
http://www.psychologie.uni-r.de/Greenlee/team/gondan/gondan.html
_
Dear list,
Apparently, there is no function like sscanf in R.
I have a string, "Condition: 311", and I would like
to read out the number and store it to a numeric
variable. Is there an easy way to do this?
Best wishes,
Matthias
--
__
R-help@r-project
Dear R friends,
I am currently trying to write a piece of C code that uses „embedded R“, and
for specific reasons*, I cannot keep track if R already has been initialized.
So the code snippet looks like this:
LibExtern char *R_TempDir;
if(R_TempDir == NULL)
…throw exception R not initialize
Dear R users,
This works as expected:
• plot(density(c(1,2, 3, 4, 5, NA), na.rm=TRUE))
This raises an error
• plot(density(c(1,2, 3, 4, 5, NA), na.rm=TRUE, weights=c(1, 1, 1, 1, 1, 1)))
• plot(density(c(1,2, 3, 4, 5, NA), na.rm=TRUE, weights=c(1, 1, 1, 1, 1, NA)))
This seems to work (it trigge
a.rm=TRUE)
[1] 2
Von: Richard O'Keefe
Gesendet: Montag, 12. Juli 2021 13:18
An: Matthias Gondan
Betreff: Re: [R] density with weights missing values
Does your copy of R say that the weights must add up to 1?
?density doesn't say that in mine. But it does check.
On Mon, 12 Jul 2021
thing?
Ursprüngliche Nachricht Von: Bert Gunter
Datum: 12.07.21 16:25 (GMT+01:00) An: Matthias
Gondan Cc: r-help@r-project.org Betreff: Re: [R]
density with weights missing values The behavior is as documented
AFAICS.na.rmlogical; if TRUE, missing values are removed from x. If FALSE
anymissing v
er
Datum: 12.07.21 18:44 (GMT+01:00) An:
r-help@r-project.org, matthias-gondan , Bert Gunter
Cc: r-help@r-project.org Betreff: Re: [R] density with
weights missing values Sure, you might think that.But most likely the reason
this code has not been corrected is that when you give weights for mi
.
Best wishes,
Matthias
PS. Sorry for the HTML email. I’ve given up trying to fix such behavior.
Von: Martin Maechler
Gesendet: Dienstag, 13. Juli 2021 09:09
An: Matthias Gondan
Cc: r-help@r-project.org
Betreff: Re: [R] density with weights missing values
>>>>> Matthias Gonda
Response to 1You need the log version e.g. in maximum likelihood, otherwise the
product of the densities and probabilities can become very small.
Ursprüngliche Nachricht Von: r-help-requ...@r-project.org
Datum: 04.08.21 12:01 (GMT+01:00) An: r-help@r-project.org Betreff: R-help
lim=c(-Inf, Inf)[as a replacement for NULL/
autoselection] and ylim=c(Inf, -Inf)[autoselection, reversed y axis] should be
handled correctly.
I would find such a feature useful. Do you think it would interfere with other
functions?
Thank you for your consideration.
Best wishes,
Matth
The warning
1: In (ind.c == TRUE) & (ind.sgn == TRUE) :
longer object length is not a multiple of shorter object length
means that ind.c and ind.sgn have different lengths, for whatever reason.
Although R continues the routine, the warning should, in general, not be
ignored.
Try:
1:3 + 1:2
be helpful.
Searching around the internet was not very encourageing. Some people
wrote that it is not so simple to have Atlas fully exploit a multicore
computer.
I hope this is not too unspecific.
Best wishes,
Matthias
--
Dr. rer. nat. Matthias Gondan
Institut für Psychologie
Universität Regensbu
try command solnp in package Rsolnp
Am 09.08.2010 18:56, schrieb Dwayne Blind:
Hi !
Why not constrOptim ?
Dwayne
2010/8/9 Gildas Mazo
Dear R users,
I'm looking for tools to perform optimization subject to constraints,
both linear and non-linear. I don't mind which algorithm may be used, m
try this (package Rsolnp)
library(Rsolnp)
g<- function(x)
{
return(x[1]^2+x[2]^2)
} # constraint
f<- function(x)
{
return(x[1]+x[2])
} # objective function
x0 = c(1, 1)
solnp(x0, fun=f, eqfun=g, eqB=c(1))
Am 10.08.2010 14:59, schrieb Gildas Mazo:
Thanks, but I still cannot get to sol
1" or the equivalent for your
platform?
Allan
On 06/08/10 15:12, Matthias Gondan wrote:
Dear List,
I am aware this is slightly off-topic, but I am sure there are people
who already had the problem and who perhaps solved it.
I am running long-lasting model fits using constrOptim command.
yrnorm(4))
[1] 0.2875775 0.7883051 0.4089769 0.8830174
Best wishes,
Matthias Gondan
--
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/
Dear R people,
On my freshly installed R-2.13.1 (winxp), the following code yields
unsatisfactory results (irregular grid lines instead of a smooth plane):
image(matrix(1, nrow=100, ncol=100))
This is working fine,
image(matrix(1, nrow=100, ncol=100), useRaster=TRUE)
but then right-click and
My vote:
1. Symbolic function arguments:
fn = function(a, b)
{
a/b
}
fn(b=10, a=2)
2. Names for elements of a vector and matrices
v = c(a=1, b=2)
v['a'] = v['a'] * 2
same for matrices
3. about 10,000 user-contributed packages on CRAN
4. weird things like
a = numeric(10)
a[1:10] = 1:2
you might to do something like
library(SuppDists)
t = runif(100, 100, 500) # original RT
t_IG = qinvGauss(ecdf(t)(t)-0.5/length(t), 1, 16)
plot(density(t_IG))
but what is the purpose of it? Usually reaction times are thought to
follow a certain kind of distribution (e.g. an inverse Gaussian
dis
Dear R developers,
I want to draw an arrow in a figure with lty=2. The
lty argument also affects the edge of the arrow, which is
unfortunate. Feature or bug?
Is there some way to draw an arrow with intact edge, still
with lty=2?
Example code:
plot(1:10)
arrows(4, 5, 6, 7, lty=2)
Best wishes,
Hi,
Use offset variables if count occurrences of an event and you want to
model the
observation time.
glm(count ~ predictors + offset(log(observation_time)), family=poisson)
If you want to compare durations, look at library(survival), ?coxph
If tnoise_sqrt is the square root of tourist noise,
2011 20:50, schrieb Ben Bolker:
Matthias Gondan gmx.de> writes:
Hi,
Use offset variables if count occurrences of an event and you want to
model the
observation time.
glm(count ~ predictors + offset(log(observation_time)), family=poisson)
If you want to compare durations, look at library(surv
Dear R team, dear Prof. Therneau,
library(survival)
data(colon)
?colon
gives me only a very rudimentary source (only a name). Is there a
possibility to get a reference to the clinical trial these data
are taken from?
Many thanks in advance. With best wishes,
Matthias Gondan
interaction.plot source:
legend(xleg, yleg, legend = ylabs, col = col, pch = if (type %in%
c("p", "b"))
pch, lty = if (type %in% c("l", "b"))
lty, bty = leg.bty, bg = leg.bg) <- here I woul
Dear list,
I think there is a small bug in the constrOptim documentation (R-2.7.0):
## from optim
fr <- function(x) { ## Rosenbrock Banana function
x1 <- x[1]
x2 <- x[2]
100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
grr <- function(x) { ## Gradient of 'fr'
x1 <- x[1]
x2 <- x[2]
Dear R users,
I noticed a problem in the anova command when applied on
a single coxph object if there are missing observations in
the data:
This example code was run on R-2.6.1:
> library(survival)
> data(colon)
> colondeath = colon[colon$etype==2, ]
> m = coxph(Surv(time, status) ~ rx + sex
Peter Dalgaard schrieb:
> Matthias Gondan wrote:
>
>> Dear R users,
>>
>> I noticed a problem in the anova command when applied on
>> a single coxph object if there are missing observations in
>> the data:
>>
...
>> In the docume
Dear List,
I have tried a stratified Cox Regression, it is working fine, except for
the "Anova"-Tests:
Here the commands (should work out of the box):
library(survival)
d = colon[colon$etype==2, ]
m = coxph(Surv(time, status) ~ strata(sex) + rx, data=d)
summary(m)
# Printout ok
anova(m, test='Ch
Hi Diana,
Look at Edgar Brunner's Homepage
http://www.ams.med.uni-goettingen.de/en/sta/e.brunner.html
and here:
http://www.ams.med.uni-goettingen.de/en/sof/index.html
Unfortunately, the R script for a 2x2 design with two groups and two
timepoints (f1.ld.f1.r) seems to be broken. Uncommenting t
Dear list,
This is off-topic, but perhaps there is an expert out there who can help
me in
a bootstrapping test.
I have two samples A, B from, say, a normal distribution. A third sample R
is the vector of pairwise minima of the same random variables:
A = rnorm(100)
B = rnorm(100)
A2 = rnorm(10
(little correction below)
> Dear list,
>
> This is off-topic, but perhaps there is an expert out there who can help
> me in
> a bootstrapping test.
>
> I have two samples A, B from, say, a normal distribution. A third sample R
> is the vector of pairwise minima of the same random variables:
>
>
Dear list,
Is anyone aware of a library for sample size calculation in R, similar
to NQuery? I have to give a course in this area, and I would like to
enable the students playing around with this.
Best wishes,
Matthias
__
R-help@r-project.org mailing
Hi Eleni,
The problem of this approach is easily explained: Under the Null
hypothesis, the P values
of a significance test are random variables, uniformly distributed in
the interval [0, 1]. It
is easily seen that the lowest of these P values is not any 'better'
than the highest of the
P values
on the Cohen book.
>
>
> On Feb 13, 2008 4:52 AM, Matthias Gondan <[EMAIL PROTECTED]> wrote:
>
>> Dear list,
>>
>> Is anyone aware of a library for sample size calculation in R, similar
>> to NQuery? I have to give a course in this area, and I would
Hi Eleni, hi list,
here is small sample program, the library is "survival", it is included
in the standard R distribution.
> data(colon)
> s = survfit(Surv(time, status) ~ rx, data=colon)
> plot(s)
> plot(s, col=1:3)
By the way: Does anyone know a neat way to indicate the number of
patients unde
Frank E Harrell Jr schrieb:
> Matthias Gondan wrote:
>>> data(colon)
>>> s = survfit(Surv(time, status) ~ rx, data=colon)
>>> plot(s)
>>> plot(s, col=1:3)
>>
>> By the way: Does anyone know a neat way to indicate the number of
>> patients un
Hi Geoff,
I think the answer to such a problem (overall survival vs. disease free
survival) depends on the regulatory
environment, for example, in a phase III clinical trial, OS would be
used, whereas in an equivalence study,
DFS would be used.
Best,
Matthias
Geoff Russell schrieb:
> Dear Us
Dear list,
I hope the topic is of sufficient interest, because it is not
R-related. I have N=100 yes/no-responses from a psychophysics
paradigm (say Y Yes and 100-Y No-Responses). I want to see
whether these yes-no-responses are in line with a model
predicting a certain amount p of yes-responses.
ALARY" [label="133"];
"TIME" -> "PUBS" [label="38.97" dir=both];
"TIME" -> "TIME" [label="18.3" dir=both];
"PUBS" -> "PUBS" [label="196.12" dir=both];
"SALARY" -> "SA
47 matches
Mail list logo