{"id":440,"date":"2017-08-24T17:36:19","date_gmt":"2017-08-24T22:36:19","guid":{"rendered":"http:\/\/justinwiegand.com\/blog\/?p=440"},"modified":"2026-03-10T22:31:06","modified_gmt":"2026-03-11T05:31:06","slug":"a-limesurvey-solution-for-linkeddyadic-data-collection","status":"publish","type":"post","link":"https:\/\/justinwiegand.com\/blog\/?p=440","title":{"rendered":"A LimeSurvey Solution for Linked\/Dyadic Data Collection"},"content":{"rendered":"<p>I&#8217;d like to share a solution for collecting linked\/dyadic data from a simple online survey.\u00a0 The following instruction is specific to the open-source <a href=\"https:\/\/www.limesurvey.org\/\">LimeSurvey<\/a> application, but could be used as a template for expansion to other survey platforms.\u00a0 Notably, LimeSurvey is free.<\/p>\n<ol>\n<li>First things first, you&#8217;ll need generate and save a random code somewhere your survey (I recommend adding this at the end).\n<ol>\n<li>Create an &#8220;Equation&#8221; type question in LimeSurvey.\u00a0 LimeSurvey has a built in random number generator that you will call on using this question type.<\/li>\n<li>To implement and save a random code made up of four digits (1000-9999), two letters (lower case or capital), and finally one additional digit (all settings you can change), copy\/paste the following text into the &#8220;Equation&#8221; style question:\n<ol>\n<li>Under &#8220;Code&#8221; (i.e., the question title), enter &#8220;PIN&#8221; (you can change this to any name you&#8217;d like as long as you update the question syntax accordingly).<\/li>\n<li>Under &#8220;Question&#8221;, enter &#8220;{if(is_empty(PIN), join(rand(1000,9999), substr(&#8220;abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ&#8221;, -rand(1,48),1),substr(&#8220;abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ&#8221;, -rand(1,48),1),(SAVEDID)),PIN)}&#8221;.<\/li>\n<\/ol>\n<\/li>\n<li>Under advanced settings, turn &#8220;Always hide this question&#8221; to &#8220;On&#8221; as respondents do not need to see the code in real time.<\/li>\n<\/ol>\n<\/li>\n<li>You now have a random code (named &#8220;PIN&#8221;) generated and saved for survey responses.\u00a0 The next step is to collect information that will be used to contact respondents&#8217; supervisors, spouses, or any other survey dyad.\u00a0 To do this, create three LimeSurvey questions following the &#8220;PIN&#8221; question in the prior step (order matters!).\u00a0 The three question codes, types, text, answers, and necessary survey logic\/validation follow (feel free to customize to your liking).\u00a0 Take note of the Question Group IDs (if you use question groups) and Question IDs of the Name and Email questions as you will call on these later (as &#8220;[GroupID]&#8221; and &#8220;[QuestionID]&#8221; respectively).\n<ol>\n<li>Permission\n<ol>\n<li>Question Type:\u00a0 List (radio)<\/li>\n<li>Question Text:\u00a0 &#8220;Do we have permission to contact your [supervisor, spouse, etc.] to complete a follow-up survey?&#8221; [Expand with specifics regarding the additional survey and protections you will implement to safe guard respondents&#8217; personal information]<\/li>\n<li>Answers:\u00a0 &#8220;Yes&#8221; (Code: &#8220;per01&#8221;) and &#8220;No&#8221; (Code: &#8220;per02&#8221;)<\/li>\n<\/ol>\n<\/li>\n<li>Name\n<ol>\n<li>Question Type:\u00a0 Multiple short text<\/li>\n<li>Question Text:\u00a0 &#8220;Please provide your first and last name:&#8221;<\/li>\n<li>Subquestions:\n<ol>\n<li>&#8220;First&#8221; (Code: &#8220;name01&#8221;) and &#8220;Last&#8221; (Code: &#8220;name02&#8221;)<\/li>\n<\/ol>\n<\/li>\n<li>Survey Logic to only display this question if permission is granted (enter the following under &#8220;Relevance equation&#8221;):\u00a0 ((Permission.NAOK == &#8220;per01&#8221;))<\/li>\n<\/ol>\n<\/li>\n<li>Email\n<ol>\n<li>Question Type:\u00a0 Short free text<\/li>\n<li>Question Text:\u00a0 &#8220;Please provide your [direct supervisor&#8217;s, spouse&#8217;s, etc.] email address:&#8221; [Expand with specifics regarding data integrity that you will implement.\u00a0 For example, &#8220;Do not complete the supervisor survey yourself. Only supervisors completing surveys from verified work email addresses and from unique locations qualify.&#8221;]<\/li>\n<li>Enter the following under &#8220;Validation&#8221; to require an email address:\u00a0 &#8220;\/^(\\w[-._+\\w]*\\w@<\/li>\n<li>Survey Logic to only display this question if permission is granted (enter the following under &#8220;Relevance equation&#8221;):\u00a0 ((Permission.NAOK == &#8220;per01&#8221;))<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li>You now have everything needed to contact supervisors (or other linked respondents).\u00a0 You can use LimeSurvey Expression Manager syntax to call on the variables you created and LimeSurvey&#8217;s built-in notification feature to push out the linking survey email as respondents finish their survey.\u00a0 Do this as follows:\n<ol>\n<li>Under &#8220;Surveys&#8221; click to select your survey (note the survey ID listed after your survey name). You will insert this where the template below calls for [SurveyID].<\/li>\n<li>Under the &#8220;Survey properties&#8221; drop down menu, select &#8220;Email templates&#8221;<\/li>\n<li>Now select &#8220;Detailed admin notification&#8221; (&#8220;Basic admin notification&#8221; could also be used).<\/li>\n<li>Craft the email you plan to have pushed out, calling on your previously selected variables.\u00a0 Below is a template you can modify:\n<ol>\n<li>Subject:\n<ol>\n<li>&#8220;[Your institution] Research for {INSERTANS:[SurveyID]X[GroupID]X[QuestionID][name01} {INSERTANS:[SurveyID]X[GroupID]X[QuestionID]name02}<\/li>\n<\/ol>\n<\/li>\n<li>Body:\n<ol>\n<li>&#8220;Dear [supervisor, spouse, etc.] of {INSERTANS:[SurveyID]X[GroupID]X[QuestionID]name01} {INSERTANS:[SurveyID]X[GroupID]X[QuestionID]name02},{INSERTANS:[SurveyID]X[GroupID]X[QuestionID]name01} is participating in research on [topic] being conducted at [your institution].\u00a0 As his\/her [supervisor, spouse, etc.] we would like your help completing a brief survey.\u00a0 [Additional text\/protections as necessary.\u00a0 For example, &#8220;Please know that your response will be entirely confidential and your email address will not be kept on file.\u00a0 We will not contact you again.&#8221;]To provide your response, please visit this link [hyperlink to your second survey].\u00a0 To link your response with {INSERTANS:[SurveyID]X[GroupID]X[QuestionID]name01}, you will need to enter the following unique code at the beginning of the survey (please copy and paste):Your unique code is:\u00a0 {PIN}Thank you![Your name]<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li>Of course, you need to ensure your linked survey is set up in order to include its link in the email template above.\u00a0 You&#8217;ll also want to start that survey off with a question collecting (and validating the format of) the code the linked respondent should enter.\u00a0 The details needed to set up that question follow:\n<ol>\n<li>Question type:\u00a0 Short free text<\/li>\n<li>Question Text:\u00a0 &#8220;Please enter the code from your invitation email.&#8221;<\/li>\n<li>Enter the following under &#8220;Validation&#8221; to ensure the code is a possible code based on the settings in this example (edit accordingly using LimeSurvey syntax if you changed the random code format):\u00a0 \/^[0-9]{4}[A-Za-z]{2}[0-9]+$\/<\/li>\n<\/ol>\n<\/li>\n<li>Now all you need to do is set the &#8220;Detailed admin notification&#8221; to be sent to the supervisor&#8217;s email address (or other linked respondent).\u00a0 This is implemented as follows:\n<ol>\n<li>Under &#8220;Surveys&#8221; click to select your survey.<\/li>\n<li>Under the &#8220;Survey properties&#8221; drop down menu, select &#8220;General settings and text&#8221;<\/li>\n<li>Expand &#8220;Notification &amp; data management&#8221; and under &#8220;Send detailed admin notification email to:&#8221; enter {INSERTANS:[SurveyID]X[GroupID]X[QuestionID]}<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>Now you can collect dyadic data using LimeSurvey.\u00a0 Good luck and please share your experiences, improvements, extensions, and\/or concerns.<\/p>\n<p>Image credit:\u00a0 https:\/\/3.bp.blogspot.com\/-V0cHqZl3fOA\/VdUL4zegiNI\/AAAAAAAABAM\/oCmKZPukXsc\/s640\/APIM%2Bspecificis.png<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;d like to share a solution for collecting linked\/dyadic data from a simple online survey.\u00a0 The following instruction is specific to the open-source LimeSurvey application, but could be used as a template for expansion to other survey platforms.\u00a0 Notably, LimeSurvey is free. First things first, you&#8217;ll need generate and save&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":441,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"A LimeSurvey Solution for Linked\/Dyadic Data Collection","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[32],"tags":[103,100,62,65,101,64],"class_list":["post-440","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","tag-expression-manager","tag-limesurvey","tag-mturk","tag-qualtrics","tag-survey","tag-survey-gizmo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/justinwiegand.com\/blog\/wp-content\/uploads\/2017\/08\/dyadicDataExample.png?fit=640%2C190&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p51adQ-76","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=440"}],"version-history":[{"count":6,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/440\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/440\/revisions\/893"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/441"}],"wp:attachment":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}