全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SPSS论坛
4154 7
2005-12-05
SSHi listers,

I'm hoping to customize an SPSS 13 IGRAPH to look like PowerPoint graphs we
are currently using in a quarterly report.  These three questions are not
specifically addressed in Raynald's SPSSTools site and my knowledge of
scripts is null.

Sample data and Igraph syntax follows.

I have a ChartLook file that does some of what I want. I want know if it is
possible to do these things by means of a script (yes/no), another method
(yes/no) or if one or more of the tasks will have to be done manually
(yes/no):

1. Suppress the display of error bar key: "Error Bars show 95% CI of Mean"
(can't specify this in ChartLook but can edit it manually).

2. Specify bar color for one value of AIRLINEA (Airline A) and a different
color for all other values of AIRLINEA--say (AIRLINEA EQ 1) is always yellow
and (AIRINEA GT 1) is always gray (can do this manually)

3. Suppress the display of VARIABLE NAMES and VARIABLE LABELS (rather than
making the variable label blank, e.g., VARIABLE LABELS ALOALL ' '.)

DATA LIST LIST / AIRLINEA ALOALL.
BEGIN DATA
1 75
1 51
1 51
2 51
2 75
2 75
3 75
3 100
3 100
END DATA.

IGRAPH
/VIEWNAME='Bar Chart'
/X1 = VAR(AIRLINEA) TYPE = CATEGORICAL
/Y = VAR(ALOALL) TYPE = SCALE (MIN=50 MAX = 100)
/COORDINATE = VERTICAL
/TITLE='Airline Overall'
/X1LENGTH=6.0
/YLENGTH=3.0
/X2LENGTH=3.0
/CATORDER VAR(AIRLINEA)(DESCENDING MEAN VAR(ALOALL) OMITEMPTY)
/BAR(MEAN) KEY=OFF LABEL OUTSIDE VAL SHAPE = RECTANGLE BASELINE = AUTO
/ERRORBAR CI(95.0)  DIRECTION = BOTH CAPWIDTH (45) CAPSTYLE = T.

Thanks,

King Douglas
American Airlines Customer Research
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2005-12-5 05:53:00
Hi King, 1. Can be done by SaxBasic script (see below) 2. Cannot be done by SaxBasic script. I expect that it is possible to do this with the Graphic Programming Language (GPL) introduced in v14 but I did not investigate since you have v13. 3. Can be done by SaxBasic script (see below) King, If I misinterpreted questions 1 or 3, let me know and I will try to modify the code accordingly. ' Purpose of script: hides x and y axis titles, hide error-bar legend ' Posted to SPSSX-L list by Raynald Levesque on 2005/12/03 ' www.spsstools.net 'DATA LIST LIST / AIRLINEA ALOALL. 'Begin DATA '1 75 '1 51 '1 51 '2 51 '2 75 '2 75 '3 75 '3 100 '3 100 'End DATA. 'VAR LEVEL airlinea (NOMINAL) . 'IGRAPH ' /VIEWNAME='Bar Chart' ' /X1 = VAR(AIRLINEA) Type = CATEGORICAL ' /Y = VAR(ALOALL) Type = SCALE (MIN=50 MAX = 100) ' /COORDINATE = VERTICAL ' /TITLE='Airline Overall' ' /X1LENGTH=6.0 ' /YLENGTH=3.0 ' /X2LENGTH=3.0 ' /CATORDER VAR(AIRLINEA)(DESCENDING MEAN VAR(ALOALL) OMITEMPTY) ' /BAR(MEAN) KEY=OFF LABEL OUTSIDE Val SHAPE = RECTANGLE BASELINE = AUTO ' /ERRORBAR CI(95.0) DIRECTION = BOTH CAPWIDTH (45) CAPSTYLE = T. Option Explicit Const ERROR_BAR=15 Sub Main Call Test End Sub Sub Test() ' Declare variables. Dim objOutputDoc As ISpssOutputDoc Dim objOutputItems As ISpssItems Dim objOutputItem As ISpssItem Dim objSPSSIGraph As ISpssIGraph Dim intItemCount As Integer 'number of output items Dim intItemType As Integer 'type of item (see SpssType property) Dim strLabel As String 'Item label Dim lngNb As Long Dim index As Long Dim idx2 As Long Dim MyIGraphElement As ISpssIGraphElement Dim MyArea As ISpssIGraphArea Dim MyAxis As ISpssIGraphAxis ' Open saved output document specified by the OutputFile parameter ' and make it visible. Set objOutputDoc = objSpssApp.GetDesignatedOutputDoc objOutputDoc.Visible = True Debug.Clear ' Get Output Items collection. Set objOutputItems = objOutputDoc.Items() ' Iterate through output items. intItemCount = objOutputItems.Count() For index = 0 To intItemCount - 1 Set objOutputItem = objOutputItems.GetItem(index) intItemType = objOutputItem.SPSSType() strLabel = objOutputItem.Label ' If item is a chart, modify its title, subtitle, and caption, then ' activate and export it. If intItemType = SPSSIGraph And objOutputItem.Visible =True Then Set objSPSSIGraph = objOutputItem.GetIGraphOleObject lngNb = objSPSSIGraph.Elements.Count For idx2 =0 To lngNb -1 Set MyIGraphElement = objSPSSIGraph.Elements(idx2) Debug.Print MyIGraphElement.Type If MyIGraphElement.Type = ERROR_BAR Then MyIGraphElement.Key = False 'Hide the Legend of the error bar End If 'This paragraph would change color of ALL bars 'If MyIGraphElement.Type = 1 Then 'SpssIGraphBar ' Set MyArea = MyIGraphElement.GetArea ' MyArea.BackgroundColor = vbBlue 'End If Next Set MyAxis = objSPSSIGraph.GetAxis(1) 'x-axis 'MyAxis.LabelFrequency = 1 'Uncomment this line to hide the labels 1, 2 and 3 MyAxis.GetTitle.Show = False 'Hides "AIRLINEA" Set MyAxis = objSPSSIGraph.GetAxis(0) 'y-axis MyAxis.GetTitle.Show = False 'Hides "ALOALL" End If Next index objSPSSIGraph.Redraw objOutputItem.Selected = True objOutputItem.Selected = False Set objOutputDoc = Nothing Set objOutputItem = Nothing End Sub Regards Raynald Levesque Raynald@spsstools.net Visit my SPSS site: http://www.spsstools.net
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2005-12-5 06:04:00
提示: 作者被禁止或删除 内容自动屏蔽
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2005-12-5 06:07:00
提示: 作者被禁止或删除 内容自动屏蔽
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2005-12-5 06:18:00

GARCH Effects: an Interpretation

CLAUDIO MORANA University of Piemonte Orientale; International Centre for Economic Research (ICER) --------------------------------------------------------------------------------

Applied Economics Letters, Vol. 9, pp. 745-78, 2002 Abstract: In this paper we show how IGARCH effects can arise as an artifact of unaccounted structural change. Using daily returns for the DM/US$ and Yen/US$ exchange rates, the finding is shown to have empirical relevance. GARCH models appear to be useful approximations, for short term forecasting, to a data generating process which shows time varying conditional variance due to switching heteroscedasticity. -----------------------------------------------

https://bbs.pinggu.org/thread-28773-1-1.html

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2005-12-5 12:27:00
路过!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群