Analysis of proportions over time
Analysis of proportions over time
Loading saved threads...
Kevin Pei · External communityPost link
External question — Cross Validated Stack Exchange
Author: Kevin Pei
Original post: https://stats.stackexchange.com/questions/104458
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
My knowledge of statistics is limited and I am looking for resources to read on the matter if possible.
Anyways, I am currently trying to estimate a confidence interval for a proportion over time. The specific example pertains to a trader's Win % as he make more trades. My current idea is to take the first
$n$
sample data to calculate a proportion, then see how that changes over the amount of trades. I want to ultimately calculate the variability of the win %. My confidence interval would be calculated as such:
$$p \pm \sqrt[2]{\frac{1}{n} \times p(1-p)}$$
I know this is clearly the wrong approach to look into but I would appreciate it if I am pointed to in the right direction.
Quote
Report
Denis Cousineau · External communityPost link
External answer — Cross Validated Stack Exchange
Author: Denis Cousineau
Original post: https://stats.stackexchange.com/a/658457
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
When a proportion is transformed using the Anscombe transform
$A$
, its sampling distribution is normal (for
$n$
larger than 20) and its standard error is theoretically given to be (
Anscombe, 1948
) :
$$SE_A = 1/\sqrt{4(n+1/2)}.$$
The Anscombe transform is a variation of the arcsine transform given by
$$A(s, n) = \sin^{-1}\left(\sqrt{\frac{s+3/8}{n+3/4}}\right)$$
where
$s$
is the number of wins, and
$n$
is the total number of play.
This transform returns scores between
$0$
and
$\pi/2 \approx 1.57$
(instead of between 0 and 1 for the proportion
$s/n$
).
Consequently, the confidence interval of
$A(s,n)$
is obtained with a
$z$
critical value,
$$\left[ A - z_{1/2-\gamma/2}, \;\;A + z_{1/2+\gamma/2} \right]$$
where
$\gamma$
(typically .95) is the confidence level desired (
Laurencelle & Cousineau, 2023
).
In a final step, you can reverse the function
$A$
on the confidence limits to obtain the confidence interval of your proportion, or if used in a plot, use an arcsine scale. This last step is automatized if you are using R's library of mine
ANOPA
and its function
anopaPlot()
(see this vignette
here
).
Quote
Report
AdamO · External communityPost link
External answer — Cross Validated Stack Exchange
Author: AdamO
Original post: https://stats.stackexchange.com/a/676913
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
The data setup you describe is a time series of wins (and losses) indexed by time. We can assume there are no ties here, or even if there are it shouldn't matter unless there are context specific reasons to refine any proposed approach further.
A pragmatic approach, and perhaps a springboard for investigation, to this issue is to just fit a logistic model with time as a covariate. Input time as a linear coefficient, and then the regression bands provide a confidence interval for the win probability at any point in time. In fact, the significance test for the time component is commonly referred to as the Cochran Armitage test of trend.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Cross Validated Stack Exchange Author: AdamO Source score (net votes, not local likes): 2 Original post: https://stats.stackexchange.com/a/676913 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. The data setup you describe is a time series of wins (and losses) indexed by time. We can assume there are no ties here, or even if there are it shouldn't matter unless there are context specific reasons to refine any proposed approach further. A pragmatic approach, and perhaps a springboard for investigation, to this issue is to just fit a logistic model with time as a covariate. Input time as a linear coefficient, and then the regression bands provide a confidence interval for the win probability at any point in time. In fact, the significance test for the time component is commonly referred to as the Cochran Armitage test of trend.
Checking account access…