You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using mrgsolve for the purpose of simulation and I want like to calculate the cumulative proportion of patients with the occurrence of an event based on a simulation. I was expecting the output to look something like
However, the result I am seeing are something different
Although the question, is not directly related mrgsolve, can anyone kindly help me with this ?
Finally, is there any way to set up a calculation like this during the simulation rather than post processing ?
Thank you,
Code for plot 2 :
G3=event (0= NO/1=YES) # #either zero or 1 depending on the event occurred or not
cumulative_data <- cum %>%
group_by(TRT, time) %>%
summarise(cumulative_events = sum(na.omit(G3))) %>%
group_by(TRT) %>%
arrange(TRT, time) %>%
mutate(cumulative_proportion = cumsum(cumulative_events) / sum(cumulative_events))
cumulative_data<-cumulative_data %>% mutate(Week=round(time/168,0))
cumulative_data_prop <- cumulative_data %>%
group_by(Week,TRT) %>%
summarise(PROP_1 = mean(cumulative_proportion,na.rm=T),
n = n()) %>%
select(DOSEMGKG, PROP_1,n)
ggplot()+geom_line(data=cumulative_data,aes(x=Week,y=cumulative_proportion,color=factor(TRT)))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am using mrgsolve for the purpose of simulation and I want like to calculate the cumulative proportion of patients with the occurrence of an event based on a simulation. I was expecting the output to look something like
However, the result I am seeing are something different
Although the question, is not directly related mrgsolve, can anyone kindly help me with this ?
Finally, is there any way to set up a calculation like this during the simulation rather than post processing ?
Thank you,
Code for plot 2 :
Beta Was this translation helpful? Give feedback.
All reactions