Simple SQL and stats / probability
Write a PostgreSQL query that summarizes the observed outcome of each trial group. Calculate the number of non-missing trials, the number of successful trials, and the probability of success. Missing outcomes should not be included in the probability calculation.
trial_grouptrial_group, observed_trials, successful_trials, and success_probabilitysuccess_probability to three decimal placestrial_group| Column | Type | Description |
|---|---|---|
| trial_idPK | INT | Unique identifier for the trial |
| trial_group | VARCHAR(50) | Group assigned to the trial |
| outcome | BOOLEAN | Whether the trial was successful |