Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Converting decision tree output from R to LimeSurvey scenario

More
7 years 3 months ago - 7 years 3 months ago #146321 by Moest
Hello,

Recently I used an algorithm in the open-source statistical program R to produce a decision tree version of a Patient Reported Outcome Measurement questionnaire. This decision tree significantly reduces the amount of questions needed for an accurate score. Therefore, I want to implement the conditions of the decision tree in the Lime survey questionnaire. This can of course be done manually.

However there are 202 different, unique ways of walking down the decision tree, which would mean 202 difference scenarios in Lime survey. Is there any way of formatting the output of the R-algorithm to be implemented directly into Lime survey?

As attachments I have added a visual representation of part of the decision tree and the output of the algorithm. All black boxes are end nodes.



Each string of output is coding for the conditions for an end node. The string contains the conditions for all steps that have to be taken to end up in a certain node and the value of the node.



The conditions are coded like this:
pv1-5 = question ID
%in% = "when question is"
c("0-10") = answers on the question needed to proceed to the next node.
& = separates different levels of nodes.
:number = value of the predicted score

Thank you in advance for your replies

Mark
Last edit: 7 years 3 months ago by Moest.
The topic has been locked.
More
7 years 3 months ago #146330 by jelo
You might create the survey via a TSV and then import it into Limesurvey.
TSV supports relevance equations. Conditions are not supported.
manual.limesurvey.org/Excel_Survey_Struc..._of_Survey_Structure

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
7 years 3 months ago #146620 by Moest
I mannaged to export to a .txt and implement my relevance equations to the .txt format. However i can't get it imported into Limesurvey. It only lists "error" when I try to import the .txt file. Does anyone have an idea what might cause this?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146621 by DenisChenu
LimeSurvey version and build number
Activate debug to 2 to have more information
And always better to use LibreOffice to do tab separated value

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
7 years 3 months ago #146673 by Moest
thanks for your quick response.

I used version 2.05, but it seems 2.06 does not give the error and just imports the file. So I will update to 2.06
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose