im having troubles working with probabilities

basically i need to chart the chances of developing heart disease and im confusing myself. say at an 30 years age there a 0.6 chance of getting a disease and a 0.4 of not then at 40 years of age there's a 0.7 chance of it developing and only a 0.3 of not how do i chart this or at lease where should i look for answer's

 채택된 답변

Matt Macaulay
Matt Macaulay 2018년 4월 18일

0 개 추천

You could try a bar chart like this:

clf
chanceDisease = [.6 .7];
age = [30 40];
bar(age, chanceDisease)
set(gca, 'YLim', [0 1])
ylabel('Chance of getting Disease')
xlabel('Age')

댓글 수: 3

that dose help, I wonder if for further detail if theirs a way to plot the population of those who haven't heart disease on one axis ? I thought of using vectors but ive no clue
The 'Stacked' option in the bar function can do this
clf
chanceDisease = [.6 .4; .7 .3];
age = [30 40];
bar(age, chanceDisease, 'Stacked')
set(gca, 'YLim', [0 1])
ylabel('Chance of getting Disease')
xlabel('Age')
its getting closer... after your help i this the better graph in the long run would have to be one that is plotting the total population that has the Disease with a percentage of this population dying/ getting cured and then having some kind of function to predict this population based on the desired amount of years? I'm really not sure I've confuse myself thank you for you help !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Biological and Health Sciences에 대해 자세히 알아보기

질문:

2018년 4월 18일

댓글:

2018년 4월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by