Version 2 (groups & weights) - Dataset Analysis
Analyze data in a dataset. The dataset explore pages in this website use this API method to get the results of the analysis.
URL
To call this method, use an HTTP GET request to the following URL:
where:
- [locale] = the locale of the language you want the data to be returned in (currently ka for Georgian or en for English)
Required Parameters
The following parameters must be included in the request:
Parameter | Description |
---|---|
access_token | All requests must include an access_token. You can obtain an access token easily, and for free, by going here. |
dataset_id | The ID of the dataset. |
question_code | The code of a question in the dataset. |
Optional Parameters
There following parameters are optional for this call.
Parameter | Description |
---|---|
language | Code of the language to return the dataset information in (e.g., 'en' for English). If language is not provided, the default language of the dataset will be used. |
broken_down_by_code | Code of question to compare against question_code (i.e., a crosstab analysis) |
filtered_by_code | Code of question to filter the analysis by |
weighted_by_code | Code of question to weight the analysis by. If no value is given and the dataset has a default weight, the weight will automatically be used. If you want an unweighted analysis, use the value 'unweighted'. |
can_exclude | Boolean flag indicating if answers that can be excluded should be excluded (default value is false). Example of excluded answers are 'Do not know' and 'Refuse to answer'. |
with_title | Boolean flag indicating if titles summarizing the data should be included (default value is false) |
with_chart_data | Boolean flag indicating if the results should include data formatted for a Highcharts chart (default value is false) |
with_map_data | Boolean flag indicating if the results should include data formatted for a Highmaps map (default value is false) |
What You Get
The return object is a JSON object of the dataset analysis with the following information:
Parameter | Description |
---|---|
dataset |
An object with the following values:
|
question |
An object with the following values:
|
broken_down_by |
Only if broken_down_by_code was provided. An object with the following values:
|
filtered_by |
Only if filtered_by_code was provided. An object with the following values:
|
weighted_by |
Only if weighted_by_code we provided or the dataset has a default weight and no weight was provided. An object with the following values:
|
analysis_type |
Indicates what type of analysis was performed:
|
results |
An object containing the results of the analysis with the following information:
If broken_down_by_code was provided, the analysis results will have the following information:
If filtered_by_code was provided, the analysis results will have the following information:
If broken_down_by_code and filtered_by_code were provided, the analysis results will have the following information:
|
chart |
Only if with_chart_data was true. An object with the following values:
|
map |
Only if with_map_data was true. An object with the following values:
|
Examples
Example 1
Here is an example of analyzing the results of Gender with the following url:
{ dataset: { id: "1111111111", title: "This is a dataset!" }, question: { code: "gender", original_code: "GENDER", text: "What is your gender?", is_mappable: false, answers:[ { value: "1", text: "Male", can_exclude: false, sort_order: 1 }, { value: "2", text: "Female", can_exclude: false, sort_order: 2 }, { value: "3", text: "Refuse to Answer", can_exclude: true, sort_order: 3 } ] }, analysis_type: "single", results: { total_responses: 234, analysis: [ { answer_value: '1', answer_text: 'Male', count: 134, percent: 57.26 }, { answer_value: '2', answer_text: 'Female', count: 98, percent: 41.88 }, { answer_value: '3', answer_text: 'Refuse to Answer', count: 2, percent: 0.85 } ] } }
Example 2
Here is an example of analyzing the results of Gender, broken down by Live:
{ dataset: { id: "1111111111", title: "This is a dataset!" }, question: { code: "gender", original_code: "GENDER", text: "What is your gender?", is_mappable: false, answers:[ { value: "1", text: "Male", can_exclude: false, sort_order: 1 }, { value: "2", text: "Female", can_exclude: false, sort_order: 2 }, { value: "3", text: "Refuse to Answer", can_exclude: true, sort_order: 3 } ] }, broken_down_by: { code: "live", original_code: "LIVE", text: "Where do you live?", is_mappable: false, answers:[ { value: "1", text: "Tbilisi", can_exclude: false, sort_order: 1 }, { value: "2", text: "London", can_exclude: false, sort_order: 2 }, { value: "3", text: "New York City", can_exclude: false, sort_order: 3 } ] }, analysis_type: "comparative", results: { total_responses: 234, analysis: [ { answer_value: '1', answer_text: 'Male', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 30, percent: 22.39 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 40, percent: 29.85 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 64, percent: 47.76 } ] }, { answer_value: '2', answer_text: 'Female', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 18, percent: 18.37 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 35, percent: 35.71 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 45, percent: 45.92 } ] }, { answer_value: '3', answer_text: 'Refuse to Answer', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 0, percent: 0 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 0, percent: 0 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 2, percent: 100 } ] } ] } }
Example 3
Here is an example of analyzing the results of Gender, filtered by Age:
{ dataset: { id: "1111111111", title: "This is a dataset!" }, question: { code: "gender", original_code: "GENDER", text: "What is your gender?", is_mappable: false, answers:[ { value: "1", text: "Male", can_exclude: false, sort_order: 1 }, { value: "2", text: "Female", can_exclude: false, sort_order: 2 }, { value: "3", text: "Refuse to Answer", can_exclude: true, sort_order: 3 } ] }, filtered_by: { code: "age", original_code: "AGE", text: "What is your age?", is_mappable: false, answers:[ { value: "1", text: "< 18", can_exclude: false, sort_order: 1 }, { value: "2", text: "18-65", can_exclude: false, sort_order: 2 }, { value: "3", text: "> 65", can_exclude: false, sort_order: 3 } ] } analysis_type: "single", results: { filter_analysis: [ { filter_answer_value: '1', fitler_answer_text: '< 18', filter_results: { total_responses: 23, analysis: [ { answer_value: '1', answer_text: 'Male', count: 15, percent: 65.22 }, { answer_value: '2', answer_text: 'Female', count: 8, percent: 34.78 }, { answer_value: '3', answer_text: 'Refuse to Answer', count: 0, percent: 0 } ] } }, { filter_answer_value: '2', fitler_answer_text: '18-65', filter_results: { total_responses: 196, analysis: [ { answer_value: '1', answer_text: 'Male', count: 100, percent: 51.02 }, { answer_value: '2', answer_text: 'Female', count: 94, percent: 47.96 }, { answer_value: '3', answer_text: 'Refuse to Answer', count: 2, percent: 1.02 } ] } }, { filter_answer_value: '3', fitler_answer_text: '> 65', filter_results: { total_responses: 15, analysis: [ { answer_value: '1', answer_text: 'Male', count: 6, percent: 40 }, { answer_value: '2', answer_text: 'Female', count: 9, percent: 60 }, { answer_value: '3', answer_text: 'Refuse to Answer', count: 0, percent: 0 } ] } } ] } }
Example 4
Here is an example of analyzing the results of Gender, broken down by Live, filtered by Age:
{ dataset: { id: "1111111111", title: "This is a dataset!" }, question: { code: "gender", original_code: "GENDER", text: "What is your gender?", is_mappable: false, answers:[ { value: "1", text: "Male", can_exclude: false, sort_order: 1 }, { value: "2", text: "Female", can_exclude: false, sort_order: 2 }, { value: "3", text: "Refuse to Answer", can_exclude: true, sort_order: 3 } ] }, broken_down_by: { code: "live", original_code: "LIVE", text: "Where do you live?", is_mappable: false, answers:[ { value: "1", text: "Tbilisi", can_exclude: false, sort_order: 1 }, { value: "2", text: "London", can_exclude: false, sort_order: 2 }, { value: "3", text: "New York City", can_exclude: false, sort_order: 3 } ] }, filtered_by: { code: "age", original_code: "AGE", text: "What is your age?", is_mappable: false, answers:[ { value: "1", text: "< 18", can_exclude: false, sort_order: 1 }, { value: "2", text: "18-65", can_exclude: false, sort_order: 2 }, { value: "> 65", text: "New York City", can_exclude: false, sort_order: 3 } ] } analysis_type: "comparative", results: { filter_analysis: [ { filter_answer_value: '1', fitler_answer_text: '< 18', filter_results: { total_responses: 23, analysis: [ { answer_value: '1', answer_text: 'Male', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 2, percent: 15.38 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 5, percent: 38.46 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 6, percent: 46.15 } ] }, { answer_value: '2', answer_text: 'Female', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 2, percent: 20 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 4, percent: 40 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 4, percent: 40 } ] }, { answer_value: '3', answer_text: 'Refuse to Answer', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 0, percent: 0 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 0, percent: 0 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 0, percent: 0 } ] } ] } }, { filter_answer_value: '2', fitler_answer_text: '18-65', filter_results: { total_responses: 196, analysis: [ { answer_value: '1', answer_text: 'Male', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 25, percent: 25 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 35, percent: 35 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 40, percent: 40 } ] }, { answer_value: '2', answer_text: 'Female', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 20, percent: 23.4 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 30, percent: 31.91 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 44, percent: 46.81 } ] }, { answer_value: '3', answer_text: 'Refuse to Answer', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 0, percent: 0 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 0, percent: 0 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 2, percent: 100 } ] } ] } }, { filter_answer_value: '3', fitler_answer_text: '> 65', filter_results: { total_responses: 15, analysis: [ { answer_value: '1', answer_text: 'Male', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 1, percent: 12.5 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 3, percent: 37.5 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 4, percent: 50 } ] }, { answer_value: '2', answer_text: 'Female', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 1, percent: 14.29 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 3, percent: 42.86 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 3, percent: 42.86 } ] }, { answer_value: '3', answer_text: 'Refuse to Answer', broken_down_results: [ { broken_down_answer_value: '1', broken_down_answer_text: 'Tbilisi', count: 0, percent: 0 }, { broken_down_answer_value: '2', broken_down_answer_text: 'London', count: 0, percent: 0 }, { broken_down_answer_value: '3', broken_down_answer_text: 'New York City', count: 0, percent: 0 } ] } ] } } ] } }
- Dataset Catalog
- Dataset Details
- Dataset Codebook
- Dataset Analysis
- Time Series Catalog
- Time Series Details
- Time Series Codebook
- Time Series Analysis