Estimating the parameter in a mixed population I have different mixed populations where everyone as received a treatment among a list of treatment (let say Ta, Tb, Tc....). I know how many received each treatment. For each population, I know how many have the outcome O1, O2, O3 and O4. 




Population
Ta
Tb
Tc
....
Tn
O1
O2
O3
O4




1
0.52
0.15
0.1
...
0.05
0.80
0.1
0.02
0.08


2
0.3
0.2
0
...
0.18
0.6
0.3
0.05
0.05


...
...
...
...
...
...
...
...
...
...


m
0.6
0.1
0.2
...
0
0.7
0.2
0.1
0




What I would like to estimate is for each treatment, the probability to have the outcome 1,2,3 or 4.




Treatment
O1
O2
O3
O4




a
0.52
0.15
0.13
0.2


b
0.3
0.2
0
0.5


...
...
...
...
...


n
00
0.1
0.2
0.7




While in my head, it seems a very simple system of equation to solve, I get negative probabilities and probabilities>200 which obviously doesn't seems right.
I have tried to solve it using

*

*linear regression of sk learn

*OLS from statsmodels

*non-negative least square  and lsq_linear (bounded) from scipy

*the close form of the linear regression

Does anyone have an idea how I can solve it?
thanks
Solution:
Using a multinominal logistic regression seems to do the trick with a couple changes:

*

*I have duplicated my dataset for each outcome

*Add a variable with 0,1,2 or 3 ( each number corresponding to one outcome)

*Add another variable 'weight' with the probability of this outcome for that observation


If I'm not mistaken, you have categorical outcomes, one of O1, O2, O3, O4, for each individual. Such data could be handled using multiple logistic regression, available as function multinom in R-package nnet. You may also want to have a look at A. Agresti's book "Categorical Data Analysis".
So I recommend to not use the probabilities as outcomes (I suspect this is what you have done, even though you didn't explain exactly what models you have fitted, i.e., what role which variable had), but rather the actual outcomes O1-O4. As you correctly observed, a linear approach is often not good for probabilities, as probabilities are bounded between 0 and 1 and linear functions will naturally be unbounded, so could easily predict probabilities outside $[0,1]$ (although ">200" looks very strange and makes me suspect you did something else wrong there). Also it would be good to use the information of the actual frequencies of outcomes rather than percentages that ignore them.
