Dear Darren,
>Dear SPM:
>
>When plot fitted and adjusted responses spm_graph plots the responses
>differently apparently based on whether the covariate has elements repeated.
>I refer to lines 304 - 317 in spm_graph.
>
> [p q] = sort(x);
> if all(diff(x(q)))
> plot(x(q),y(q),':b'); hold on
> plot(x(q),y(q),'.b','MarkerSize',8); hold on
> plot(x(q),Y(q),'r' ); hold off
>
> else
> plot(x(q),y(q),'.b','MarkerSize',8); hold on
> plot(x(q),Y(q),'.r','MarkerSize',16); hold off
> xlim = get(gca,'XLim');
> xlim = [-1 1]*diff(xlim)/4 + xlim;
> set(gca,'XLim',xlim)
>
> end
>
>The first type of plot is the typical blue markers at each value with tiny
>blue dots connecting all the values and the red fitted response. The second
>is just the blue markers at each value and the red fitted response.
>
>Is there are reason to plot this data differently? Is this just to alert the
>user?
Not having written the code I can only guess about the athours intentions.
However, what is being done is that it is checked to see if all x-values
are different (i.e. that there is no aggregation/binning at certain
x-values) and connect the points with lines if they are. If they are not
all different connecting lines would just result in vertical lines with
occasional jumps to the next x-value, and confuse more that anything else.
Good luck Jesper
Jesper Andersson
Wellcome Dept. of Cognitive Neurology
12 Queen Square
London WC1N 3BG
phone: 44 171 833 7484
fax: 44 171 813 1420
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|