Thank you, Terry. We look forward to hearing from you again.
Youyi
On Mon, Jul 12, 2021 at 3:13 PM Therneau, Terry M., Ph.D.
wrote:
>
>
> On 7/11/21 5:00 AM, r-help-requ...@r-project.org wrote:
> > Hello, is it kosher to call cox.zph on a syvcoxph model fit? I see that
> > someone proposed a mod
On 7/11/21 5:00 AM, r-help-requ...@r-project.org wrote:
Hello, is it kosher to call cox.zph on a syvcoxph model fit? I see that
someone proposed a modified version of cox.zph that uses resid(fit,
'schoenfeld', **weighted=TRUE**).
https://stats.stackexchange.com/questions/265307/assessing-prop
On 12/07/2021 1:22 p.m., matthias-gondan wrote:
You're right, of course. Extrapolating your argument a bit, the whole practice
of na.rm is questionable, since there's always a reason for missingness (that
is not in x and rarely elsewhere in the data)Best wishes Matthias
For what it's worth, I
I think the missing weights are more crucial than equally-weighted missing data
would be.
what if there is a heavy weight on the missing values? it could completely
change the interpretation of the result.
On July 12, 2021 10:22:19 AM PDT, matthias-gondan
wrote:
>You're right, of course. Extr
You're right, of course. Extrapolating your argument a bit, the whole practice
of na.rm is questionable, since there's always a reason for missingness (that
is not in x and rarely elsewhere in the data)Best wishes Matthias
Ursprüngliche Nachricht Von: Jeff Newmiller
Datum: 12.
Sure, you might think that.
But most likely the reason this code has not been corrected is that when you
give weights for missing data the most correct result is for your entire
density to be invalid.
Fix your inputs so they make sense to you and there is no problem. But absent
your intellectu
My point (confusingly made!) is that documented behavior is all you
should expect. The docs say that weights must be non-negative numeric.
If they aren't...
"Consistency" of behavior among different functions is highly
subjective -- it depends exactly on what one considers to be
"consistent", nich
The thing is that for na.rm=TRUE, I would expect the weights corresponding to
the missing x to be removed, as well. Like in weighted.mean. So this one
shouldn't raise an error,density(c(1, 2, 3, 4, 5, NA), na.rm=TRUE, weights=c(1,
1, 1, 1, 1, 1))Or am I missing something?
Ursprüngliche
The behavior is as documented AFAICS.
na.rm
logical; if TRUE, missing values are removed from x. If FALSE any
missing values cause an error.
The default is FALSE.
weights
numeric vector of non-negative observation weights.
NA is not a non-negative numeric.
Bert Gunter
"The trouble with having
Weighted mean behaves differently:
• weight is excluded for missing x
• no warning for sum(weights) != 1
> weighted.mean(c(1, 2, 3, 4), weights=c(1, 1, 1, 1))
[1] 2.5
> weighted.mean(c(1, 2, 3, NA), weights=c(1, 1, 1, 1))
[1] NA
> weighted.mean(c(1, 2, 3, NA), weights=c(1, 1, 1, 1), na.rm=TRUE)
[1
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
11 matches
Mail list logo