
How this is done: open worksheet US map.mtw. Copy-paste columns Longitude and Latitude from US Temperature to US map. Draw scatterplot, overlaid in the same graph
This graph is not very nice because the state borders are just dots, and sometimes there are some spaces between them. It would be much nicer if they were smooth. This turns out to be a bit tricky:
Calc > Calculator, Store in: Latitude Expression: Latitude-1
Make a new column with 56 0's, then copy-paste the three columns on top of the big Longitude-Latitude column in US Map.mtw
Graph > Scatterplot, with connect lines and groups > Y variables= Latitude,X variables=Longitude, group variable Jumps
click on graph, select symbols and choose None
click on graph, select connect lines and choose solid black lines, Options > Connection Order = Worksheet
click on graph, select connect lines for cities only and choose none
Make column with Calc > make patterend data> Text values > store in c7, text values: x, repeat 56 times
right-click, Add > Data Labels, from column c7
Here is the graph:
Step 3: Polynomial models
| Model | p-value of highest order term |
| Quadratic | 0.000 |
| Cubic | 0.000 |
| Power 4 | 0.593 |
1) Make column "NewLong" values -125 to -72 (use make patterned data)
2) Make column "NewLat", same length as NewLong, all 40.8
3) calculate column "NewTemp" with
NewTemp = - 791 - 2.36 * Latitude - 31.2 * 'NewLong' - 0.352 * 'NewLong'**2 - 0.00130 * 'NewLong'**3
Now plot NewTemp vs. NewLong
here is what this look like:
Here is another, more sophisticated way to "visualize" this fit:
1) Generate a fine grid of Latitude and Longitude values covering all of the US. Note that Latitude goes from 26 to 50 and Longitude from -125 to -66. So
Calc > Make Patterned Data > Simple set of numbers, Store Patterned data in: NewLat, From first value= 26, To last value= 50, in steps of=1, List each value 60 time, List whole whole sequence: 1
Calc > Make Patterned Data > Simple set of numbers, Store Patterned data in: NewLong, From first value= -125, To last value= -66, in steps of=1, List each value 1 time, List whole whole sequence: 25
2) For each pair of Latitude and Longitude use the model to predict the temperature at the corresponding location:
Calc > Calculator, Store in: NewTemp, Expression: NewTemp = - 791 - 2.36 * NewLat - 31.2 * 'NewLong' - 0.352 * 'NewLong'**2 - 0.00130 * 'NewLong'**3
3) Color-code the temperature as follows: Red=hot to Blue=Cold
Note that the NewTemp values go from -10 to 87. We split that up into 5 intervals: -10-10, 10-30, 30-50, 50-70, 70-90
all the rows with Newtemp>10 get a 1: Calc > Calculator, Store in: c9 Expression: Newtemp>10
all the rows with Newtemp>30 get a 1: Calc > Calculator, Store in: c10 Expression: Newtemp>30
all the rows with Newtemp>50 get a 1: Calc > Calculator, Store in: c11 Expression: Newtemp>50
all the rows with Newtemp>70 get a 1: Calc > Calculator, Store in: c12 Expression: Newtemp>70
Now add them up:
Calc > Calculator, Store in: TempCode, Expression: c9+c10+c11+c12+1
Graph > Scatterplot, with groups > Y variables= NewLat, X variables=NewLong, Cat variable: TempCode
Often the color blue is used for cold and red for hot. So change the colors to reflect the temperature
Fix it up a bit, for example add a legend
Here is what that looks like:
