Interactive bar from 7 likert scale

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Interactive bar from 7 likert scale

Niels Engelaar
Hello experts,

I've got a question about making a interactive bar of 7 scale likert question. It's probably really easy but can't find it and it's driving me nuts for the last couple of hours.

Im working with SPSS V21 on a MAC. Could someone please tell me how to make this bar step by step. The attachment is an example about how I would like to make it.

Thanks so much,

Niels,
A Dutch student.

Reply | Threaded
Open this post in threaded view
|

Re: Interactive bar from 7 likert scale

Andy W
Below is a GGRAPH code example to produce the same type of chart (not sure about IGRAPH).


*********************************************************************************************.
set seed 10.
input program.
loop #i = 1 to 100.
    compute id = #i.
    end case.
end loop.
end file.
end input program.
dataset name lik.

*Making fake random likert data.
vector lik(5,F1.0).
do repeat lik = lik1 to lik5.
  compute lik = TRUNC(RV.UNIFORM(1,6)).
end repeat.

*reshape so the variables are in one column.
VARSTOCASES
/MAKE lik from lik1 to lik5
/index var (lik).

*Can use TRANSFORM in GGRAPH to make the chart.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=COUNT()[name="COUNT"] lik var
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: var=col(source(s), name("var"), unit.category())
 DATA: COUNT=col(source(s), name("COUNT"))
 DATA: lik=col(source(s), name("lik"), unit.category())
 COORD: transpose(rect(dim(1,2)))
 GUIDE: axis(dim(1), label("Likert Scales"))
 GUIDE: axis(dim(2), label("Percent"))
 GUIDE: legend(aesthetic(aesthetic.color.interior))
 SCALE: cat(dim(1))
 SCALE: linear(dim(2), include(0))
 SCALE: cat(aesthetic(aesthetic.color.interior))
 ELEMENT: interval.stack(position(summary.percent(var*COUNT,
  base.coordinate(dim(1)))), color.interior(lik), shape.interior(shape.square))
END GPL.
*********************************************************************************************.
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/