17
Examining the Examining the Relationship Between Relationship Between Two Variables Two Variables (Bivariate Analyses) (Bivariate Analyses)

Examining the Relationship Between Two Variables

  • Upload
    carlo

  • View
    44

  • Download
    5

Embed Size (px)

DESCRIPTION

Examining the Relationship Between Two Variables. (Bivariate Analyses). What type of analysis?. We have two variables X and Y and we are interested in describing how a response (Y) is related to an explanatory variable (X). - PowerPoint PPT Presentation

Citation preview

Page 1: Examining the Relationship Between Two Variables

Examining the Examining the Relationship Between Relationship Between

Two VariablesTwo Variables(Bivariate Analyses)(Bivariate Analyses)

Page 2: Examining the Relationship Between Two Variables

What type of analysis?What type of analysis?

• We have two variables X and Y and we We have two variables X and Y and we are interested in describing how a are interested in describing how a response (Y) is related to an explanatory response (Y) is related to an explanatory variable (X).variable (X).

• What What graphical displaysgraphical displays do we use to do we use to show the relationship between X and Y ?show the relationship between X and Y ?

• What What statistical analysesstatistical analyses do we use to do we use to summarize, describe, and make summarize, describe, and make inferences about the relationship?inferences about the relationship?

Page 3: Examining the Relationship Between Two Variables

Type of DisplaysType of Displays

Y is Y is ContinuousContinuous

ScatterplotScatterplot Comparative BoxplotComparative Boxplot

Y is Ordinal or Y is Ordinal or Nominal Nominal

Logistic PlotLogistic Plot 2-D Mosaic Plot 2-D Mosaic Plot

X is ContinuousX is Continuous X is Ordinal or X is Ordinal or NominalNominal

Page 4: Examining the Relationship Between Two Variables

Fit Y by X in JMPFit Y by X in JMP

X Variable/PredictorData Type

Y V

ari

ab

le/R

esp

on

seD

ata

Typ

eIn the lower left corner of the Fit Y by X dialog box you will see this graphic which is the same as the more stylized version on the previous slide.

Page 5: Examining the Relationship Between Two Variables

Type of DisplaysType of Displays

Y is Y is ContinuousContinuous

ScatterplotScatterplot Comparative BoxplotComparative Boxplot

Y is Ordinal or Y is Ordinal or Nominal Nominal

Logistic PlotLogistic Plot 2-D Mosaic Plot 2-D Mosaic Plot

X is ContinuousX is Continuous X is Ordinal or X is Ordinal or NominalNominal

Page 6: Examining the Relationship Between Two Variables

Type of AnalysesType of Analyses

Y is Y is ContinuousContinuous

Correlation and Correlation and RegressionRegression- - Parametric or Parametric or NonparametricNonparametric

• If X has k = 2 levels If X has k = 2 levels then then Two-Sample t-Test Two-Sample t-Test or or Wilcoxon Rank Sum Wilcoxon Rank Sum Test.Test.

• If X has k > 2 levels If X has k > 2 levels then then Oneway ANOVA or Oneway ANOVA or Kruskal Wallis Test Kruskal Wallis Test

Y is Ordinal Y is Ordinal or or NominalNominal

• If Y has 2 levels then If Y has 2 levels then use use Logistic Regression Logistic Regression

• If Y has more than 2 If Y has more than 2 levels then use levels then use Polytomous Logistic Polytomous Logistic Regression Regression

• If both X and Y If both X and Y have two have two levels then use levels then use Fisher’s Fisher’s Exact Test, RR/OR, Exact Test, RR/OR, and and Risk Difference/AR Risk Difference/AR• If either X or Y has If either X or Y has more more than two levels use than two levels use a a Chi-square Test. Chi-square Test.• McNemar’s Test McNemar’s Test (dependent)(dependent)

X is ContinuousX is Continuous X is Ordinal or X is Ordinal or NominalNominal

Page 7: Examining the Relationship Between Two Variables

Fit Y by X in JMPFit Y by X in JMP

X continuous X nominal/ordinal

Y n

om

inal/

ord

inal

Y

con

tin

uou

s

Page 8: Examining the Relationship Between Two Variables

Example: Low Birthweight Example: Low Birthweight StudyStudy

(Note: This is not NC one)(Note: This is not NC one)

List of VariablesList of Variables• id – ID # for infant & motherid – ID # for infant & mother• headcirheadcir – head circumference – head circumference

(in.)(in.)• lengleng – length of infant (in.) – length of infant (in.)• weightweight – birthweight (lbs.) – birthweight (lbs.)• gestgest – gestational age (weeks) – gestational age (weeks)• magemage – mother’s age – mother’s age • mnocigmnocig – mother’s – mother’s

cigarettes/daycigarettes/day• mheightmheight – mother’s height (in.) – mother’s height (in.)• mppwtmppwt – mother’s pre- – mother’s pre-

pregnancypregnancy

weight (lbs.)weight (lbs.)

• fagefage – father’s age – father’s age• fedyrsfedyrs – father’s education (yrs.) – father’s education (yrs.)• fnocigfnocig – father’s cigarettes/day – father’s cigarettes/day• fheightfheight – father’s height – father’s height• lowbwtlowbwt – low birth weight – low birth weight

indicatorindicator

(1 = yes, 0 = no)(1 = yes, 0 = no)• mage35mage35 – mother’s age over 35 ? – mother’s age over 35 ?

(1 = yes, 0 = no)(1 = yes, 0 = no)• smokersmoker – mother smoked during – mother smoked during

preg.preg.

(1 = yes, 0 = no)(1 = yes, 0 = no)• SmokerSmoker – mother’s smoking status – mother’s smoking status

(Smoker or Non-smoker)(Smoker or Non-smoker)• Low Birth Weight Low Birth Weight – birth weight– birth weight

(Low, Normal)(Low, Normal)

Continuous Nominal

Page 9: Examining the Relationship Between Two Variables

Example: Low Birthweight Example: Low Birthweight StudyStudy

(Birthweight vs. Gestational Age)(Birthweight vs. Gestational Age)

Y = birthweight (lbs.) Continuous

X = gestational age (weeks)Continuous

Page 10: Examining the Relationship Between Two Variables

Regression and Regression and Correlation Analysis Correlation Analysis

from Fit Y by Xfrom Fit Y by X

Page 11: Examining the Relationship Between Two Variables

Example: Low Birthweight Example: Low Birthweight StudyStudy

(Birthweight vs. Mother’s Smoking (Birthweight vs. Mother’s Smoking Status)Status) Y = birthweight (lbs.)

Continuous

X = mother’s smoking status (Smoker vs. Non-smoker)

Nominal

Page 12: Examining the Relationship Between Two Variables

Independent Samples t-Independent Samples t-Test from Fit Y by X Test from Fit Y by X

Page 13: Examining the Relationship Between Two Variables

Example: Low Birthweight Example: Low Birthweight StudyStudy

(Birthweight Status vs. Mother’s (Birthweight Status vs. Mother’s Cigs/Day)Cigs/Day) Y = birthweight

status(Low, Normal)Nominal

X = mother’s cigs./day Continuous

P(Low|Cigs/Day)

Page 14: Examining the Relationship Between Two Variables

Logistic Regression Logistic Regression from Fit Y by Xfrom Fit Y by X

Page 15: Examining the Relationship Between Two Variables

Example: Low Birthweight Example: Low Birthweight StudyStudy

(Birthweight Status vs. Mother’s (Birthweight Status vs. Mother’s Smoking Status)Smoking Status)Y = birthweight status

(Low, Normal)Nominal

X = mother’s smoking status (Smoker, Non-smoker)Nominal

Page 16: Examining the Relationship Between Two Variables

Independent Samples Independent Samples pp11 vs. vs. pp2 2 - - Fisher’s Exact, Chi-square, Risk Fisher’s Exact, Chi-square, Risk Difference, RR, & ORDifference, RR, & OR

Skipped the arrows this time, everything should self-explanatory. Notice the OR is upside-down and needs reciprocation. OR = 1/.342 = 2.92

Page 17: Examining the Relationship Between Two Variables

SummarySummary

In summary have seen how bivariate In summary have seen how bivariate relationships work in JMP and in relationships work in JMP and in statistics in general.statistics in general.

We know that the type of analysis that We know that the type of analysis that is appropriate depends entirely on the is appropriate depends entirely on the data type of the response (Y) and the data type of the response (Y) and the explanatory variable or predictor (X).explanatory variable or predictor (X).