« Return to Thread: Poisson regression: univariate vs multivariate

Manually tweaking a chart template (.sgt)

by Marta GarcĂ­a-Granero-3 :: Rate this Message:

Reply to Author | View in Thread

Hi everybody

I'm trying to build a chart template (with SPSS 15) to make this graph
the way it should:

data list list/time (f8) sj lower upper (f8.1).
begin data
0    1    1    1
9    .985    .954    .995
10    .980    .947    .992
11    .975    .940    .989
12    .970    .933    .986
13    .964    .927    .983
14    .959    .920    .979
15    .954    .914    .976
16    .949    .908    .972
17    .939    .895    .965
21    .924    .877    .953
22    .908    .858    .941
23    .888    .835    .925
24    .883    .829    .920
29    .872    .817    .912
31    .867    .811    .908
33    .857    .800    .899
34    .836    .777    .881
35    .831    .771    .877
36    .821    .760    .868
37    .816    .754    .863
40    .811    .748    .859
41    .805    .743    .854
45    .800    .737    .850
46    .790    .726    .841
47    .779    .714    .831
51    .773    .708    .826
55    .763    .695    .818
56    .752    .680    .810
57    .738    .662    .800
58    .704    .615    .776
end data.

GRAPH /SCATTERPLOT(OVERLAY)=time WITH sj lower upper
 /TITLE='KM estimate with Kalbfleish-Prentice 95%CI'
 /TEMPLATE='C:\Temp\KPSurvival.sgt'.

This chart template, along with the code, is part of a big macro that
computes Kalbfleish-Prentice 95%CI for survival estimates and plots them
(just in case someone is wondering what's the use of all this code).

Basically, I have succeeded  in:

- Adding titles to x axis ("follow-up time") and y axis ("Cumulative
survival") (that required manual editing of the chart template, I found
no way of adding the titles to the graph directly)
- Adding interpolation lines (left step) to the three sets of data (time
WITH sj, time WITH lower and time WITH upper)
- Modifying the range and increment for y axis (from 0 to 1, delta=0.1)
- Hiding the scatter dots (they insisted in showing up as 5 pixel
diameter circles, even if I modified the graph to hide them and saved a
chart template afterwards) I had to manually tweak the template for that
too (lots of trial&error).

But... although I have manually edited the graph to change the
interpolation lines from blue, green and dusty to: solid line, black, 2
pixels (for "time WITH sj") and dashed line, black 1 pixel (for both
"time WITH lower" and "time WITH upper"), these modifications are
nowhere to be seen inside the chart template (at least to my untrained
eyes), and don't get applied to new graphs (although I'm sure I selected
everything that could be selected to be saved in the chart template). Is
there a way to add that instructions to it? Second item: since the chart
template will be dynamically created by the macro (using WRITE
OUTFILE='C:\Temp\KPSurvival.sgt'..........), is there any redundant line
that could be safely erased?

Any help/advice will be greatly appreciated,
Marta

*************

So far, my chart template has the following (rather difficult to
understand, BTW) lines:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<template SPSS-Version="1.4" date="2008-09-10" description=""
selectPath="87 80 12 13 17 18 19 47 43 "
xmlns="http://xml.spss.com/spss/visualization"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xml.spss.com/spss/visualization
http://xml.spss.com/spss/visualization/vizml-template-3.0.xsd">
    <setAxisInterval lowerMapping="exact" max="1.0" min="0.0" role="y"
upperMapping="exact"/>
    <setAxisMajorTicks>
        <majorTicks categorical="false" delta="0.1" derived="false"
position="outside" role="y">
            <markStyle>
                <style color="#000000" stroke-width="1pt" visible="true"/>
            </markStyle>
            <tickLabelStyle>
                <style color="#000000" font-size="8pt" visible="true"/>
            </tickLabelStyle>
        </majorTicks>
    </setAxisMajorTicks>
    <setAxisMinorTicks>
        <minorTicks categorical="false" derived="false" number="2"
position="outside" role="y">
            <markStyle>
                <style color="#000000" visible="true"/>
            </markStyle>
        </minorTicks>
    </setAxisMinorTicks>
    <setAxisStyle categorical="false" role="y">
        <label>Cumulative Survival</label>
        <axisLabelStyle>
            <style color="#000000" color2="transparent" font-size="11pt"
font-weight="bold" labelLocationHorizontal="center"
labelLocationVertical="center" visible="true"/>
        </axisLabelStyle>
    </setAxisStyle>
    <setAxisStyle categorical="false" role="x">
        <label>Follow-up time</label>
        <axisLabelStyle>
            <style color="#000000" color2="transparent" font-size="11pt"
font-weight="bold" labelLocationHorizontal="center"
labelLocationVertical="center" visible="true"/>
        </axisLabelStyle>
    </setAxisStyle>
    <setAxisMargin categorical="false" lowerMargin="0%" role="x"
upperMargin="5%"/>
    <setAxisMargin categorical="false" lowerMargin="0%" role="y"
upperMargin="5%"/>
    <addInterpolationLine>
        <interpolation missingRepresentation="wings"
pointPosition="left" type="step"/>
        <style color="#000000" visible="true" width="1pt"/>
    </addInterpolationLine>
    <addFrame count="1" styleOnly="true" type="legend">
        <style color="transparent" color2="transparent" visible="false"/>
        <style color="transparent" color2="transparent" number="0"
visible="false"/>
    </addFrame>
    <addFrame count="1" styleOnly="true" type="visualization">
        <style color="#ffffff" color2="transparent" number="0"
visible="true"/>
        <style font-family="SansSerif" font-size="8pt" number="1"
pattern="0" stroke-linecap="butt" text-fit="true" visible="true"/>
    </addFrame>
    <addFrame count="1" styleOnly="true" type="graph">
        <style color="transparent" color2="transparent" visible="true"/>
        <style color="#ffffff" color2="#ffffff" number="1" visible="true"/>
    </addFrame>
    <addFrame count="1" styleOnly="true" type="title">
        <style color="transparent" color2="transparent" visible="true"/>
    </addFrame>
    <setShowLineMarkers>
        <style color="transparent" color2="#000000" size="1pt"
symbol="circle" visible="false"/>
    </setShowLineMarkers>
    <setStyle subtype="simple" type="line">
        <style color="#000000" visible="true" width="2pt"/>
    </setStyle>
    <setStyle subtype="simple" type="scatter">
        <style color="transparent" color2="#000000" size="5pt"
symbol="circle" visible="false"/>
    </setStyle>
    <setStyleCycle id="styleCycleDefault" styleByNumber="1">
        <cycle>
            <style color="#000000" color2="#000000" glyph-angle="90.0"
size="2px" symbol="line" visible="true"/>
            <style color="#000000" color2="#000000" glyph-angle="90.0"
size="1px" symbol="line" visible="true"/>
            <style color="#000000" color2="#000000" glyph-angle="90.0"
size="1px" symbol="line" visible="true"/>
        </cycle>
    </setStyleCycle>
    <setStyleCycle id="styleCycle_4160" styleByNumber="1">
        <cycle>
            <style color="#000000" stroke-width="2pt" visible="true"/>
            <style color="#000000" stroke-dasharray="3px,2px"
visible="true"/>
            <style color="#000000" stroke-dasharray="3px,2px"
visible="true"/>
        </cycle>
    </setStyleCycle>
</template>

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@... (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

 « Return to Thread: Poisson regression: univariate vs multivariate

LightInTheBox - Buy quality products at wholesale price!