Report not found

There was a problem finding this report.
NYC Taxis - Dropoffs by Non-White Percent
June 25, 2014 · Refreshed almost 5 years ago
Description
Shows the median number of dropoffs per 1000 people by Census tract. Census tracts are grouped by the size of their non-white population. Only includes tracts in Manhattan with populations of at least 1,000 people. Only includes trips between June 17 and June 23, 2013.

Collaborators

Run History
SELECT ROUND(non_white_percent*20)/20 AS percent_non_white, COUNT(*) AS number_of_tracts, AVG(trips/population)*1000::FLOAT AS avg_trips_per_1000_people, AVG(CASE WHEN tile = 3 THEN (trips/population)*1000 ELSE NULL END)::FLOAT AS median_trips_per_1000_people FROM (SELECT *, NTILE(5) OVER (PARTITION BY ROUND(non_white_percent*20)/20 ORDER BY (trips/population)*1000) AS tile FROM ( SELECT tract.county, tract.tract_code, income.median_income, people.population, people.white/people.population::FLOAT AS white_percent, people.black/people.population::FLOAT AS black_percent, (people.population - people.white)/people.population::FLOAT AS non_white_percent, COUNT(*) AS trips FROM benn.nyc_taxi_data_june_week taxi JOIN benn.tract_lookup tract ON tract.lat = ROUND(taxi.dropoff_latitude*1000)/1000 AND tract.long = ROUND(taxi.dropoff_longitude*1000)/1000 AND tract.county = 'New York' JOIN benn.nyc_census_tract_incomes income ON income.county = tract.county AND income.tract_number = tract.tract_code AND income.median_income IS NOT NULL JOIN benn.nyc_census_tract_people people ON people.county = tract.county AND people.tract_number = tract.tract_code AND people.population >= 1000 GROUP BY 1,2,3,4,5,6,7 ) a ) z GROUP BY 1 ORDER BY 1 LIMIT 100
SELECT ROUND(non_white_percent*20)/20 AS percent_non_white, COUNT(*) AS number_of_tracts, AVG(trips/population)*1000::FLOAT AS avg_trips_per_1000_people, AVG(CASE WHEN tile = 3 THEN (trips/population)*1000 ELSE NULL END)::FLOAT AS median_trips_per_1000_people FROM (SELECT *, NTILE(5) OVER (PARTITION BY ROUND(non_white_percent*20)/20 ORDER BY (trips/population)*1000) AS tile FROM ( SELECT tract.county, tract.tract_code, income.median_income, people.population, people.white/people.population::FLOAT AS white_percent, people.black/people.population::FLOAT AS black_percent, (people.population - people.white)/people.population::FLOAT AS non_white_percent, COUNT(*) AS trips FROM benn.nyc_taxi_data_june_week taxi JOIN benn.tract_lookup tract ON tract.lat = ROUND(taxi.dropoff_latitude*1000)/1000 AND tract.long = ROUND(taxi.dropoff_longitude*1000)/1000 AND tract.county = 'New York' JOIN benn.nyc_census_tract_incomes income ON income.county = tract.county AND income.tract_number = tract.tract_code AND income.median_income IS NOT NULL JOIN benn.nyc_census_tract_people people ON people.county = tract.county AND people.tract_number = tract.tract_code AND people.population >= 1000 GROUP BY 1,2,3,4,5,6,7 ) a ) z GROUP BY 1 ORDER BY 1
<style> .bar { fill: #3c8e8e; } .axis { font: 12px sans-serif; } .title { font: 16px sans-serif; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; } </style> <body> <div id="chart"></div> <script> draw(); $(window).on("resize",function() { draw() }) function draw() { d3.select("svg").remove(); var margin = {top: 50, right: 20, bottom: 50, left: 70}, width = $(document).width() - margin.left - margin.right, height = 330 - margin.top - margin.bottom; var p = d3.format("%") var x = d3.scale.ordinal() .rangeRoundBands([0, width], .1); var y = d3.scale.linear() .range([height, 0]); var xAxis = d3.svg.axis() .scale(x) .tickFormat(formatX) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .orient("left") .ticks(10); function formatX(d,i) { if (i%2 == 0) { return d; } else { return ""; } } var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); data = dataset.content x.domain(data.map(function(d) { return p(d.percent_non_white); })); y.domain([0, d3.max(data, function(d) { return d.median_trips_per_1000_people; })]); console.log(y.domain()) svg.append("text") .attr("x",(width+margin.left+margin.right)/2 - margin.left) .attr("y",-20) .attr("text-anchor","middle") .attr("class","title") .text("Trips by Non-White Population in Dropoff Area") svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + height + ")") .call(xAxis) .append("text") .attr("transform", "translate(" + width/2 + ",30)") .attr("dy", ".71em") .style("text-anchor", "middle") .text("Percent of population that is non-white");; svg.append("g") .attr("class", "y axis") .call(yAxis) .append("text") .attr("transform", "rotate(-90)") .attr("y", -60) .attr("x",-height/2) .attr("dy", ".71em") .style("text-anchor", "middle") .text("Median dropoffs per 1000 people"); svg.selectAll(".bar") .data(data) .enter().append("rect") .attr("class", "bar") .attr("x", function(d) { return x(p(d.percent_non_white)); }) .attr("width", x.rangeBand()) .attr("y", function(d) { return y(d.median_trips_per_1000_people); }) .attr("height", function(d) { return height - y(d.median_trips_per_1000_people); }); } </script>
{{ dataSourceName(params.queryId) }}

The dataset is too large to view in browser

Export

Looks like something went wrong with your query.

{{ DS.queryRuns[params.queryId].errorMessage }}
This query was cancelled