Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cgwpgsd #44

Merged
merged 11 commits into from
Aug 26, 2024
Merged

Cgwpgsd #44

merged 11 commits into from
Aug 26, 2024

Conversation

guangguangzai
Copy link
Collaborator

The file is for wpgsd correlation calculation

Copy link
Collaborator

@LittleBeannie LittleBeannie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @guangguangzai , please find my comments below, and we can catch up tomorrow.


## Examples

In a 2-arm controlled clinical trial example with one primary endpoint, there are 3 patient populations defined by the status of two biomarkers A and B:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please cite where this example is from.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cite paper, example 1

tab_header(title = "Number of events at each population")
```

### Example 1 - Same Analyses Different Population
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we call it "Correlation of different populations within the same analysis"?

round(Corr1, 2)
```

### Example 2 - Same Population Different Analyses
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we call it "Correlation of different analyses within the same population"?

tab_header(title = "Number of events at each analyses in example 2")
```
The the corrleation could be simply calculated as
$$Corr(Z_{11},Z_{12})=\frac{100}{\sqrt{100*200}}=0.71$$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain the 100 at the numerator.

Corr1 <- 100 / sqrt(100 * 200)
round(Corr1, 2)
```
### Example 3 - Cross Population Cross Analyses
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we call it "Correlation of different analyses and different population"?

```
Now we know how to calculate the correlation values under different situations, and the generate_corr function was built based on this logic. We can directly calculate the results for each cross situation via the function.

First, we need a event table including the information of the cohort.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word "cohort" is confusing...

gt() %>%
tab_header(title = "Number of events at each population & analyses")
```
"H1" indicates that the experimental treatment is superior to the control in population 1/experimental arm 1. "H2" indicates that the experimental treatment is superior to the control in population 2/experimental arm 2. "Analysis" refers to different stages of analysis, such as 1 for interim analysis and 2 for final analysis. "Event" represents the number of events in this condition.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph looks not correct to me... H1 is 1 hypothesis, H2 is the other hypothesis. Event is the common events overlap by H1 and H2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

H1 could be the anyone from the hypotheses, listed in the multiplicity/to be tested, depending on the one interested.

```
"H1" indicates that the experimental treatment is superior to the control in population 1/experimental arm 1. "H2" indicates that the experimental treatment is superior to the control in population 2/experimental arm 2. "Analysis" refers to different stages of analysis, such as 1 for interim analysis and 2 for final analysis. "Event" represents the number of events in this condition.

For example: H1=1, H2=1, Analysis=1, Event=100 indicates that in the first population, there are 100 cases where the experimental treatment is superior to the control in the interim analysis.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Echo with my previous comment. We ought to say what is H1=1 means, and then H2 = 1 means first. Then explain what Event is under H1=1 and H2=1.


For example: H1=1, H2=1, Analysis=1, Event=100 indicates that in the first population, there are 100 cases where the experimental treatment is superior to the control in the interim analysis.

Another example: H1=1, H2=2, Analysis=2, Event=160 indicates that the number of overlapping cases where the experimental treatment is superior to the control in population 1 and 2 in the final analysis is 160.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Echo with my previous comment.

*To be noticed, the column names in this function are fixed to be 'H1, H2, Analysis, Event'.
After we have the event table, we can use generate_corr function to calculate correlation.

```{r}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we will no longer need the things after line 150, right?

Copy link
Collaborator

@LittleBeannie LittleBeannie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @guangguangzai! Thanks for the revision. The vignette looks great and I only have few editorial comments below.

@@ -47,7 +51,7 @@ event_tb %>%
tab_header(title = "Number of events at each population")
```

### Example 1 - Same Analyses Different Population
### Example 1 - Correlation of different populations within the same analysis
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we delete "Example 1"?

@@ -18,7 +19,7 @@ $$Corr(Z_{ik},Z_{i'k'})=\frac{n_{i \wedge i',k \wedge k'}}{\sqrt{n_{ik}*n_{i'k'}

## Examples

In a 2-arm controlled clinical trial example with one primary endpoint, there are 3 patient populations defined by the status of two biomarkers A and B:
In a 2-arm controlled clinical trial example with one primary endpoint (@anderson_unified_2022), there are 3 patient populations defined by the status of two biomarkers A and B :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be more specific where the example is from, say, which section, which example. Some explanations like, "this example is borrowed from xxx paper" is helpful.

```

### Example 2 - Same Population Different Analyses
Let's consider another simple situation, we want to compare single population, for example population 1, but in different analyses, interim and final analyses. Then $i=1$, and to compare IA and FA, the $k$ will be $k=1$ and $k=2$.
### Example 2 - Correlation of different analyses within the same population
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we delete "Example 2"?

```
### Example 3 - Cross Population Cross Analyses
### Example 3 - Correlation of different analyses and different population
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we delete "Example 3"?

@@ -66,197 +70,90 @@ event_tbl %>%
The the corrleation could be simply calculated as
$$Corr(Z_{11},Z_{21})=\frac{80}{\sqrt{100*110}}=0.76$$
```{r}
Corr1 <- 80 / sqrt(100 * 110)
round(Corr1, 2)
Corr1=80/sqrt(100*110)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use <- instead of =, for consistency with the entire package. Please check the entire Rmd file for the usage of =.

Now we know how to calculate the correlation values under different situations, and the generate_corr function was built based on this logic. We can directly calculate the results for each cross situation via the function.

First, we need a event table including the information of the cohort.
Now we know how to calculate the correlation values under different situations, and the generate_corr() function was built based on this logic. We can directly calculate the results for each cross situation via the function.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you cite a R function name please use single quotation, i.e., use "generate_corr" install of "generate_corr". Please check the entire of the Rmd file.

@LittleBeannie LittleBeannie merged commit 06db2e7 into main Aug 26, 2024
8 checks passed
@LittleBeannie LittleBeannie deleted the cgwpgsd branch August 26, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants