Posts

Prompt Engineering for Chatgpt (5)

Image
Format of the Game Play Pattern To use this pattern, your prompt should make the following fundamental contextual statements: Create a game for me around X OR we are going to play an X game One or more fundamental rules of the game You will need to replace "X" with an appropriate game topic, such as "math" or "cave exploration game to discover a lost language". You will then need to provide rules for the game, such as "describe what is in the cave and give me a list of actions that I can take" or "ask me questions related to fractions and increase my score every time I get one right." Examples: Create a cave exploration game for me to discover a lost language. Describe where I am in the cave and what I can do. I should discover new words and symbols for the lost civilization in each area of the cave I visit. Each area should also have part of a story that uses the language. I should have to collect all the words and symbols to be able ...

The difference between MMRM with vs without random effects

  🧠 Short Answer Model Type Random Effect Included? Type of Model Assumes Subject-specific Trajectories? Typical Use MMRM ❌ No Marginal model ❌ No Regulatory trials (e.g. FDA) Linear Mixed Model (LME) ✅ Yes Conditional model ✅ Yes Academic studies, hierarchical modeling 🔍 MMRM = No Random Effects ✅ Standard MMRM (FDA-favored) Marginal model : estimates population-average effects. Uses a repeated statement in SAS (or nlme::gls() in R). Models the within-subject covariance directly (e.g., UN, AR(1), CS). Assumes no subject-specific random intercepts/slopes. ➕ Pros: Very flexible in modeling within-subject correlations . Doesn't assume normally distributed random effects. Performs well under MAR with dropout. Standard in late-phase clinical trials and regulatory submissions . ➖ Cons: Can become unstable with too many timepoints (e.g., unstructured covariance). Cannot model subject-level variation (e.g., random slopes). 📘 Example in ...

Use FDA Suggestions on Missing Data and Sensitivity Analyses

  The U.S. FDA provides guidance and expectations on how to handle missing data in clinical trials, especially in the context of estimands and sensitivity analyses . Below is a detailed summary based on key regulatory documents and practices. 📘 1. Key FDA Guidance Documents A. FDA (2019): "Estimands and Sensitivity Analyses in Clinical Trials" Focus: Aligning analysis with the trial objective and handling intercurrent events , like treatment discontinuation or dropout. Introduces the estimand framework from ICH E9(R1). Emphasizes sensitivity analysis under plausible MNAR assumptions. 🔗 Link: FDA Estimand Guidance (PDF) 📌 2. FDA Expectations at a Glance Topic FDA View Primary analysis Can assume MAR (e.g., MMRM) if justified Sensitivity analysis Must explore MNAR scenarios (not just MAR) Multiple imputation Acceptable if properly implemented Pattern-mixture models Encouraged as part of sensitivity analyses Reference-based imputation (CIR, J2R) Inc...

Understanding covariance in MMRM

🔑 1. Within-Subject Covariance (Repeated Measures Covariance) This is the main type of covariance modeled in MMRM. ➤ What it is: The correlation of repeated measurements within the same subject over time. It captures how a subject’s outcome at Week 12, Week 24, Week 48, etc., are related to each other . ➤ How it’s handled: This is modeled using the REPEATED statement in SAS (or nlme::lme in R). You specify a covariance structure , such as: Covariance Structure Description UN (Unstructured) Every timepoint has its own variance; all pairwise covariances are estimated. Very flexible but high parameter count. CS (Compound Symmetry) Constant variance and constant correlation between any two visits. AR(1) Correlation declines as timepoints are further apart (auto-regressive). TOEP (Toeplitz) Fixed correlation pattern depending on lag between visits. VC (Variance Components) No correlation, but separate variances per visit. FA (Factor Analytic) Parsimonious alternati...

How MMRM Handles Missing Data ?

  1. Assumes MAR (Missing At Random) This is a key assumption . MAR means: The probability that data are missing depends only on observed data , not on the unobserved (missing) values. 📌 Example : If patients with worse baseline scores are more likely to drop out, but you include baseline scores as a covariate in your model, then the missingness mechanism is MAR. 2. Uses All Available Data Unlike methods like LOCF (Last Observation Carried Forward), MMRM does not impute missing values directly . Instead: It uses all observed values for each participant It models the mean structure and the covariance structure across visits This allows the model to make informed inferences about the treatment effect at each time point, even if some patients missed visits. 3. Estimation Method: REML or ML MMRM typically uses: REML (Restricted Maximum Likelihood) for unbiased variance component estimation ML (Maximum Likelihood) if comparing nested models These m...