Hello,
I was trying to use the exponential function in the following formula, for example, in my project in Qualtrics:
exp(-2.15+2.4*Age-1.7*Gender)
Alternatively, if I can get the formula for using natural logarithm formula that will work too.
These, with a denominator, will help me compute probability in the auto calculated filed in Qualtrics and when, for example, I enter the values of Age and Gender, I should automatically get Probability of Y.
I wasn't sure about how to do this or is there even another alternate way that I can use to do this? Please suggest- an example would be very helpful.
Thank you.
Lava
The way I would implement it is by saving the answer of Age (Q1) and Gender (Q2) into embedded data using survey flow. Then I add a page break before create Q3 after Q2. The page break help the survey flow to write the data into an embedded data that Q3 can access.
Then in Q3, I will use Add JavaScript, and in the JavaScript I will pull the value stored in the embedded data during the survey flow using "${e://Field/Age}" (if you stored the value of Age in an embedded data called Age). Then I will do the same with Gender, then I do the exp calculation in JavaScript. And I will store the end result (Probability of Y) back into an embedded data where I can access it in another question.
Thank you TJUH_Kai. I was trying to create one but couldn't make it work. Is it possible to share . QSF file as an example so that I can upload and work around with it. I appreciate your help.
Hi Lava,
That's a great idea, i never thought about sharing a proof of concept via qsf. Here is mine. Please take a look and let me know if you have any question.
Thanks,
Kai
Exponential_Function_Test_Survey.qsf
Kai,
That was perfect. I also saw where I was having a problem with. Thank you for your time.
Lava
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.