quadstat-8.x-1.x-dev/config/install/webform.webform.median.yml
config/install/webform.webform.median.yml
langcode: en
status: open
dependencies: { }
open: null
close: null
weight: 0
uid: 1
template: false
archive: false
id: median
title: Median
description: 'Shows how to compute the median (the middle number) using any Quadstat dataset.'
category: ''
elements: "barplot_help:\n '#type': processed_text\n '#text': '<p>Please see the <a href=\"/app/median\">full application</a> for additional options and documentation.</p>'\n '#format': full_html\ninline_data:\n '#type': textarea\n '#title': 'Inline Data'\n '#placeholder': 'X,1,2,3'\n '#format_items': comma\n '#access_update_roles': { }\noutput:\n '#type': textarea\n '#title': Output\n '#default_value': 'No output was generated.'\n '#access_create_roles': { }\n '#access_update_roles': { }\nr:\n '#type': textarea\n '#title': R\n '#required': true\n '#default_value': \"print(\\\"[h2]Computing the Median[/h2]\\\");\\r\\n\\r\\nprint(paste0(\\\"[p]To compute the median, we must first list all the sorted observations in column [code]\\\", colnames(X), \\\"[/code] like this:[/p]\\\"));\\r\\n\\r\\nX <- sort(X);\\r\\n\\r\\nprint(paste0(\\\"[p]\\\", paste(noquote(X), collapse=\\\", \\\"), \\\".[/p]\\\"));\\r\\n\\r\\nprint(paste0(\\\"[p]Next, we need to count the number of observations. In our case that is \\\", length(X), \\\".[/p]\\\"));\\r\\n\\r\\nprint(paste0(\\\"[p]If the number of observations is odd, we add one and then divide by 2. This is the position of the median counting from the beginning.[/p]\\\"));\\r\\n\\r\\nprint(paste0(\\\"[p]If the number of observations is even, we then take average of the two middle numbers.[/p]\\\"));\\r\\n\\r\\nif (length(X) %% 2 == 1) {\\r\\n print(paste0(\\\"[p]In our case, we have an odd number of observations. So we add 1 and then divide by 2. The median is \\\", (length(X) + 1)/2, \\\" positions from the start of our list. That gives us \\\", median(X), \\\".[/p]\\\"));\\r\\n\\r\\n print(paste0(\\\"[p]\\\", median(X), \\\" is the median.[/p]\\\"));\\r\\n\\r\\n} else {\\r\\n\\r\\n print(paste0(\\\"[p]In our case, the number of observations is even so we need to take an average. We divide the number of observations by 2. That gives us \\\", length(X)/2 , \\\". We then count \\\", length(X)/2, \\\" positions from the left. That number is \\\", X[length(X)/2], \\\". We then average \\\", X[length(X)/2], \\\" with the number immediately to the right which is \\\", X[(length(X)/2) + 1], \\\". The average of these two numbers is the median, \\\", median(X), \\\".[/p]\\\"));\\r\\n\\r\\n}\\r\\n\"\n '#format': raw\n '#format_items': comma\n '#access_create_roles': { }\n '#access_update_roles': { }\nv1:\n '#type': number\n '#title': V1\n '#default_value': '-1'\n '#autocomplete': 'off'\n '#access_update_roles': { }\n '#min': '-1'\n '#step': '1'\n '#required': true\nx:\n '#type': number\n '#title': X\n '#description': 'The Drupal File ID of the selected dataset. The user may load another using the search bar on the operation's page.'\n '#required': true\n '#access_update_roles': { }\n '#min': '1'\n '#step': '1'\nshorten_option:\n '#type': checkbox\n '#title': Shorten\n '#access_update_roles': { }\npdf:\n '#type': checkbox\n '#title': PDF\n '#default_value': '0'\n '#access_update_roles': { }\nlicense:\n '#type': select\n '#title': 'Analysis License'\n '#default_value': no_license\n '#options':\n afl_3.0: 'Academic Free License v3.0'\n apache_2.0: 'Apache License 2.0'\n artistic_2.0: 'Artistic License 2.0'\n bsd_2_clause: 'BSD 2-clause \"Simplified\" License'\n bsd_3_clause: 'BSD 3-clause \"New\" or \"Revised\" License'\n bsd_3_clause_clear: 'BSD 3-clause Clear License'\n bsl_1.0: 'Boost Software License 1.0'\n cc0_1.0: 'Creative Commons Zero v1.0 Universal'\n cc_by_4.0: 'Creative Commons Attribution 4.0'\n cc_by_sa_4.0: 'Creative Commons Attribution Share Alike 4.0'\n cc_by-nc-sa_4.0: 'Creative Commons Attribution NonCommercial ShareAlike 4.0 International'\n ecl_2.0: 'Educational Community License v2.0'\n epl_1.0: 'Eclipse Public License 1.0'\n eupl_1.1: 'European Union Public License 1.1'\n gpl_2.0: 'GNU General Public License v2.0'\n gpl_3.0: 'GNU General Public License v3.0'\n agpl_3.0: 'GNU Affero General Public License v3.0'\n isc: 'ISC License'\n lgpl_2.1: 'GNU Lesser General Public License v2.1'\n lgpl_3.0: 'GNU Lesser General Public License v3.0'\n lppl_1.3c: 'LaTeX Project Public License v1.3c'\n mit: 'MIT License'\n mpl_2.0: 'Mozilla Public License 2.0'\n ms_pl: 'Microsoft Public License'\n ms_rl: 'Microsoft Reciprocal License'\n ncsa: 'University of Illinois/NCSA Open Source License'\n no_license: 'No license (All rights reserved)'\n open_data: 'Open Data Commons Project'\n open_data_public: 'Open Data Commons Public Domain Dedication and Licence'\n open_gov_v1: 'Open Government License v.1'\n open_gov_v2: 'Open Government License v.2'\n osl_3.0: 'Open Software License 3.0'\n postgresql: 'PostgreSQL License'\n public_domain: 'Public Domain'\n unlicense: 'The Unlicense'\n world_bank: 'World Bank Terms of Use'\n zlib: 'zlib License'\n '#access_update_roles': { }\nhtml:\n '#type': webform_document_file\n '#title': 'HTML File'\n '#access_create_roles':\n - administrator\n '#access_update_roles': { }\n '#file_extensions': 'txt html'\npdf_file:\n '#type': webform_document_file\n '#title': 'PDF File'\n '#wrapper_attributes':\n class:\n - 'fa fa-lg fa-file-pdf-o'\n '#format': link\n '#format_items': comma\n '#access_create_roles':\n - administrator\n '#access_update_roles': { }\n '#file_extensions': pdf\nshorten:\n '#type': url\n '#title': Shorten\n '#access_create_roles':\n - administrator\n '#access_update_roles': { }\nclear_analysis:\n '#type': processed_text\n '#title': Clear\n '#access_update_roles': { }\n '#access_view_roles': { }\n '#text': '<input data-drupal-selector=\"edit-operation-clear-analysis\" id=\"edit-operation-clear-analysis\" name=\"op\" value=\"Clear\" class=\"button js-form-submit form-submit\" type=\"button\">'\n '#format': full_html\n_x_:\n '#type': textfield\n '#title': $x$\n '#title_display': inline\n '#size': '7'\n '#autocomplete': 'off'\n '#format_items': comma"
css: ''
javascript: ''
settings:
ajax: true
ajax_scroll_top: form
ajax_progress_type: ''
ajax_effect: ''
ajax_speed: null
page: true
page_submit_path: ''
page_confirm_path: ''
page_admin_theme: false
form_title: both
form_submit_once: false
form_exception_message: ''
form_open_message: ''
form_close_message: ''
form_previous_submissions: false
form_confidential: false
form_confidential_message: ''
form_remote_addr: true
form_convert_anonymous: false
form_prepopulate: false
form_prepopulate_source_entity: false
form_prepopulate_source_entity_required: false
form_prepopulate_source_entity_type: ''
form_reset: false
form_disable_autocomplete: false
form_novalidate: false
form_disable_inline_errors: false
form_required: false
form_unsaved: false
form_disable_back: false
form_submit_back: false
form_autofocus: false
form_details_toggle: false
form_access_denied: default
form_access_denied_title: ''
form_access_denied_message: ''
form_access_denied_attributes: { }
form_file_limit: ''
submission_label: ''
submission_log: false
submission_views: { }
submission_views_replace: { }
submission_user_columns: { }
submission_user_duplicate: false
submission_access_denied: default
submission_access_denied_title: ''
submission_access_denied_message: ''
submission_access_denied_attributes: { }
submission_exception_message: ''
submission_locked_message: ''
submission_excluded_elements: { }
submission_exclude_empty: false
submission_exclude_empty_checkbox: false
previous_submission_message: ''
previous_submissions_message: ''
autofill: false
autofill_message: ''
autofill_excluded_elements: { }
wizard_progress_bar: true
wizard_progress_pages: false
wizard_progress_percentage: false
wizard_progress_link: false
wizard_progress_states: false
wizard_start_label: ''
wizard_preview_link: false
wizard_confirmation: true
wizard_confirmation_label: ''
wizard_track: ''
preview: 0
preview_label: ''
preview_title: ''
preview_message: ''
preview_attributes: { }
preview_excluded_elements: { }
preview_exclude_empty: true
preview_exclude_empty_checkbox: false
draft: none
draft_multiple: false
draft_auto_save: false
draft_saved_message: ''
draft_loaded_message: ''
draft_pending_single_message: ''
draft_pending_multiple_message: ''
confirmation_type: message
confirmation_title: ''
confirmation_message: "<div id=\"quadstat-output\">[webform_submission:values:output]</div>\r\n\r\n<div id=\"quadstat-html\"><span class=\"fa fa-file-code-o fa-lg\"></span> <a target=\"_blank\" href=\"[webform_submission:values:html:raw]\">HTML</a></div>\r\n\r\n<div id=\"quadstat-pdf\"><span class=\"fa fa-file-pdf-o fa-lg\"></span> <a target=\"_blank\" href=\"[webform_submission:values:pdf_file]\">PDF</a></div>\r\n\r\n<div id=\"quadstat-shorten\"><span class=\"fa fa-lg fa-link\"></span> <a target=\"_blank\" href=\"[webform_submission:values:shorten]\">[webform_submission:values:shorten]</a></div>"
confirmation_url: '/webform/[webform:id]/submissions/[webform_submission:sid]'
confirmation_attributes: { }
confirmation_back: true
confirmation_back_label: ''
confirmation_back_attributes: { }
confirmation_exclude_query: false
confirmation_exclude_token: false
confirmation_update: false
limit_total: null
limit_total_interval: null
limit_total_message: ''
limit_total_unique: false
limit_user: null
limit_user_interval: null
limit_user_message: ''
limit_user_unique: false
entity_limit_total: null
entity_limit_total_interval: null
entity_limit_user: null
entity_limit_user_interval: null
purge: none
purge_days: null
results_disabled: false
results_disabled_ignore: false
token_view: false
token_update: false
access:
create:
roles:
- anonymous
- authenticated
users: { }
permissions: { }
view_any:
roles:
- anonymous
- authenticated
users: { }
permissions: { }
update_any:
roles: { }
users: { }
permissions: { }
delete_any:
roles: { }
users: { }
permissions: { }
purge_any:
roles: { }
users: { }
permissions: { }
view_own:
roles:
- anonymous
- authenticated
users: { }
permissions: { }
update_own:
roles: { }
users: { }
permissions: { }
delete_own:
roles: { }
users: { }
permissions: { }
administer:
roles: { }
users: { }
permissions: { }
test:
roles: { }
users: { }
permissions: { }
configuration:
roles: { }
users: { }
permissions: { }
handlers: { }
uuid: 875735fd-b786-41e3-aff1-256de8eb0b6b
