Re: [R] prop.trend.test question

2023-09-28 Thread peter dalgaard
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()

[R] prop.trend.test question

2023-09-24 Thread tgs77m--- via R-help
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 = " "))

Re: [R] prop.trend.test

2023-09-12 Thread peter dalgaard
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

Re: [R] prop.trend.test

2023-09-08 Thread Ebert,Timothy Aaron
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

Re: [R] prop.trend.test

2023-09-08 Thread Rui Barradas
À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

Re: [R] prop.trend.test

2023-09-08 Thread peter dalgaard
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

Re: [R] prop.trend.test

2023-09-07 Thread Eric Berger
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.

Re: [R] prop.trend.test

2023-09-07 Thread Thomas Subia via R-help
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

Re: [R] prop.trend.test

2023-09-07 Thread Rui Barradas
À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:

Re: [R] prop.trend.test

2023-09-07 Thread Ebert,Timothy Aaron
-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

Re: [R] prop.trend.test

2023-09-07 Thread Michael Dewey
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

[R] prop.trend.test

2023-09-07 Thread Thomas Subia via R-help
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  #

[R] prop.trend.test() and Cochran-Armitage Trend test

2007-12-19 Thread R R
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