In a word: Yes.
We discussed this about 2w ago. Basically, the lm() fits a local Linear
Probability Model and the coef to "score" gives you the direction of the effect.
In the same thread it was discussed (well, readable between the lines, maybe)
that if you change the lm() to a Gaussian glm()
Colleagues,
The code for prop.trend.test is given by:
function (x, n, score = seq_along(x))
{
method <- "Chi-squared Test for Trend in Proportions"
dname <- paste(deparse1(substitute(x)), "out of",
deparse1(substitute(n)),
",\n using scores:", paste(score, collapse = " "))
Argh, yes, drats, thanks.
There will be a matter of an estimated residual error.
So
> coef(summary(ht$lmfit))["score","t value"]*sigma(ht$lmfit)
[1] -2.867913
matches the signes square root of the Chi-square.
Or, likely better (avoid 0 df cases), switch to a Gaussian glm fit and use the
z
and
locations. High worker turnover may also be an issue.
Tim
-Original Message-
From: R-help On Behalf Of Rui Barradas
Sent: Friday, September 8, 2023 6:53 AM
To: peter dalgaard ; Thomas Subia
Cc: R. Mailing List
Subject: Re: [R] prop.trend.test
[External Email]
Às 10:06 de 08/09/2023
Às 10:06 de 08/09/2023, peter dalgaard escreveu:
Yes, this was written a bit bone-headed (as I am allowed to say...)
If you look at the code, you will see inside:
a <- anova(lm(freq ~ score, data = list(freq = x/n, score =
as.vector(score)),
weights = w))
and the lm() inside
Yes, this was written a bit bone-headed (as I am allowed to say...)
If you look at the code, you will see inside:
a <- anova(lm(freq ~ score, data = list(freq = x/n, score =
as.vector(score)),
weights = w))
and the lm() inside should give you the direction via the sign of the
You might want to consider exponential smoothing models such as Holt's
(Double Exponential Smoothing).
This method continually updates the trend parameter, and you can
monitor the most recent value (for sign, or magnitude, or both).
In R, some choices to fit the Holt model:
1.
Colleagues,
Thanks all for the responses.
I am monitoring the daily total number of defects per sample unit.
I need to know whether this daily defect proportion is trending upward (a bad
thing for a manufacturing process).
My first thought was to use either a u or a u' control chart for
Às 14:23 de 07/09/2023, Thomas Subia via R-help escreveu:
Colleagues
Consider
smokers <- c( 83, 90, 129, 70 )
patients <- c( 86, 93, 136, 82 )
prop.trend.test(smokers, patients)
Output:
Chi-squared Test for Trend inProportions
data: smokers out of patients ,
using scores:
-help On Behalf Of Michael Dewey
Sent: Thursday, September 7, 2023 11:52 AM
To: Thomas Subia ; R. Mailing List
Subject: Re: [R] prop.trend.test
[External Email]
Dear Thomas
Are you looking for more than
smokers / patients
Michael
On 07/09/2023 14:23, Thomas Subia via R-help wrote
Dear Thomas
Are you looking for more than
smokers / patients
Michael
On 07/09/2023 14:23, Thomas Subia via R-help wrote:
Colleagues
Consider
smokers <- c( 83, 90, 129, 70 )
patients <- c( 86, 93, 136, 82 )
prop.trend.test(smokers, patients)
Output:
Chi-squared Test for
Colleagues
Consider
smokers <- c( 83, 90, 129, 70 )
patients <- c( 86, 93, 136, 82 )
prop.trend.test(smokers, patients)
Output:
Chi-squared Test for Trend inProportions
data: smokers out of patients ,
using scores: 1 2 3 4
X-squared = 8.2249, df = 1, p-value = 0.004132
#
Hi,
I was just wondering if prop.trend.test() is equivalent to the
Cochran-Armitage Trend test?
Thank you!
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
13 matches
Mail list logo