drop function if exists distance;
delimiter /
create function distance (x1 decimal(12, 8),
y1 decimal(12, 8),
x2 decimal(12,8),
y2 decimal(12,8)
returns float(12,4)
language SQL deterministic
BEGIN
declare dlat, dlon, a, c decimal(12,8);
set dlat = (y2-y1
use qac;
select * from airport_codes
where code = 'LGA';
select * from airline_codes
where code = 'OO' or code = 'EV';
select ALINE as airline_name, count(*) as number_of_flights from ontime
group by ALINE;
select ALINE as airline_name, count(*) as number
PROC IMPORT OUT= WORK.GSS_Combined
DATAFILE= "P:\QAC\qac157\DATA\GSSdatafor78_84_94_04_12.dta"
DBMS=stata REPLACE;
RUN;
/* Potential categories to explore:
GUN
EVER THREATENED WITH GUN OR SHOT AT
GUNAGE
THREATENED OR SHOT AT AS CHILD OR ADULT
GUNNUM
IF TH
Hunger map in Panama, number of malnourished children per area
Most mapping in Sociology is neighborhood change
https:/d3n8a8pro7vhmx.cloudfront.net/opencommunitiesalliance/pages/143/attachments/orig
inal/1424375831/State_OppMap.jpg?1424375831
Are curren
Article lets you see how others are using GIS
Read abstract, to figure out what its about
Intro, figures, methods, and scan results
Look with a critical eye, does it portray message
Data of mega churches was on the place level, needed steps to link t
use qac2;
describe ontime2;
select origin, dest,
case
when distance < 400 THEN "Short"
when distance > 1200 THEN "Long"
ELSE "Intermediate"
END as fl_type
from ontime2
limit 20;
select dest, (case
when distance < 400 THEN "Short"
when distance > 1200 THEN
use hw3;
/* Problem 1 */
create table table1 as
select * from lv_biz_cat
where cat = "Korean";
create table table2 as
select * from lv_biz_cat
where cat = "Bars";
create table table3 as
select * from lv_biz_cat
where cat = "Karaoke";
select distinct table
use qac2;
/* Problem 1 */
select count(*) as outdegree_centrality from ontime2
where origin = "BOS";
/* Problem 2 */
create table tmp1 as
select distinct origin, count(*) as outdegree_centrality from ontime2
where aline IN ("DL")
group by origin;
select *
/*
Assignment 1
Please use detailed comments so that someone who has never used SAS before
can understand and follow the program by reading your comments.
Please make sure that you provide enough detail to make this possible.
You may discuss parts of the
/* Importing the data */
PROC IMPORT OUT= WORK.GSS_Combined
DATAFILE= "P:\QAC\qac157\DATA\GSSdatafor78_84_94_04_12.dta"
DBMS=stata REPLACE;
RUN;
/* Potential categories to explore:
GUN
EVER THREATENED WITH GUN OR SHOT AT
GUNAGE
THREATENED OR SHOT AT AS CH
/* Part 1: Recreating a Graph */
LIBNAME ECLIB000 "P:\QAC\qac157\students\mkaparakis\Assignments\asgn4";
/* I created this graph using SAS Enterprise.
Generated on: Tuesday, March 7, 2017 at 9:54:05 PM. */
Legend1
FRAME
;
Axis1
STYLE=1
WIDTH=1
MINOR=NONE
/* Beginning of Part A */
/* Task 1: Import and combine the five different files of Data.
First I imported the four years normally, and then for the unformatted text file
we had to use
infile and input instead. */
PROC IMPORT OUT= WORK.GSS_78_84
DATAFILE=
/* Start of Part B */
/* Since we are specifically told to look at ABANY in relation to DEGREE
and YEAR, I created a dataset that removes missing observations from ABANY
and keeps only the YEAR, ABANY and DEGREE columns. */
data GSS_Fixed_Abany;
set GSS_F
14- Classification Trees
Classification Tree for Titanic
Passengers
Male
not child
Male
3rd class
child
Male
1st or 2nd class
child
Female
3rd class
interaction of
sex, class, and age
Female
1st or 2nd class
Classification trees
Similar to Regression Tree
4-Regression Analysis
Advertising dataset
Advertising <- read.table("Advertising.csv",
header=TRUE, sep=",")
product sales in 200 markets
TV advertising budget
radio advertising budget
newspaper advertising budget
Questions
Is there a relationship between
15- Bagging and Random Forests
Bagging
CART tends to have high variance
Split a data set in two. Fit a tree to each half. You are likely to
get somewhat different trees.
CART tend not to be as accurate as more advanced ML
approaches.
Bagging Boosted Aggre
13- Regression Trees
Regression Tree for mtcars dataset
20
100%
yes
17
66%
cyl >= no
5
root node ( = 20)
inner node
hp >= 192
13
22%
(6 or 8 cyl) AND HP 192
18
44%
(6 or 8 cyl) AND HP < 192
27
34%
4 cyl
terminal
or leaf nodes
Binary trees divide feature s
Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis
3rd Class
6/9/10
Events with a-million-to-one odds happen 295 times a day in America.
Michael Shermer
Why People Believe Weird Things
Last time I asked for a 95% CI for the populati
Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis
6th Class
6/14/10
Statistics are no substitute for judgment.
Henry Clay
Econ 300: hand out review sheet and answer sheet for test and direct to old test on-line
[show overhead re co
Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis
5th Class
6/11/10
No one can possibly win at roulette unless he steals money from the table while the
croupier isn't looking.
Albert Einstein
on Mon. will hand out review sheet (pra
Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis
4th Class
6/10/10
There are two times in a man's life when he should not speculate: when he can't afford it, and
when he can. - Mark Twain
summarizing our important results so far:
Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis
7th Class
6/15/10
The race may not always go to the swift, nor the battle to the strong, but thats the way
to bet it.-Damon Runyon
another take on correlation and causation [show ca
Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis
2nd Class
6/8/10
The statistics you don't compile never lie.
Stephen Colbert
show updated website with workshop dates and times
bring book to class as we will use it often to look a
Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis
9th Class
6/18/10
When it is not in our power to follow what is true, we ought to follow what is most
probable.-Descartes
show results from M&M experiment
[overhead]
sampling distri