fit y-by-x a tutorial - jmp user community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30...

8
Fit Y-by-X a Tutorial Karen Copeland, Ph.D. Discovery 2014

Upload: others

Post on 13-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

Fit Y-by-X a Tutorial Karen Copeland, Ph.D. Discovery 2014

Page 2: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

Outline of Tutorial • Start with data from the Boulder flood to:

•  Import data from text file •  Explore the Fit Y-by-X platform (Bivariate)

• Generate fictitious (simulated) data to: •  Continue to explore the Fit Y-by X platform (One-Way, Logistic,

Contingency)

• Along the way we will explore JMP gems •  Table Features: filters, summarize •  Column Features: properties, initialization, formulas, labels, viewer •  Row Features: color/mark by, next selected, matching, labels •  Interactive Features: adding columns from selected data, copying axis

settings, copying frame contents, customizing platforms

Page 3: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

Live Demo….

Page 4: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

Daily Precip from 1887 for Boulder Co• File>Open>Boulder Rain from 1887.txt (Open As: Data using preview)

• Use "right click>select matching cell>control x" to remove -998 (from precip column)• plot precip by mon

• set auto recalc (red triangle>script>automatic recalc)• highlight a problem value• use next slected (Rows>Next Selected)• remove matching cells (control x)• hover over point• make year a label (Columns>Label)• use select to see # of points• pin• swap x and y• add local data filter (red triangle>script>local data filter) and explore amounts and years.

Local Data Filter297 matching rows

1914 ≤ year ≤ 2014

1 ≤ precip ≤ 9.08

Bivariate Fit of precip By mon

0123456789

10

prec

ip

1 2 3 4 5 6 7 8 9 10 11 12mon

Page 5: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

8 Days of Rain Formula

• Add a new column (menu or double click to right of last column)• Add a new formula (menu or right click on column heading)• Summation( i = Row() - 8, Row(), :precip[i, Empty()] )

Local Data Filter42974 matching rows

0 ≤ 8 Days of Rain ≤ 17.15

Bivariate Fit of 8 Days of Rain By year

0123456789

1011121314151617

8 D

ays

of R

ain

1900 1920 1940 1960 1980 2000year

Page 6: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

SV and BC Hourly Sept 2013• Ht by Date/Time• Select and then right click>Name Selection in Column• Row>Color or Mark by Column• Show Column Viewer

Bivariate Fit of BC GAGE_HT (ft) By Date/Time

0

1

2

3

4

5

6

7

BC G

AGE_

HT

(ft)

2013/08/31 12:00 AM 2013/09/09 12:00 AM 2013/09/15 12:00 AM 2013/09/21 12:00 AM 2013/09/27 12:00 AMDate/Time

Page 7: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

Build a Simulated Diagnostic Data Set• File>New Table• Rows>Add Rows...100• Column Info (Diagnosis: Character) >Initialize Data (Sequence Data: Positive, Negative)• Add Column (SID: numeric)>Initialize Data (sequence)• Add Column (Result: numeric)>Formula• Formula: Match( :Diagnosis,

"Negative", Random Lognormal( 1.3, 0.5 ),"Positive", Random Normal() * 2 + 8,Empty(), Empty()

)• Add Column (Test Outcome: character)>Formula• Formula: If( :Result < 4,

"Neg","Pos"

)• Add Column (Group: numeric)> Initialize Data (random indicator)• Column Properties > Character• Columns>Recode

Page 8: Fit Y-by-X a Tutorial - JMP User Community...0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 0.10 0.30 0.50 0.70 0.90 1-Specificity False Positive 0.00 0.25 0.50 0.75 1.00 s 2 4 6 8

True

Pos

itive

Sens

itivi

ty

0.000.100.200.300.400.500.600.700.800.901.00

0.10 0.30 0.50 0.70 0.901-Specificity

False Positive

0.00

0.25

0.50

0.75

1.00

Diagnosis

2 4 6 8 10 12 14Result

Negative

Positive

More Fit Y by X• Nominal by Nominal = Mosaic

• Nominal by Continuous = Logistic• Right Click > Customize...• Red Triangle>ROC Curve• Right Click > Customize...use script• Right Click> Copy Frame Contents

• Continous by Nominal = Oneway• t-tests• ANOM (Analysis of Means)• Other multiple comparison tests• Summary stats