Welcome, Guest
Username: Password: Remember me

TOPIC: Average counting in a special way

Average counting in a special way 1 year 4 months ago #89052

  • ezechial
  • ezechial's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Hello!

I'm new in this forum and I did not find an suitable answer for my problem:

Our company has a limesurvay, and I need to do a modification to one of our surveys. We need to count an average from answer in a way that it drops best, worse and a middle answers away ( in this way, we have charts to 4-10, and I need to drop 4, 7, and 10 off from average count) and count the average from the remaining numbers. Is this kind of modification possible and how I do it?

:)
The administrator has disabled public write access.

Aw: Average counting in a special way 1 year 4 months ago #89148

  • jelo
  • jelo's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 389
  • Thank you received: 40
  • Karma: 15
You can change the php code to get these results. But updates would be a problem and
you would need a special installation.

Such operations are more suitable for statistical programs.
Think about using R ( www.r-project.org ) on the Server to create a workflow for results.

Perhaps some day Limesurvey will support R inside the results sections but currently I would change the workflow to an external program which does the reports.
The administrator has disabled public write access.

Re: Average counting in a special way 1 year 4 months ago #89158

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
There may be a cleaner way to do this with Expression Manager but if, for example, you had an array question with:
- question code q1
- 4 sub-questions with codes 1-4
- answer options 4-10

You could use something like the following in an equation question (I put in line-breaks to make it easier to read):
{sum(
	if(q1_1 > 0 && q1_1 != 4 && q1_1 != 7 && q1_1 != 10, q1_1, ''), 
	if(q1_2 > 0 && q1_2 != 4 && q1_2 != 7 && q1_2 != 10, q1_2, ''), 
	if(q1_3 > 0 && q1_3 != 4 && q1_3 != 7 && q1_3 != 10, q1_3, ''), 
	if(q1_4 > 0 && q1_4 != 4 && q1_4 != 7 && q1_4 != 10, q1_4, '')
) / count(
	if(q1_1 > 0 && q1_1 != 4 && q1_1 != 7 && q1_1 != 10, 1, ''), 
	if(q1_2 > 0 && q1_2 != 4 && q1_2 != 7 && q1_2 != 10, 1, ''), 
	if(q1_3 > 0 && q1_3 != 4 && q1_3 != 7 && q1_3 != 10, 1, ''), 
	if(q1_4 > 0 && q1_4 != 4 && q1_4 != 7 && q1_4 != 10, 1, '')
)}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.150 seconds
Donation Image