Home
S-Plus 4.5 Supplement
Contents
1. default 1 Solid optional Fa T data mode 1 character Identifying Specific Graphics Objects To modify specific pieces of editable graphics using gui Modify you must specify the object name showing its path in the object hierarchy You can use the following functions to get the object name for a specific object type M ost of them take a GraphSheet name and a GraphN um argument you can use gui Get GSName to obtain the name of the current GraphSheet e gui Get AxisLabel sName returns the name of the AxisLabels for a specified axis axis 1 by default e gui Get Axi sName returns the name of the axis for a specified axis axis 1 by default e guiGetAxisTitleName returns the name of the axis title for a specified axis axis 1 by default e gui Get GSName returns the name of the current GraphSheet T his function takes no arguments e gui Get GraphName returns the GraphN ame of the graph with the 242 specified GraphN um in the specified G raphSheet gui Get Pl ot Name returns the N ame of the plot with the specified PlotN um in the specified GraphN um in the specified GraphSheet For example gt guiPlot Line DataSetValues data frame 1 20 sin 1 20 gt guiModify YAxisTitle Name gui GetAxisTitl eName Title sin x guiGetPlotClass Use the gui Get Pl ot Cl ass function to do one of the following 1 For aspecified plot type return the GU I class to which the plot type be
2. sPicturel lt chGetCurrValue df GraphToShowEdit df lt chSetCurrValue df Picturel sPicturel return df Display the dialog guiDisplayDialog Function Name PictureFn Example script to show how to use a Picture List Box control in a dialog in S PLUS Define a function for use with this dialog PictureListFn lt function PictureList GraphSelectedEdit sPictureSelected lt paste sep The graph file GraphSelectedEdit was selected Create properties for the function guiCreate Property name ReturnVal ue DialogControl Invisible guiCreate Property name GraphSelectedEdit DialogControl Wide String DialogPrompt amp Graph Selected UseQuote T Create the picture list box guiCreate Property name PictureList NAVDAGG CNIROSIN SRLs 45 DialogControl Picture List Box OptionlList c c spluswin home metal wmf List of c spluswin home meta2 wmf metafiles in c spluswin home meta3 wmf an option list DialogPrompt amp Picture List UseQuote T Define group property for dialog guiCreate Property name WidePictureGroup type WideGroup DialogPrompt Select Picture PropertyList c PictureList GraphSelectedEdit Function info for the function guiCreate FunctionIlnfo Function PictureListFn Di al ogHeader Picture List Box Control Test PropertyList c Return
3. HELP SUPPORT AND LEARNING RESOURCES Getting Help T here are a variety of ways to accelerate your progress with S P LUS and to build upon the work of others This section describes the learning and support resources available to S PLUS users Online Help S PLUS offers an online help system to make learning and using S PLUS easier Under the H elp menu you will find options for Using S PLu s how to use the graphical user interface Language Reference details on each function in the S PLUS language Questions and Answers some common difficulties and proposed solutions Online M anuals see below and Visual D emonstrations T here is also context sensitive help accessed by clicking on the H elp buttons in the various dialogs or by clicking on the context sensitive H elp button on the toolbars There is also Language Reference help available through the S PLUS Commands window by typing hel p at the S PLUS prompt or by pressing the F1 key while S PLUS is active Printed and TheS PLus Programme s Guide the Guide to Statistics and the S PLUS U s s Online Manuals Guide are all available online as well as in print To view a manual online select O nline M anuals from the S PLUS Help menu and choose the desired title Notes on Online versions of the Guides The Online manuals are viewed using Acrobat Reader which can be installed as an option during the installation process While using Acrobat Reader i
4. Recompute By default sample sizes are rounded up to the next integer value Checking Power this option causes the power to be recomputed for the rounded sample size value Exact N Checking this results in the exact value of N being returned with no rounding Interactive With this option checked the results of the computations are written back to the dialog Expand Input T his causes the input to be expanded into a table where all combinations of input are used For example if you input two different powers and three 136 BNCMAL POWER AND SALE SE alternative means the resulting table will have six rows If this option is unchecked the above example will produce a table with three rows Continuity With this option checked a continuity correction is used in the Correction computations Printout Page The Printout page looks like this Binomial Power and Sample Size lel x Model Options Printout Columns Digits Prop orNul fi Pomon Poo Yd Prop2 or Alt 2 H Prop2 or Alt Po Delta bo Delta 7 W Alpha 4s Alpha Po H Power so lt H Power o N1 fs Em 7 E NZ omit fz 0 E NON fort NNT D lt Reset Fill Down m Save Object Export Object Object Name Text File i Cancel Apply current Figure 11 6 The Binomial Power and Sample Size dialog Printout page Columns Group _ This group allows you to control which columns
5. Table 1 To modify the layout properties of the currently selected S PLUS graph fol 1 Select an S PLUS graph in your worksheet by clicking once on it If you double click on an S PLUS graph you will activate it and start editing in place 2 Click on this button or select the M odify Graph Layout option in the S PLUS menu 3 An S PLUS graph sheet layout dialog will appear in Excel allowing you to modify any of the layout properties of this graph To modify the properties of a plot in the currently selected S PLUS graph 1 Select an S PLU S graph in your worksheet by clicking once on it 2 Click on this button or select the M odify Plots option in the S PLU S menu 3 A dialog will appear showing you a list of the graph areas in this graph you can have multiple graph areas in a graph i e one graph area might be 2D and another might be 3D in the same graph and for each graph area a list showing all the plots in this graph area 4 Select the graph area and the plot in this area you want to edit Click next 5 An S PLUS plot properties dialog will appear in Excel allowing you to modify properties of this plot 39 CAPIR3 SA B ADIN SELECTING DATA FOR S PLUS GRAPHS Before you can create a graph you must first select data in your current worksheet You must select a block of data that is greater than one cell in width or length before you can continue with the Create Graph wizard S PLUS plots ac
6. 0000 0000 0000 0000 0000 0000 0000 0000 3333 3333 0000 3333 r333 0000 13333 0 3333 L9 0 0000 cs oeoceococ cesese wp aoai tooo ooo amp 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 3333 3333 3333 0000 0000 0000 13333 13333 0 3333 gt ooocscteocoeoeorreg seoscseooses L10 L12 L13 L15 L16 0 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 3393 3333 3333 3333 3333 3333 reo re Oo OO Pe O Pe oOo O O o o o o o o o 0 e o o o o e e o o o o o o o oOo o o 0 1 o E E O m O O O S SG ql yaga adl Gl al Goall 0 1 e omero 9 o oooooooooo 2 H ere we see one of the appealing properties of Type II sum of squares the hypothesis tested by the Type III sum of squares for Flour only involves parameters of the Flour term whereas the hypothesis tested by the Type sum of squares for Flour involves the parameters of Fat Surfactant and Fat x Surfactant The marginal means can also be obtained from multicomp using compari sons none Doing so we obtain the estimable functions for the marginal means for the over parameterized model For example the estimable functions for the Fat marginal means are gt Fat mcomp lt multicomp Baking aov focus Fat comp none 121 CAPIR 10 TE III SMO SUARSANDADLSED MAB Si
7. AFX_ODL_METHOD CMyOCXCtrl AFX_ODL_METHOD id DISPID_ABOUTBOX void AboutBox define SPLUSOCX_METHODS include SPlusOCX idl undef SPLUSOCX_METHODS ACINEX CHIROSIN SR1s DAGS Next locate the event dispatch interface sections In this example it appears as dispinterface _DMyOCXEvents properties Event interface has no properties methods NOTE ClassWizard will maintain event information here _ Use extreme caution when editing this section I AFX_ODL_EVENT CMyOCXCtrl 1 AFX_ODL_EVENT j Add the following lines in the events section define SPLUSOCX_EVENTS include SPlusOCX idl undef SPLUSOCX_EVENTS The section should now appear as dispinterface _DMyOCXEvents properties Event interface has no properties methods NOTE ClassWizard will maintain event information here _ Use extreme caution when editing this section I AFX_ODL_EVENT CMyOCXCtrl 1 AFX_ODL_EVENT define SPLUSOCX_EVENTS include SPlusOCX idl undef SPLUSOCX_EVENTS k Do not modify any other parts of this file at this time 5 Build the control 277 CFPIR 16 DACGCNIROSINSALS 45 278 Now is a good time to build this project To do this click on the Build toolbar button or select Build MyOCX OCX from the Build menu in the Developer Studio If you receive any errors go back through the above steps to make sure you have completed them correctl
8. 3 snr 1 20 seed 837 coeff 3 x 1 vector of coefficients eps the contamination ratio between 0 and 0 5 sig standard deviation of most observations snr signal to noise ratio well not really Note the regressors are generated as rnorm n 1 rnorm n 1 3 exp rnorm n 1 It also generates an unused vector x4 set seed seed x lt chind rnormn 1 rnormn 1 3 exp rnormn 1 ru lt runif n nl lt sum ru lt eps u lt numeric n u ru lt eps lt rnorm n1 sd sig snr u ru gt eps lt rnorm n ni sd sig data frame y x matrix coeff ncol 1 u 184 THONG EALS x1 x4 x 1 x2 x 2 x3 x 3 rnorm n 1 185 CAPIR 22 RAS UGRESS ROBUST MM REGRESSION 186 This dialog fits linear regression models using a robust method based on the collective work of Rousseeuw and Yohai 1984 Yohai Stahel and Zamar 1991 M arazzi 1993 and Yohai and Zamar 1998 It calls the mR o b MM function and its print summary plot and predict methods To perform linear regression Choose Statistics Regression RobustMM from the main menu The dialog shown below appears RBA MREGESON Robust Linear Regression p x Model Options Results Plot Predict Data Data Frame environmental X Weights z ee Save Model Object MV Omit Rows with Missing Values Save As flast rob
9. SPLUS97 XLA You may be prompted to copy the S PLU S Add in application from its location on your server system to the Excel library directory on your workstation You may choose to copy or not A check box next to the name of the S PLUS Add in will now appear in the Add Ins dialog list of add ins You may now click the OK button to dismiss this dialog 35 36 CAPIR3 SALSEXELADIN Add Ins HEI a de Available ssLinks Add In Ana ToolPak Cancel I Analysis ToolPak VBA I AutoSave MV MS Query Add In Browse T ODBC Add In IV Template Wizard with Data Tracking 7 Update Add in Links g AccessLinks Add In Lets you use Microsoft Access Forms and Reports on Microsoft Excel data tables MANS THE SALSEXEL ADIN REMOVING THE S PLUS EXCEL ADD IN If you installed the S PLUS Excel Add in during S PLUS setup when you choose to remove S PLUS this add in will automatically be renoved from Excel by S PLU S setup If you manually installed the add in such as in the case of a workstation as detailed above you will need to manually remove this add in from Excel Open the file called REMOVE XLA from the ExcelWiz subdirectory of the S PLUS program directory on the server system T his will start an automatic removal of the add in from your workstation You can also remove the add in using Excel To do this follow these steps rele ee Start M icrosoft Excel 7 0 or higher Create
10. censorReg censor failure upper cens 1 data table4 truncation censor tlower tupper tcode distribution lognormal which results in output Call censorReg censor failure upper cens 1 data table4 truncation censor tlower tupper trunc codes distribution lognormal Distribution Lognormal Coefficients Intercept 1 920974 Dispersion scale 0 9211897 Log likelihood 12 49965 Observations 9 Total 6 Censored Parameters Estimated 2 Because the log likelihood is more complex numerically when truncation distributions are used it is important to verify convergence Here convergence is verified by the near zero values of the first derivatives of the log likelihood The above model was temporarily save in t mp SO we can extract the derivatives as follows gt tmp first deriv Intercept scale 6 594777e 010 4 993228e 009 213 CAPIRR 13 PARAVETRC REGRESSION FOR END DYA Threshold Parameter 214 Truncation distributions modify the fitted distribution by considering failure in a smaller region of the positive real line A distribution with a threshold parameter also modifies the failure distribution but in a slightly different way The idea of the threshold parameter is that test items cannot fail for a period of time after testing begins Thus although testing begins at time zero no tested item will fail for some fixed period y after time zero Thus the failure distr
11. exp z SAL ee na 1 exp z the normal or gaussian distribution 1 1 2 z FS exp 7z f z Jr p 7 and the smallest extreme value distribution f 2 exp z exp z W hen the log link is used with a fixed value of o 1 the smallest extreme value distribution becomes an exponential distribution If o 0 5 this becomes the Rayleigh distribution As indicated above when the smallest extreme value distribution is used with the log link the distribution can be 209 CAPIRR 13 PARAMETIRC REGRESSION FOR ENED DA Accounting for Covariates 210 made equivalent to the two parameter Weibull distribution in which 1 z g7 x o f oexp x oof Here 1 isthe shape parameter In general the failure times are positive since failure at a negative time is not usually meaningful However when the identity link function is used it is possible to input negative values for the survival times intocensorReg For example a gaussian distribution takes values over the entire real line To fit a gaussian model to the capacitor2 data you type gt censorReg censor days event 1 data capacitor2 distri bution gaussian The hazard rate is the instantaneous rate of failure This can be computed simply as the first derivative of the failure density with respect to time Different distributions result in different hazard rates and thus in different models Much time in model buil
12. gl m so they won t be discussed further here The last four are different and are presented in figure 13 1 through figure 12 4 Figure 13 1 displays a probability plot of the standardized residuals The Weibull Probability Plot with MLE 999 7 98 7 94 74 g 57 5 34 3 24 a J Z 17 g J 05 4 03 4 02 4 017 o 005 T l T T 0 01 0 05 0 10 0 50 1 00 Residuals Point plotting method km Figure 13 1 Probability plot of tandardized reidualswith maximum likelihood eti mate ATTING MOS THE AA MEIH DAR GENRE gt a gt See N oa N Fa EeTi ERTt ETT EET EET REE rir ERE ETE EEE TE oe 2 Weibull Probability el Q O a 003 001 0005 0002 0001 00005 standardization of the residuals are described in M eeker and Escobar 1998 and are referred to by them as censored Cox Snell residuals A maximum likelihood estimate of a null model intercept only is displayed in the plot along with the residuals for diagnostic purposes Weibull Probability Plot with MLE s Grouped by voltage method regression km X pg lt lt KN 39 _ xX Lonlinlilinlirlin To eo LX n al eo A ais f x oh T T T T T 1 5 10 50 100 Time to Failure Figure 13 2 Probability plot of the fit with maximum likdihood eti mates Figure 13 2 displays a probability plot of the fitted model along with the non censored observations Each l
13. wei bull Weibull extreme smallest extreme value lognormal log normal or log gaussian normal normal or gaussian loglogistic log logistic logistic logistic logexponential og exponential exponential exponential same as extreme w ith sigma 1 lograyleigh log R ayleigh rayleigh Rayleigh same as extremewith sigma 0 5 Table 3 Distributions supported by censor Reg 208 CNR REG The following discussion describes the internal specification of the parametric distribution families as they are viewed by the estimation routines The general user need not be concerned with this aspect of the family specification It is included here for the user who wants or needs access to the internal routines Internally the distributions are defined by two quantities following the development of standard textbooks on parametric survival analysis the distribution of the random variable and the link function Let g denote the link function and let g y xB ge BE oO be the random variable for failure time y Here ois the scale factor x is a vector of covariates in the simplest model x 1 the intercept term and f is a vector of coefficients The term xf specifies the location of the estimates Two link func tions g are possible g x x the identity link and g x logx the log link Three distributions for z are available T hese are the logistic
14. 1998 showed that the p and w functions given above are optimal in the following highly desirable sense the final M estimate has a breakdown point of one half and minimizes the maximum bias under contamination distributions locally for small fractions of contamination subject to achieving a desired efficiency when the data is G aussian T he Gaussian efficiency of the final M estimate is controlled by the choice of the tuning constant c As discussed in the earlier sections you can specify a desired Gaussian efficiency and S PLUS will automatically use the correct c for achieving that efficiency T he robust R is calculated as follows 181 CPRD ROA LUNAR AGEN 182 i 40 Initial S Estimator B If an intercept term is included in the model then 2 2 os n 1 s n p s n 1s a0 Taraa dan anA f where s s ands isthe minimized s u for a regression model with only an intercept term with parameter u If there is no intercept term replace n Ls in the above formula with ns 0 gt Final M Esimator B If an intercept term u isincluded in the model then ost nfo PI o ED eo S ied S R where u is the location M estimate corresponding to the local minimum of i H Q u Lef z S such that Q lt Q u where u isthe sample median estimate If there is no intercept replace Q with zero in the formula TEIA EALS Robust Deviance Robust F Tes
15. H ow big does my sample need to be T he required sample size is a function of the alternative hypothesis the probabilities of Type and Type II errors and the variability of the population s under study Two new functions are available for computing power and sample size requirements normal sample size and binomial sample size Depending on the input these functions will provide For given power and alternative hypothesis the required sample size For given sample size and power the detectable difference e For given sample size and alternative hypothesis the power to distinguish between the hypotheses These functions can be applied in one and two sample studies and will produce a table from vectorized input suitable for passing to Trellis graphics 127 CHPERTL PONRADSMIESE NORMAL POWER AND SAMPLE SIZE The Normal Power and Sample Size dialog assists in computing power sample size or minimum detectable difference Choose Statistics Power and Sample Size N ormal M ean from the main menu The dialog shown below appears Normal Power and Sample Size lel Es Model Options Printout Select Standard Deviations Compute Sample Size Sigmal fi C Power tee C Min Difference Sigma 2 x1 Sample Type One Sample m Probabilities m Null Hypothesis Alphals 0 05 X Mean jo Powers o s m Mean m Sample Sizes r Alternative Hypothesis Fl Alt Mean NZ I ear
16. HZ7 NI Test Type two sided lt Results Save s IV Print Results i Cancel Apply d current Figure 11 1 TheNormal Powe and Sample Size dialog M odel page 128 NAML POWER AND AMALE SE Model Page Select Group Probabilities Group Sample Sizes Group Standard Deviations Group Null Hypothesis Group Alternative Hypothesis Group Results Group Compute Choose one of Sample Size default Power or M in Difference Sample Type The choices are O ne Sample Two Sample or Paired This group is where alpha and power are specified defined as alpha Pr reject N ull hypothesis if true power Pr reject N ull hypothesis if false You can select multiple values using the CTRL key or you can type in values separated by commas If computing power or minimum difference samples sizes are input here For two sample tests any two of N1 N2 N2 N1 will designate the third In most cases it is natural to think in terms of N 1 and N 2 N 1 For a one sample test Sigmal is required For a paired test the standard deviation of the difference between samples is required so the Sigma X2 X1 field becomes active in place of Sigmal For a two sample test Sigma2 defaults to Sigmal M ultiple values for the standard deviations can be input separated by commas For aone sample test
17. J n kn Examples For two sample cases use normal sample size with mean2 instead of mean alt Don t round sample size gt summary normal sample size mean2 0 3 exact n T delta power nl n2 1 0 3 0 8 174 4195 174 4195 round sample size then recompute power gt summary normal sample size mean2 0 3 recompute T delta power nl n2 144 NORMALLY DSRBUIED DSA 1 0 3 0 8013024 175 175 Unequal sample sizes lower tail test gt normal sample size mean 100 mean2 94 sdl 15 prop n2 2 power 0 9 alt less meanl sdl mean2 sd2 delta alpha power n1 n2 prop n2 1 100 15 94 15 6 0 05 0 9 81 162 2 145 CAPRI POWRRANDSMAE SE BINOMIAL DATA One Sample Test Another very common test is for a binomial proportion Say we have data of Binomial Proportion 146 sampled from a binomial distribution X B T n i 1 0 Each X represents the number of successes observed in n Bernoulli trials where Pr success 7 The mean and variance of the random variable X is E X nt Var X nt 1 T We wish to test the value of the parameter z using a two sided test HiT Ah T We could use an exact binomial test but for sufficiently large n and if the distribution is not too skewed z is not too close to 0 or 1 a normal approximation can be used A good rule of thumb is that the normal distribution will be a good approximation to the binomial
18. The data columns and conditioning columns are specified as part of the data array passed in 253 CAPIR 15 AJOMAICN IMPRORMNSINSRLS 45 254 Table 6 CreateConditioned Returns TRUE if suc PlotsSeparateData cessful FALSE if not boolean obj CreateConditionedPl otss eparateData axis type string plot type string data array variant conditioning array variant data column names array conditioning col names array Similar to Create Conditioned Plots except that this method takes in a data array and a conditioning array separately instead of combined in one ar ray The last two parameters are arrays of strings rep resenting the names of columns in the data ar ray and names of col umns in the conditioning array These names will be used as axes labels in plots Pass in an empty variant for either or both of these to not use col umn names NAV AUTOMATION MEIH ES IN SRLS 45 CreatePlotsGallery boolean obj CreatePlotsGallery hwnd data array variant data column names array CreateConditionedPlots Gallery boolean obj CreateConditionedP otsGallery number of conditioning vars hwnd data array variant data column names array Table 6 Returns TRUE if suc cessful FALSE if not Returns TRUE if suc cessful FALSE if not Displays a dialog allow ing selection of axis type and plot type Takes in a long number r
19. current Help Figure 8 5 The Agglomerative H ierarchical Clustering dialog Results page Results Page Printed Results Output Type Select N one for no printed output or Short for a short printed summary Saved Results Save In Specify the name of a data frame in which to save cluster membership if Cluster Membership is checked Cluster Membership Check this to save a vector of indices giving cluster memberships in the specified data frame Number of Clusters Specify the number of clusters to form when generating cluster membership indices 100 AGGOMERATINE HERARHICAL CLLSIERNGS Agglomerative Hierarchical Clustering OE x Model Results Plot m Plats T Clustering Tree I Banner Plot E Cancel Apply i current Figure 8 6 The Agglomerative Hierarchical Clustering dialog Plot page Plot Page Plots Clustering Tree Check this to create a clustering tree plot Banner Plot Check this to create a banner plot Related programming language functions agnes 101 CAPIR8 CLBIERNGINSRLS DIVISIVE HIERARCHICAL CLUSTERING Model Page Data 102 This dialog performs divisive hierarchical clustering See chapter 18 in the Guide to Statistics for details To perform divisive hierarchical clustering Choose Statistics Cluster Analysis Divisive Hierarchical from the main menu T he dialog shown below appears Divisive Hierarchical Clustering
20. end if As an alternative to using Set ParameterCl asses in the automation client at the time of running or using the function you can define the parameter classes using the ArgumentClassList property when you define the Functi onl nfo object to represent the function in S PLUS This approach has the advantage of simplifying the automation client program code but does require some additional steps in S PLUS when defining the function Consider the following S PLUS script to define the function My Function anda Functi onl nfo object for this function MyFunction lt function a return a gui Creat e Functioninfo Function MyFunction ArgumentClassList vector vector This example script will define My Function and will define a Functi onl nfo object for MyFunction and set the ArgumentClassList to the string vector vector indicating that data passed into and out of My Function via automation will be done using S PLUS vectors If this is done then the corresponding Visual Basic 4 0 code becomes simpler because we no longer need to set the parameter classes for the function before it is used Dim pArray 1 to 3 as double pArray 1 1 0 pArray 2 2 0 pArray 3 3 0 Dim pMyFunction as Object Set pMyFunction CreateObject S PLUS MyFuncti on PASSING DA OANTOS VA AJOATION pMyFunction a pArray pMyFunction Run Dim pReturnArray as Variant pReturnArray pMyFunction ReturnVal ue
21. estimates are accepted over the initial S estimates because the p value of the test for bias is 0 33 The default level of this test is set at 10 so whenever the p value of the test is greater than 10 the final M estimates are returned otherwise the initial S estimates are returned To change the level of the test for bias of the final M estimates to a different value you should specify the argument level for the mRobMM robust control function A higher value of evel will reject the final M estimates more often and a lower value of I evel will reject the final M estimates less often For example you can force the procedure to return the initial S estimates by using the following commands gt control s lt mRobMM robust control level 1 gt oi l s lt mRobMM Oi Market data oil df robust control control s Significant test at level 100 gt oil s Initial S estimates Call I mRobMM formula Oil Market data oil df robust control control s Coefficients Intercept market 0 06244374 0 8273216 Degrees of freedom 129 total 127 residual Residual scale estimate 0 1446283 175 CAPIR 22 RAS URES 176 Warning The bias is high inference based on final estimates is not recommended use initial estimates as exploratory tools Caveat T he above warning is only relevant when you use levels in the range of 1 to 10 and the choice of level in this range is a rather sub
22. pArray is now passed as a vector to MyFunction and pReturnArray is now retrieved from My Function as a vector 249 CAPIR 15 AJOMAICN IMPORMNSINSARLS 45 NEW AUTOMATION METHODS IN S PLus 4 5 T here are several new automation methods in S PLU S 4 5 Object Dialog Methods ShowDialogInParent boolean obj ShowDi al ogi nParent hwnd ShowDialogInParentMod eless boolean obj ShowDialogl nParentM odeless hwnd Object Methods ObjectContainees array objects obj Obj ect Contai nees class name string 250 Table 6 Displays a modal property dialog for an object in the automa tion client interface The client program is paused while the dia log is displayed Displays a modeless property dialog for an object in the automa tion client interface The client program continues executing while the dialog is displayed Returns an array of objects that are con tained by this object This method is not available for function objects Takes in a long number representing the win dow handle of the win dow you want the object dialog to appear inside Returns TRUE if suc cessful and FALSE if not Takes in a long number representing the win dow handle of the win dow you want the object dialog to appear inside Returns TRUE if suc cessful and FALSE if not Takes in a string repre senting the class name of objects to include in this array Returns an array o
23. pressing Enter after typing a left brace will result in the automatic insertion of a matching right brace two lines below and the cursor will be placed on the intervening line 289 CAPIR 17 NAVSAPT WNOOWFEAIURS Automatic W hen automatic indentation is enabled the editor automatically indents the Indentation bodies of function definitions if statements for statements and while statements T he amount of the indentation is by default 4 spaces and can be changed T he following sample function illustrates the indentation style that is supported testl lt function x if x gt 0 for i in i x cat i n else i lt X while i gt 0 catli Yp Les Te J Modifying The default settings of the Script Window can be changed by means of a Script Window dialog box accessed by right clicking in a Script Window and selecting i Property from the pop up menu Settings To disable any of the following properties de select the appropriate check box Auto Match and Auto Indent Auto Insert Right Brace e Output pane word wrap To change the Tab Size enter the number of spaces desired in the appropriate box To change the amount of time that matching parentheses etc are highlighted change the value in the box labeled M atch Time msec T he value shown isin milliseconds 290 In order to save the desired settings as defaults for future Script Wi
24. voltage This requires a linear relationship of the hazard rate on voltage Assuming that the relationship is not linear a more general model fits we g y amp a 0J In this model i indexes the different voltages and the location parameter is allowed to vary in an arbitrary manner with voltage Fitting this model is accomplished simply as gt censorReg censor days event factor voltage weights weights data capacitor2 Alternatively supposing that the scale parameters are different for different values of the covariate a model ve g y a O l can be fit using S PLUS statements gt censorReg censor days event strata voltage weights weights data capacitor2 In all but the last case an object of class censor Reg is produced In the last example when the strata function is used to create a stratified fit an object of class censorRegList is produced This object contains a list of class censorReg objects 211 CAPIRR 13 PARAMETIRC REGRESSION FOR ENED DA The anova function is used to compare the models described above This is discussed in more detail below Truncation Aside from the distributions above it is also possible to specify a different Distributions truncation distribution for each observation Consider the following table of failure times Table 4 Unit failure upper censor censor code tlower tupper trunc codes 1 7 2 right 0 3 2 2 2 4 2 exact 1 0 2 1 3 5 2
25. 000 In the output each row begins with a label indicating the observation interval The time interval is followed by the survival estimate the standard error for the estimate and approximate confidence intervals for the estimate THE CAAD KALANMAR SIME The kapl anMeier model computed above estimates the survival curve for a single sample If independent variables were available in the sample the values of all the independent variables must be identical if the results from kapl anMeier are to be meaningful If an independent variable is used on the right side of the formula it is treated as a stratification variable and separate survival curves are estimated for each value of the independent variable s Consider thecapacitor2 dataset distributed with S PLUS T his data set contains four variables 1 days gives the time of failure or censoring 2 event gives the censoring code 1 is a failure at time days while 0 is right censoring at time days 3 weights gives the number of observations represented by that row and 4 voltage gives the voltage at which the capacitor was tested there are four distinct voltages in the data set To analyze the failure date without regard to the test voltage the statement gt kaplanMeier censor days event 1 weights weights data capacitor2 would be used H owever this would ignore the different test voltages A better analysis would compute a nonparametric estimate of the failure time for
26. 3 so the row labels in the mul ti comp tables require explanation For the first table the label 1 adj 1 2 adj 1 refers to the difference between levels 1 and 2 of Fat the focus variable at level lof Surfactant the adjust variable whereas for the second table it is the difference between levels 1 and 2 of Surfactant at level 1 of Fat T he reader can verify that the table of differences reported by multicomp are the differences in the adjusted means for Fat Surfactant reported by model tables Significant differences are flagged with As a result of the of Surfactant and Fat interaction the 119 CAPIR 10 TE III SMO SARS ANDADLSED MAB Estimable Functions Fat Fat Fat Fat Fat Fat Fat Fat Fat 120 wnrrPwnr won Intercept Flour Flour Flour Flour Fat Fat Fat Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant wwwnnn ee FP FY worn oooroeoro 1 2 3 de 1 2 3 oooo oO OO OO oO oo F test for the equivalence of the Surfactant marginal means is not significant but there exists significant differences between the mean of Surfactant levels 1 3 at a Fat level of 2 and between the means Surfactant levels 1 3 and 2 3 at a Fat level of 3 The Type and Type III estimable functions for the over parameterized model show the linear combinations of the over param
27. 8 13 The Compute D isimilarities dialog Data Frame Specify the data frame Metric Select the metric to be used for calculating dissimilarities between objects The available options are euclidean and manhattan Euclidean distances are root sum of squares of differences and manhattan distances are the sum of absolute differences Standardize Variables Check this to standardize each data column by subtracting the variable s mean value and dividing by the variables mean absolute deviation 109 CAPIR8 CLBIERNGINSRLS Special Variable Types Save Model Object 110 Ordinal Ratio Select variables to be treated as ordinal ratio variables Log Ratio Select variables to be treated as log ratio variables Asymmetric Binary Select variables to be treated as asymmetric binary variables Save As Enter thename for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten Related programming language functions daisy COMPUTE DSSMLARTIES CREATING HTML OUTPUT Tables 112 Text 113 Graphs 114 S PLUS provides a variety of tools for generating HTML output This chapter discusses how to generate HTML tables save preformatted text output and save graphs with H TM L references 111 CAPIRY GEAINGHM OURO TABLES 112 Theht ml table function may be used to generate a vector of character strings representing
28. Data by Group e x Data Results Data Frame gt Result Type List Columns to Split ll Variables C Separate D F s m Splitting Variable Group Column fi v Maximum Unique Numeric Values fi 0 Number of Bins for Numeric Yalues Save As flast split I Show in Data Window FS raat pf rn Figure 6 5 The Split D ata by Group dialog Data Splitting Variable Data Frame Specify the data frame to split into separate data frames Columns to Split Specify the columns to include in the new data frames By default all columns are included Group Column Specify the column to use as the splitting column If this column isa factor a 65 CAPIR6 MNPUAINGDYA Results 66 new data frame will be created for each level of the factor If this column is numeric the number of new data frames is determined by Maximum Unique N umeric Values and N umber of Bins for N umeric Values Maximum Unique Numeric Values If the Group Column is numeric with at most Maximum Unique Numeric Values unique values then a new data frame will be created for each unique value of the column If there are more than M aximum Unique Numeric Values unique values then the data will be split into Number of Bins for Numeric Values new data frames by classifying the grouping variable into the specified number of bins of equal width Number of Bins for Numeric Values Number of new d
29. Distribution of Replicates Check this to plot the distribution of the replicates for each statistic of interest Normal Quantile Quantile Check this to plot a Normal quantile quantile plot for each statistic of interest Related programming language functions jackknife 86 JAKNE INFERENCE CLUSTERING IN S PLus K M eans Clustering Model Page Results Page Partitioning Around M edoids Model Page Results Page Plot Page Fuzzy Partitioning Model Page Results Page Plot Page Agglomerative H ierarchical Clustering Model Page Results Page Plot Page D ivisive Hierarchical Clustering Model Page Results Page Plot Page M onothetic Clustering Model Page Results Page Plot Page Compute D issimilarities 88 88 89 90 90 92 93 94 94 96 97 98 100 101 102 102 104 105 106 106 107 107 109 87 CAPIR8 CLBIERNGINSRLS K MEANS CLUSTERING Model Page Data Options 88 This dialog performs k means clustering See chapter 18 in the Guide to Statistics for details To perform k means clustering Choose Statistics Cluster Analysis K Means from the main menu The dialog shown below appears K Means Clustering Of x Model Results Data r Save Model Object Save As last cluster Data Frame Options Number of Clusters 2 Maximum Iteration fi 0 Cancel Apply current Help Data Frame Specify the data frame To use a subset of rows o
30. If this is specified sampling will be done within each group so that subgroup proportions in the resamples match those of the original sample This provides inference condition upon subgroup size Random Number Seed Specify an integer between 0 and 1000 to set the random number seed to a desired value Specifying the seed allows a way to obtain identical results from multiple bootstrap runs Block Size Specify the block size to use when calling the sampling function See the language help for bootstrap for details Print Iteration Numbers Check this to display iteration progress by printing iteration number ranges Due to the timing of output display this is not as useful from the dialog as from the command line function call Assign Resampled Data to Frame 1 Check this to assign the resampled data to frame 1 as each sample is generated See the language help for bootstrap for details BOIR INANE Bootstrap Inference Ex Model Options Results Plot Jack After Boot r Printed Results MV Summary Statistics Percentile Options Percentile Levels c 0 025 0 05 0 95 Empirical Percentiles V BCa Percentiles Correlation Matrix of Estimates Cancel Apply f current Figure 7 3 The Bootstrap Inference dialog Results page Results Page Printed Results Summary Statistics Check this to print basic summaries such as the bootstrap estimates of bias mean and standa
31. Loading M odules 54 S PLUS Version 4 5 includes several small improvements to make file Operations smoother and easier These include improved support for spreadsheet and database import and menu options for loading modules and libraries 51 CEES ALE IMPPORMNS NEW INPUT OUTPUT FEATURES 52 Importing data using the Import Data dialog has been enhanced for S PLUS 4 5 by the following new features A separate entry for Foxpro files has been added to the Files of type field Some users experienced difficulty using the D base Foxpro option on S PLUS 4 0 A Page field has been added to the O ptions page for file types that support paged data eg Excel This allows you to specify from which page of a multi page spreadsheet you wish to read Previously S PLUS always read from the first page e A Name Col field has been added to the Options page This field allows you to designate one column of the imported data to be used as rownames in the same way that the N ame Row field allows you to designate a row for use as column names An Import Text as Factors field has been added to the O ptions page By default text columns shorter than 250 rows are read as factors longer columns are read as character data If you set this field to N ever all text columns are imported as character data If you set this field to Always all text columns are imported as factor data Editing datain the D ata W indow has been speed
32. Model Results Plot m Data Result j Data Frame b Save As flast cluster I Data is Dissimilarities M Save Data Dissimilarity Measure M Save Dissimilarities Metric euclidean bi I Standardize Variables Cancel Apply f current Help Figure 8 7 The DivisiveH ierarchical Clustering dialog M odd page Data Frame Specify a data frame or a dissimilarity object To use a subset of rows or columns use standard S PLU S subscripting of the data frame Note that all columns of the data frame must be numeric If non numeric columns e g factors are present use the Dissimilarities dialog to produce adissimilarity object and then use this object in clustering The Dissimilarities dialog provides special options for handling factors ONSE HEARTH CLSIERNG Dissimilarity Measure Result Data is Dissimilarities Check thisif Data Framenamesadi ssi mil arity object Metric Select the metric to be used for calculating dissimilarities between objects The available options are euclidean and manhattan Euclidean distances are root sum of squares of differences and manhattan distances are the sum of absolute differences If Data Frame is already a dissimilarity matrix then this argument will be ignored Standardize Variables Check this to standardize each data column by subtracting the variable s mean value and dividing by the variable s mean absolute deviation If D ata Frame is already a dissimi
33. Plot Printed Results Saved Results Qutput Type C None Save ln cy at T Cluster Membership Long i Cancel Apply i current Output Type Select N one for no printed output Short for a short printed summary or Long for amore detailed printed summary Save In Specify the name of a data frame in which to save cluster membership if Cluster Membership is checked 92 PARITIONNS ARQND MDOLLA Cluster Membership Check this to save a vector of indices giving cluster memberships in the specified data frame Partitioning Around Medoids Model Results Plot Plots I Clusplot Silhouette Plot Cancel Apply current Plot Page Plots Clusplot Check this to create a clusplot for the clustering Silhouette Plot Check this to create a silhouette plot for the clustering Related programming language functions pam clara 93 GHPIRS CLSERNGINSALE FUZZY PARTITIONING This dialog performs fuzzy partitioning See chapter 18 in the Guide to Statistics for details To perform fuzzy partitioning Choose Statistics Cluster Analysis Fuzzy Partitioning from the main menu T he dialog shown below appears Fuzzy Partitioning ME Ei Model Results Plot m Data m Options Data Frame bi Number of Clusters 2 I Data is Dissimilarities Result m Dissimilarity Measure Save s fast cluster Metric euclidean
34. Run the file called Setup exe from the SPSSWiz subdirectory of the S PLUS program directory on the server system and follow the steps to install the add in MON THE SALES PSADIN REMOVING THE S PLUS SPSS ADD IN If you installed the S PLUS SPSS Add in during S PLUS setup when you choose to remove S PLUS this add in will automatically be renoved from SPSS by S PLUS setup If you manually installed the add in such as in the case of a workstation as detailed above you will need to manually remove this add in from SPSS Run the file called Setup exe from the SPSSW iz subdirectory of the S PLUS program directory on the server system and follow the steps to renove the add in 45 CAPIRR4 SAs SSADIN USING THE S PLUS SPSS ADD IN When installed in SPSS whenever you have the data editor open the following menu and toolbar will be available Untitled SPSS Data Editor File Edit View Data Transform Statistics Graphs Utilities Window Help slaja S a 5 le a ere T he same menu and toolbar are also available whenever you have an output document open S PLUS graphs created with this add in are placed in an output document You havea choice to create a new output document or to use an existing one T here are several options on the toolbar and in the menu i Create anew S PLUS graph with the currently selected variables in the data editor To use this option follow these steps 1 Select
35. S PLUS working database Built in example data such as fuel frame and environmental do not appear in the list but may be specified by typing in the name New Name N ame for new data frame If the name of an existing data frame is specified the existing data frame will be displayed ART DIA Show Dialog on Startup Check box indicating whether to display this dialog whenever S PLUS is started T his option may also be specified on the Startup page of the G eneral Settings options dialog You can also use the Startup page to specify whether you want an Object Browser and or Commands window to display on startup 59 CAPIR6 MNPUAINGDYA FACTORIAL DESIGN Factorial Design m Design Structure Levels Fraction T his dialog creates a factorial or fractional factorial design To create a factorial design Choose D ata D esign Factorial from the main menu The dialog shown below appears I Randomize Row Order Number of Replications Restricted Factors fi m Results Save s last design Randomization Names Factor Names Row Names I Show in Data Window m Cancel Apply d current Help Figure 6 2 The Factorial Design dialog Design Structure Levels 60 Enter a vector of the number of levels for the factors in the design For example to generate a design with three levels of one variable and two levels of another specify c 3 2
36. The Printout page looks like this 131 CAPRI POWRRANDSMAE SE Normal Power and Sample Size Of x Model Options Printout Columns Mean o Mean2 o Sigmal or Paired 2 Sigmal for Paired 7 r Alt 3 Mean2 or Alt 7 x Reset Fill Down Digits r Null ji x Mean or Null 7 x omit d siama 0 m 4 Deta Foo a 5 Alpha Po H 6 i Power Po H omit Z N2 0 omit y AAN 0 ra bie Ob ject Export Object Object Name Text File i Cancel Apply i current Figure 11 3 TheNormal Powe and Sample Size dialog Printout page Columns Group Digits Group 132 This group allows you to control which columns are printed and in what order To drop a column choose omit W hen a column number is changed the others are adjusted accordingly For example in the above dialog if you were to change Alpha to 7 Power and N 1 would each be reduced by 1 Pressing the Reset button will restore the values to their defaults The number of digits can be controlled for each column individually Pressing the Fill Down button will copy the last selected digit down the list NAML POWER AND AMALE SE Save Object Group Export Object Group Object Name If you enter a name here the printed table will be saved as a data framein the working directory Text File Entering a file name or fu
37. Xa j B T Ny j l n where n kn we ll construct a two sided test of equality of means HiT 1 A TET which is more conveniently written Hi T T 0 H T m 0 Using our best estimator of the parameter z we can begin constructing a test BNMA DYA statistic ny A 1 1 ny l i i 1 Ny T aos X Maken 2 j j 1 ni ny RARR 1 T l1 T is N m 1 m0 m In the case where the null hypothesis is true so m 2 7 this can be written as A M0 D1 3 Immediately a problem arises namely the variance needed to construct the test statistic depends on the parameters being tested It seems reasonable to use all of the data available to estimate the variances and that is exactly what isdone A weighted average of the two estimates for the proportions is used 149 CAPRI POWRRANDSME SE to estimate the variance under H The test statistic then is E NT NT Ty kt ni n 1 k t2 T fae m A gt Ny Ny If the null hypothesis is true this gives Z N O 1 We use this to derive the formula without continuity correction 2 1 7 1 T 1 7 k ZPower t m 14 7 2 9 2 E T2 7 Z Applying the two sample adjustment for a continuity correction produces the final results P oe tt k 1 Ny kn Examples for two sample use p2 instead of p alt gt summary binomial sample size p2 0 3 delta power nl n2 1 0 2 0 8 103 103 Don t round sampl
38. Y data This will create two line plots the first one with X data as the A column and Y data as the B column next second plot with X data as the A column and Y data as the C column You could also have selected the same data using discontiguous column selection 1 2 3 4 5 6 In this case rows 1 to 6 in column A were first selected the control key was held down then the block from B1 to C6 was selected This selection will produce the same graph with two plots as the above example If a plot expects only one column of data for a given dimension such as the X data for a line plot and more than one column is included in the selection only the first column in the selection will be sent to S PLUS to make the graph For example using the above data you select the blocks A1 B6 and C1 D6 41 CAPIR3 SA B ADIN 42 in 4 1 The Create Graph wizard will send A1 A6 as the X data C1 D6 as the Y data to create two line plots Selecting data for conditioning S PLUS graphs When you are using the Create Graph wizard in step 2 you can specify an Excel worksheet and data range to use for conditioning the graph you are creating A conditioned graph allows you to view your data in a series of panels where each panel contains a subset of the original data T he subset in each panel is determined by the levels of the conditioning data range you select You can skip conditioning by leaving the Conditioning range edit
39. a boolean parameter indi cating how the result should be formatted Returns a string repre senting the result of exe cuting the syntax passed in Takes in a VARIANT representing a byte ar ray of the SAPI object to set and a string repre senting the name of the object to set Returns TRUE if successful otherwise FALSE 251 CAPIR 15 AJOMAICN IMPRORMNSINSRLS 45 GetSAPIObject byte array variant obj Get SAPI Obj ect object name string Function Object Methods SetParameterClasses boolean obj SetParameterClasses comma delimited string GetParameterClasses string array obj GetParameterClasses GraphSheet Object Meth ods 252 Table 6 Returns a binary SAPI object into a variant byte array giv en the name of the ob ject in S PLUS Returns TRUE if suc cessful FALSE if not Returns an array of strings representing the class names of the return value followed by each of the param eters of the function Takes in a string repre senting the name of the SAPI object to return Returns a variant byte array representing the object found If no ob ject could be found the variant will be empty Takes in a comma de limited string specifying class names of the re turn value followed by each parameter of the function It is required that the return value class name be specified first and that the number of class names specified in this string match t
40. a vector matrix or data frame as an HTML table The vector will contain one string for each line of HT ML This may be written to a file by specifying the f i I e argument or may be manipulated and later written to a file using thewri t e function For example we can createafilecat al yst ht mcontainingthecatal yst data frame using gt html table catalyst file catalyst htm In addition to accepting a vector matrix or data frame the ht ml tabl e function will accept a simple list with such structures as components of the list It will then produce a sequence of tables with the list component names encoded as table captions For example gt my results lt list Regression Coefficients coef I m Mil eage Wei ght fuel frame Correlations cor fuel frame 1 3 gt html table my results file my htm Theht ml table function accepts any of the arguments to format allowing specification of formatting details such as the number of digits displayed In addition append controls whether output is appended to the specified file orthefileis overwritten Theappend argument is also available in the write function which is useful for interspersing ht ml table output and descriptive text gt write lt H3 gt S PLUS Code for the above lt H3 gt Continue string lt P gt Put code here lt P gt file my htm append T Additional arguments to ht ml tabl e are described in the function s help fi
41. algorithm for small problems Once the initial S estimate B is computed the final M estimate is obtained as the nearest local minimum of the M estimate objective function For details on the numerical algorithms used see M arazzi 1993 whose algorithms routines and code were used in creating 1 mRobMM A robust M estimate of regression coefficient 6 is obtained by minimizing yi xi P i 3 p z 5c where p c is a convex weight function of the residuals with tuning constant c The derivative of p c lly denoted by WC sc both the initial S estimate and the final M estimate in S PLU S two different weight functions can be used Tukey s bisquare function and an optimal weight function introduced in Yohai and Zamar 1998 Tukey s bisquare functions p c and w c areas follows 58 3443 ifls ce P r sc c c c 1 ET 6 hate Tiati i lt y r c Ee rao ge ee 1 wisi The Yohai and Zamar optimal functions p c and w c areas follows TEFA EALS The Efficient Bias Robust Estimate Efficiency Control Robust R Squared 2 salt 3 25 c if gt 3 r r r r 3 P r3c c 1 792 h o h Cy thy h 1 if 2 lt i if lt 2 oer 1i S 2 7 0 if gt 3 C lt 3 r C r r 3 r 5 r 7 Wtsc 4clg 82 g COC 8 if2 lt C C C C r if lt 2 where g 1944 g 1728 g 0312 g 0 016 and fn By 4 6 8 Yohai and Zamar
42. ammoniais lost during the process of producing nitric acid by dissolving the ammonia in water Three variables air flow water temperature and acid concentration may influence the loss of ammonia T he stack loss response data is contained in the vector stack loss and the three independent variables are contained in the matrix stack x First you combine the response and independent variables into a data frame stack df gt stack df lt data frame Loss stack loss stack x Then you compute an LS fit object stack Is gt stack Is lt Im Loss Air Flow Water Temp Acid Conc data stack df and finally compute a robust fit object stack robust gt stack robust lt mRobMM Loss Air Flow Water Temp Acid Conc data stack df Now you use thep ot function to visualize the fit gt plot stack robust Make a plot selection or 0 to exit plot All plot Residuals vs Fitted Values plot Sqrt of abs Residuals vs Fitted Values plot Response vs Fitted Values plot Normal QQplot of Residuals plot r f spread plot ao UG PeU N BPe 161 CAPIR 22 RAS URES 162 Selection N ote that C ook s distance is not currently available when a robust method is used Now you can compare the plot of residuals versus fitted values for both the LS fit and the robust fit using the following commands gt par mf row c 2 1 gt plot stack Is which plots 1 gt plot stack robust
43. anova censorReg pftdist qftdist Other related S PLUS language functions formula Im solve censor NEW GUI TOOLKIT FUNCTIONS The S PLUS GUI toolkit is a set of S PLUS functions that enables communications between S PLUS applications and Windows For S PLUS Version 4 5 the GUI toolkit has been expanded Chapter 11 of the S PLus Programmer s Guide Programming the U ser Interface using S Plus includes a thorough discussion of the GUI toolkit as it existed in S PLUS 4 0 at least a casual reading of that chapter is a helpful prerequisite to the present chapter This chapter describes how to use the new GUI toolkit functions to either query the GU I for existing settings or to allow S PLUS functions to alter the Settingsin the GUI guiSetOption Use the gui Set Option function to set options available in the GUI under the O ptions menu For example to disable Tool Tips in dialogs you would use gui Set Opti on as follows gt guiSetOption ToolTipsForDialogs F guiGetOption Use the gui Get Option function to obtain the current value of any option available in the GUI under the Options menu For example to get the current Trellis background color usegui Get Option as follows gt guiGetOption BackColorTrellis 1 Lt Gray guiSetRowSelections Use the gui Set RowSelections function to specify one or more rows of a data set as selected that is they appear highlighted in a D ata window view and plotted symbols appear hig
44. double clicking on the color scale legend Labels Page T he Labels page allows the users to specify the output format and font for the labels on the scale bar Rotation and offset of the labels from the bar are specified here as well All of these options work the same as the labels for 2D axes Scale Legend 1 x Labels Ticks Box Pasition Size Title r Label Specs Label Style Type auto Font arial Precision nn Color EE Start Value y Size p2 O SeriesIncrement A Bod Column F T Italics Data Set air T Underline l Strikeout Rotation jo Offset Auto C Cancel Apply d current Help 27 CAPIRR2 NAW INIERFOINE GAEHC GPABLITIES RR SALS45 Ticks Page T he Ticks page allows users to specify the properties of the ticks on the scale bar The options work the same as with a 2D axis Scale Legend 1 x Labels Ticks Box Position Size Title l r Scale Range Tick Range Minimum Auto First Tick auto Maximum Auto Last Tick auto Interval Ticks Interval auto Length 0 04 Interval Type Auto hd Weight 1 4 E Eolumn E Data Set air 7 d current Help Cancel Apply 28 COQ SAE KINS Box Page T he Box page gives control over the format of the outer border of the scale legend as well as the scale bar Scale Legend 1 x Labels Ticks
45. exact 1 0 2 1 4 9 2 right 0 3 2 2 5 4 2 left 2 9 2 0 6 5 9 interval 3 3 20 3 7 7 12 interval 3 3 20 3 8 4 2 exact 1 0 2 1 9 11 2 right 0 3 2 2 212 In truncated data the item being tested is not observed over the entire positive axis Instead observation of the item is made over a known interval that is a subset of the time period in which the observation could fail Thus if there is left truncation the items under test may be manufactured used for a time and then placed on test Although the time to failure is scored as the time since manufacture items that fail prior to being placed on test are not scored Let t O be the time of manufacture and suppose that testing is not begun until Then if F isthe cumulative distribution of the failure time when observation starts at time zero then the cumulative distribution of the truncated failure times is given by F t 1 F 0 Similarly in right truncation observation of failure or censoring is only made F tl CRAG until t so that observations that fail or are censored after time 0 cannot be observed or are thrown out Finally in interval truncation observation is made over a fixed interval 8 8 and observations that fail or are censored outside of the interval are not considered Truncation distributions can easily be fit using the censorReg function For example to obtain a gaussian fit to the data above one would use gt tmp lt
46. odel O bjects 160 Line W eight Increment 24 linear regression 186 Im 236 ImRobM M function 156 M Meeker W Q 201 M ethod to get and set parameter classes of functions exposed via automation 247 M M estimate 156 M odifying Script Window Settings 290 modules add on 13 mona 108 M onothetic Clustering 106 M onothetic Clustering dialog M odel Page 106 Plot Page 107 Results Page 107 N ew Automation M ethodsin S Plus 4 5 250 N ew Dialog Controls In S Plus 4 5 283 No Conditioning 22 0 O bjectC ontainees 250 O bjectC ontainer 251 oil df data set 158 OneSampleT est of Binomial Proportion 146 OneSampleT est of Gaussian M ean 140 on linehelp 12 Orthogonal Array D esign dialog 62 Design Structure 62 Randomization 62 Results 63 P pam 93 Pan Down 21 Pan Left 21 Pan Right 21 Pan Up 21 Panels with Varying X and Y Axes 23 Parametric Regression For Censored Data 199 Parametric Survival dialog 227 M odel page 227 O ptions page 230 Plots page 233 Predict page 235 Results page 231 Partitioning Around M edoids 90 Partitioning Around M edoids dialog M odel Page 90 Plot Page 93 Results Page 92 Passing D ata to Functions via Automation 246 PathN ame 251 pftdist 236 plot censorReg 236 PLOTDATA XLS 258 295 INEX Plots in Separate Panels 22 print censorR eg 236 Q aftdist 236 quantile quantile plot 195 R Recode dialog 64 Data 64 Values 64 Registering an ActiveX control 267 Resampling M ethods 75 Resc
47. of Biostatistics Third Edition PW S Kent Boston Fisher Lloyd D and Van Bele Gerald 1993 Biostatistics Wiley N ew York Fleiss Joseph L 1981 Statistical M ethods for Ratesand Proportions Wiley N ew York ROBUST LINEAR REGRESSION OVERVIEW OF THE ROBUST REGRESSION METHOD Key Robustness Features of the Method The Essence of the Method a Special M Estimate Using the ImRobMM Function to Obtain a Robust Fit Comparison of Least Squares and Robust Fits Robust Model Selection COMPUTING LEAST SQUARES AND ROBUST FITS Computing a Least Squares Fit Computing a Robust Fit Least Squares vs Robust Fitted Model Objects VISUALIZING AND SUMMARIZING THE ROBUST FIT Visualizing the Fit with the pl ot Function Statistical Inference with the summary Function COMPARING LEAST SQUARES AND ROBUST FITS Creating a Comparison Object for LS and Robust Fits Visualizing LS vs Robust Fits Statistical Inference for LS vs Robust Fits ROBUST MODEL SELECTION Robust F and Wald Tests Robust FPE Criterion CONTROLLING OPTIONS FOR ROBUST REGRESSION Efficiency at Gaussian Model Alternative Loss Function Confidence Level of Bias Test Resampling Algorithms Random Resampling Parameters Genetic Algorithm Parameters THEORETICAL DETAILS Initial Estimate Details Optimal and Bisquare Rho and Psi Functions The Efficient Bias Robust Estimate Efficiency Control 151 151 151 152 153 153 154 154 155 156 157 157 159 162 162 162 164 166 166 167
48. quantities as standard errors and t statistics of coefficients R squared values etc For further information read the section T heoretical D etails below You are fitting a general linear model of the form y xiBte i l n with p dimensional independent predictor independent variables x and coefficients B and scalar response dependent variable y S PLUS computes a robust M estimate B which minimizes the objective function y of Yi P i 1 155 CPRD RAS LUNAR AGEN Using the 1lmRobMM Function to Obtain a Robust Fit 156 where s is a robust scale estimate for the residuals and p is a particular optimal symmetric bounded loss function described in the Theoretical D etails section T he shape of this optimal function is shown in Figure 4 below Alternatively B isa solution of the estimating equation z y x 3 pe fe 05n i S where y p isaredescending non monotonic function A key issue is that since p is bounded it is non convex and the minimization above can have many local minima Correspondingly the estimating equation above can have multiple solutions S PLUS deals with this by computing highly robust inital estimates B and s with breakdown point 0 5 using the S estimate approach described in the Theordical Details section and computes the final estimate B as the local minimum of the M estimate objective function nearest to the initial estimate Werefer to an M estimate of thi
49. related to the results that would be obtained when the product is subject to normal wear Thus for example capacitors may be operated under higher temperatures and voltages than normal to increase their likelihood of failure T he resulting fitted model is used to extrapolate failure rates back to normal operating conditions Similar useis made of these failure time distributions in the context of survival analyss where living organisms rather than engineered products are the primary interest In the context of environmental studies the measures of interest may be chemical contaminant levels rather than failure times but these data are frequently censored or obtained from truncated distributions C ensored and or truncated data regression methodology applies equally well in these cases but of course the values of interest have nothing to do with survival M odel selection is a major concern when using censored regression models As in other model fitting activities the distributional assumptions that are made must be appropriate for the data collected and the model must also reasonably account for variation in the independent variables C onsequently visual comparisons of the predicted from the model distribution of the response with nonparametric estimates of the distribution is an important activity when fitting models To obtain the most appropriate model usually a number of models with different failure distributions and or dependence
50. shows how to embed an S PLUS graphsheet modify it by using automation save it delete objects in it and how to display an object dialog Example Visual Basic 4 0 project that demonstrates creating a graphsheet adding an arrow to it changing the properties of the arrow showing a dialog for the arrow executing S PLU S commands modifying option values getting an object and sending and receiving data This directory contains several examples of using Visual Basic for Applications in Excel auto_vbaxls Demonstrates sending and receiving data and converting Excel ranges to arrays plotdata xls Demonstrates embedding a graphsheet and adding and modifying a plot in it xfertodf xls Demonstrates transferring Excel ranges to S PLU S dataframes and back to Excel This directory contains an example Visual Basic 4 0 project that shows how to register an S PLUS function as automatable how to pass binary data to the function and how to receive the result of the function back in VB This directory contains an example Visual Basic 4 0 project that demonstrates the use of the following atuomation methods ShowDi al og ShowDi al ogl nParent 259 CAPIR 15 AJOMAICN IMPORMNSINSRLS 45 260 objects creatept ShowDi al ogi nParent Model ess This directory contains an example Visual Basic 4 0 project that demonstrates the use of O bjectC ontainees O bjectC ontainer ClassN amet and PathN ame automation m
51. the stock T he default isp if n p 2 islessthan p wheren isthe number of observations otherwise it is the minimum of trunc n p 2 and 5 p Genetic Births Enter the number of genetic births T he default is 50 p 15 p 2 Mutation Prob Enter alength 4 vector of mutation probabilities for offspring Stocks Enter alist of vector of observation numbers to beincluded in the stock T his is typically the st ock component of the output of a previous run Stock Prob Enter a vector of cumulative probabilities that a member of the stock will be chosen as a parent The ith element corresponds to the individual with the ith lowest objective T he default is cumsum 2 popsize 1 popsize popsizet1 191 CAPIR 22 RAS LINAR AGEN Results Page Robust Linear Regression Of x Model Options Results Plot Predict Printed Results Saved Results I Short Output Save In SY MV Long Output Fitted Values F Correlation Matrix of Estimates Residuals M ANOVA Table I Comparison with LS Fit i Cancel Apply KE GCE Printed Results Short Output Check here to display a short summary of the modal fit This includes the model formula the robust estimates of regression coefficients and residual scale and the degrees of freedom Long Output Check here to display a detailed summary of the modal fit T his includes the model formula a five number summary of the residuals the robust estimates of coefficients robust st
52. the stock has somewhat less volatility and expected return than the market Also note that the robust scale estimate is 0 14 whereas the scale estimate from LS is 0 49 The LS scale estimate is based on the sum of squared residuals and thus considerably inflated by the presence of outliers in the data The object returned by the m function for LS fit is of class 1 m gt class oil Is 1 Im On the other hand the object returned by mRobMM is of class 1 mR ob MM gt class oil robust 1 1 mRobMM Just as with an object of class I m you can easily visualize print and summarize robust fit objects of class 1 mRobMM using the generic functions plot print and summar y VAIZNGA DS MARAN THE RBS AT VISUALIZING AND SUMMARIZING THE ROBUST FIT Visualizing the For a simple linear regression you can easily see outliers in the scatter plot as Fit with the plot Function in the above example H owever in multiple regression it is not so easy to tell if there are some outliers in the data and what the outliers are N onetheless S PLUS makes it easy for you to visualize the outliers in a multiple regression To illustrate this point let us use the well known stack loss data Set TheS PLUS product includes the stack loss data set which has been analyzed by a large number of statisticians T he stack loss in this data set is the percent loss times 10 of ammonia during 21 days of operation The
53. to modify the layout of an S PLUS graph embedded in a SPSS output document and to modify the properties of a plot in an embedded S PLUS graph in SPSS A helpful wizard guides you through the process of selecting variables choosing an S PLUS graph and plot type and creating the graph in SPSS 43 CAPIRR4 SAs SSADIN INSTALLING THE S PLUS SPSS ADD IN Installation during S PLUS setup Manual installation 44 During typical custom or server installation of S PLUS 4 5 S PLUS setup will examine your system for an appropriate version of SPSS The S PLUS SPSS Add in requires SPSS version 8 0 or higher O nce detected setup will automatically enable the option to install this add in You can disable installation of the add in by choosing the custom install and un checking this option from thelist of options At the end of setup you will be prompted to install the S PLUS Add in Setup will then start a special installation program for this add in Just follow the steps in the installation program W hen completed you will see a successful completion dialog If you choose not to install the S PLUS SPSS Add in during S PLUS setup you can install this option at any later time using S PLU S setup and choosing the custom setup mode Then select the S PLU S Add in for SPSS from the list of custom setup options If you installed the S PLUS SPSS Add in on a server you can install the add in on a workstation without using S PLUS setup
54. variables in the data editor you want to graph with S PLUS 2 Click on this button or select the Create Graph option from the S PLUS menu 3 Follow the wizard to create the graph 46 WNG THE SALE SSADIN M odify the layout properties of the currently sdected S PLU S graph To use this option follow these steps 1 3 1 2 3 4 5 Selecting data for S PLUS graphs Select an S PLUS graph in an output document by clicking once on it If you double click on an S PLUS graph you will activate it and start editing in place Click on this button or select the M odify Graph Layout option in the S PLUS menu An S PLUS graph sheet layout dialog will appear in SPSS allowing you to modify any of the layout properties of this graph M odify the properties of a plot in the currently selected S PLUS graph To use this option follow these steps Select an S PLU S graph in an output document by clicking once on it Click on this button or select the M odify Plots option in the S PLUS menu A dialog will appear showing you a list of the graph areas in this graph you can have multiple graph areas in a graph i e one graph area might be 2D and another might be 3D in thesame graph and for each graph area a list showing all the plots in this graph area Select the graph area and the plot in this area you want to edit Click next An S PLUS plot properties dialog will appear in SPSS allowing y
55. which pl ots 1 Figure 2 shows those two plots As you can see the robust fit pushes the outliers further away from the majority of the data so that you can more easily identify the outliers SAANGADS MARAN THE RBS AT LS Fit Robust Fit od 4 4 3 3 a H o wo 4 o ad o o o o o a Oepie erakina trei n a a eee seen o 5 a 3 g o amp 5 o 3 E SE ONG EIE IE EEA AAE T TFE ke ke o n no 8 o a o i o y A o 9 o o o 4 wo 4 o 4 21 21 T T T T T T T T 20 30 40 10 15 20 25 30 35 Fitted Air Flow Water Temp Acid Conc Fitted Air Flow Water Temp Acid Conc Figure 12 2 Reddualsvs Fitted Values Stack Loss D ata Statistical Inference with the summary Function The generics ummary function provides you with the usual kinds of inference output e g t values and p values along with some additive and useful information including tests for bias For example to obtain more information about the robust fit oil robust usesummary on this object gt summary oil robust Final M esti mates 163 CAPIR 22 RAS UGRESS 164 Call mRobMM formula Oil Market data oil df Residuals Min 1Q Median 3Q Max 0 4566 0 08875 0 03082 0 1031 5 218 Coefficients Value Std Error t value Pr gt t Intercept 0 0840 0 0281 2 9929 0 0033 Market 0 8289 0 2834 2 9245 0 0041 Residual scale estimate 0 1446 on 127 degrees of freedom Proportion of variation in re
56. 0 or higher For your convenience a copy of RegSvr32 exe is located in the SAMPLES OCX directory along with two useful batch files RegO CX BAT and UnRegO CX BAT which will register and unregister acontrol You can modify these batch files for use with controls you design 267 CAPIR 16 DACGCNIROSINSALS 45 Why only OCX String Common error conditions when using ActiveX controls in S PLus 268 You typically do not ever need to unregister an ActiveX control unless you wish to remove the control permanently from your system and no longer need to use it with any other container programs such as S PLUS If this is the case you can use RegSvr32 exe with the u command line switch as in UnRegO CX BAT to unregister the control In S PLUS several different types of properties exist There are string single select lists multi select lists numeric and others This means that a property in a dialog communicates data depending on the type of property selected A string property communicates string data to and from the dialog A single select list property communicates a number representing the selection from the list a multi select list communicates a string of selections made from the list with delimiters separating the selections For Activex controls only string communication has been provided in this version This means that the control should pass a string representing the value or state of the
57. 0000 0 2250 0 1429 0 2499 0 2520 0 2210 0 2733 1 1 1 Thecolumns labeled L2 L3 and L4 are for the Flour hypothesis L6 and L7 are for the Fat hypothesis L9 and L10 are for the Surfactant hypothesis and L12 L13 L15 and L16 are for the Fat x Surfactant hypothesis In contrast the Type III estimable functions can be obtained from the generating set x x X X where X X is the g 2 inverse of the cross product matrix Kennedy and Gentle 1980 p 396 and perform the steps outlined in the SAS STAT User s Guide 1990 pp 120 121 Fat Fat Fat Fat Fat Fat Fat Fat Fat wow N e we Ne we N re Intercept Flour Flour Flour Flour Fat Fat Fat Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant Surfactant 1 2 3 4 1 2 3 1 2 3 1 1 1 2 2 2 3 3 3 L2 L3 L4 0 gt gt eo c amp ceoeceeoeoeeseesceesorKYoe sos H s 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 o o o oo o o o o o o e o m o o o o gt round L3 4 L6 0 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 sean 0000 13333 EEEk 0000 reel EL 13333 0000 0 3333 o o oo o oOo o o o o m m o o o o o L7 0 0000 0 0000 0000 0000
58. 169 169 169 171 173 173 174 175 175 176 177 177 153 CPRD RAS LINAR AGEN 154 Robust R Squared Robust Deviance Robust F Test Robust Wald Test Robust FPE RFPE Appendix ROBUST MM REGRESSION BIBLIOGRAPHY 177 179 179 179 179 180 182 194 ORBENO TH RRS REGRESSION MHD OVERVIEW OF THE ROBUST REGRESSION METHOD Key Robustness Features of the Method The Essence of the Method a Special M Estimate This section provides you with an overview of the tools at your disposal for computing a modern robust linear regression model in S PLU S including robust inference for coefficients and robust model selection You find out how to use the robust regression tools in detail in the sections that follow You will learn how to fit a linear model using a modern robust method that has the following general features In dataoriented terms the robust fit is minimally influenced by outliers in the independent variables space in the response dependent variable space or in both In probability oriented terms the robust fit minimizes the maximum possible large sample size coefficients estimate bias due to a non Gaussian contamination distribution model which generates outliers subject to achieving a desired large sample size coefficient estimates efficiency when the data has a Gaussian distribution T he statistical inference produced by the fit is based on large sample size approximations for such
59. 198 199 200 202 202 204 207 207 208 210 212 215 216 218 220 225 227 228 230 231 233 235 237 237 237 239 240 vii NES Chapter 15 Automation Improvements in S PLus 4 5 Passing D ata to Functions via Automation M ethod to get and set parameter classes of functions New Automation Methods in S PLus 4 5 Automating Embedded S PLus Graphs Examples Of Automation Provided With S plus 245 246 247 250 258 259 Examples Of Using S plus As An Automation Client Included With S plus 261 Examples of ActiveX controls included with S PLus Chapter 16 Dialog Controls In S PLus 4 5 ActiveX Controls in S PLus dialogs Adding an ActiveX control to a dialog W here can the PROGID for the control be found Registering an ActiveX control Why only OCX String Common eror conditions when using ActiveX controls in S PLUS Designing ActiveX controls that support S PLUS New Dialog Controls In S PLus 4 5 Chapter 17 New Script Window Features Index viii Automatic M atching of D elimiters Automatic G eneration Of Right Braces Automatic Indentation M odifying Script W indow Settings 262 263 264 264 265 267 268 268 269 283 289 289 289 290 290 293 WELCOME TO S PLus Introduction Introduction 9 Installation 10 System Requirements 11 H elp Support and Learning Resources 12 Getting Help 12 What s New in S PLus 4 5 16 New Features 16 Welcome to S PLUS Version 4 5 With many imp
60. 33190 75570 05 6419427 9 0 9 2955616 38 1 217862 271644 96 32158403 5 voltage 20 Estimate Std Err 95 LCL 95 UCL 0 1 5565 468 0 7211182 1354 206 228725 76 0 5 53765 809 0 8136006 10913 602 264877 00 0 9 228155 656 0 8986737 39199 343 1327956 02 voltage 24 Estimate Std Err 95 LCL 95 UCL 0 1 429 6203 0 4384364 181 9228 1014 571 0 5 4150 3943 0 5003670 1556 5971 11066 302 0 9 17612 2327 0 5853507 5591 9462 55470 980 O perating the capacitor at 16 volts increases its life span by about 170 times compared to operating at 24 volts T he probability values proportion failed are 0 1 0 5 and 0 9 by default when calling the predict function That can be modified by specifying the p argument For example to compute the 10 20 and 30 failure times you would enter gt predict fit1 p Cli dpa dys BY newdata data frame voltage c 16 20 24 225 CAPIRR 13 PARAMETIRC REGRESSION FOR END DA Alternatively to predict proportion failed or failure rates for given quantiles of the failure time distribution you specifytype probability asan argument to predict Let s compute the failure rates for the same set of voltage values at 1000 2000 and 3000 days gt predict fitl q c 1000 2000 3000 type prob newdata data frame voltage c 16 20 24 voltage 16 Estimate Std Err 95 LCL 95 UCL 1000 0 003011831 0 7981976 0 0006315958 0 01423447 2000 0 005350046 0 7977207 0 0011250641 0 0250
61. 4 1 2 Xl x2 x3 1 1 0 04436687 0 8331725 T he p value in this case is greater than 0 8 which leads you to accept the null hypothesis that the fourth coefficient value is Zero The default test used by anova is the Wald test based on robust estimates of the coefficients and covariance matrix a robust Wald test To use the robust F test instead specify the optional argument test to anova PROBST MH HETON Robust FPE Criterion gt anova si mu mm4 si mu mm3 test RF Response y Terms Df RobustF P gt RobustF 1 xl x2 x3 x4 1 2 xl x2 x3 1 1 0 03374514 0 8507404 which gives a quite similar result to that of the robust Wald test Although many robust estimators have been constructed in the past the issue of robust model selection has not received its due attention For robust model selection S PLUS provides Robust Final Prediction Errors RFPE as a criterion which is a robust analogue to the classical Final Prediction Errors FPE criterion RFPE is defined as x y x BO RFPE Ep i 1 where a is the final M estimate of B y s are the values you are trying to predict using B and the expectation is taken with respect to both B and y s When considering a variety of model choices with respect to different choices of predictor variables you choose the model with the smallest value of RFPE Note that when p u i RFPE reduces to the classical FPE RFPE can also be sho
62. 4342 3000 0 007484339 0 7997419 0 0015703341 0 03489259 voltage 20 Esti mate Std Err 95 LCL 95 UCL 1000 0 02500204 0 5845648 0 008088394 0 07462304 2000 0 04403085 0 5949867 0 014147239 0 12879193 3000 0 06111373 0 6058481 0 019466567 0 17587955 voltage 24 Estimate Std Err 95 LCL 95 UCL 1000 0 1914712 0 4138868 0 09520448 0 3476748 2000 0 3147595 0 4679518 0 15510243 0 5347458 3000 0 4110080 0 5191918 0 20142736 0 6587655 The difference is again dramatic when comparing 16 and 24 volts After 1000 days you expect only about 3 out of 1000 capacitors to fail when operated at 16 volts compared to 19 out of 100 when operated at 24 volts Additional arguments to predict allow you to specify the confidence level referred to as coverage by the function of the confidence intervals and whether or not you want to print the standard errors and confidence intervals 226 PARAVEIRCS ANA PARAMETRIC SURVIVAL T his dialog fits a regression model to survival or more generally censored data See also chapter 22 Overview of Survival Analysis and chapter 25 Parametric Regression in Survival M odels in the Guide to Statistics To perform parametric survival modeling Choose Statistics gt Survival gt Parametric Survival from the main menu The dialog shown below appears Parametric Survival Of x Model Options Results Plots Predict Data Model Data Frame H Distribution webu Weights H Type of Cen
63. 81 KKK NFPPNPFP ENF Vv adj l adj 1 adj1 adj 2 adj 2 adj 2 adj 3 adj 3 adj 3 multicomp Baki ng adjust list Fat seq 3 95 simultaneous confidence intervals for specified linear combinations 3 2117 critical response variable 2 adj 1 3 adj 1 3 adj 1 2 adj 2 3 3 2 3 adj 2 adj2 adj3 adj3 3 adj 3 point 1 090 NNO COFCO CO Fe 490 590 0 1371 394 390 314 363 316 378 363 SoSDoOOoOaooC OCG 344 2 590 2 300 0 872 2 070 2 320 1 660 0 891 3 680 3 750 aov focus Surfactant Flour by the Sidak method intervals excluding 0 are flagged by PRPNFPrPNF N adj1 adj1 adj1 adj 2 adj 2 adj 2 adj 3 adj 3 adj 3 0 120 1 660 0 434 0 0 1 1 1 300 674 140 250 420 Estimate Std Error Lower Bound Upper Bound adj1 adj1 adj1 adj2 adj2 adj2 adj3 adj3 adj3 Hao Se he So 0 587 i232 1314 020 708 571 960 390 355 0 341 0 344 oo oOo Oo oO 342 377 316 303 363 427 0 363 1 45000 1 69000 1 33000 0 89700 0 00922 0 45700 1 74000 3 33000 2 55000 oSoorProooo 740 T 868 530 040 870 594 590 225 444 The levels for Fat and Surfactant factors are both labeled 1 2 and
64. 92 Statistical M odds in S Wadsworth amp Brooks Cole Pacific Grove CA Everitt B 1994 A Handbook of Statistical Analyses Usng S PLUS Chapman amp Hall London HAP SUPPORT ANDLEAARNNG RSQ RES H ardle W 1991 Smoothing Techniques with Implementation in S Springer Verlag N ew York Kaluzny S P Vega S C Cardoso T P and Shelly A A 1997 S SPATIALSTATS User SM anual Springer Verlag N ew York M arazzi A 1992 Algorithms Routines and S Functions for Robust Statistics Wadsworth amp Brooks Cole Pacific Grove CA Venables W N and Ripley B D 1994 Modern Applied Statistics with S PLUS Springer Verlag N ew York Graphical Techniques Chambers J M Cleveland W S Kleiner B and Tukey P A 1983 Graphical Techniques for D ata Analyss Duxbury Press Belmont CA Cleveland W S 1993 Visualizing D ata H obart Press Summit NJ Cleveland W S 1985 The Elements of Graphing Data Hobart Press Summit NJ 15 CAPIR1 WAGE OSAL WHAT S NEW IN S Plus 4 5 The following is a summary of new features in S PLUS 4 5 Users of S PLUS 3 3 for Windows can browse the rest of this U s s Guide to further acquaint themselves with the graphical user interface New Features New features and techniques include Efficiency Improvements Faster start up The O bject Browser is no longer started by default although you can still obtain this behavior by modifying t
65. 999 o 29 98 A tein DG ene 9 d eae pg ox T x 7 32 E e Oe 5 DOD alan ao io Fu Pert evr Sette Got ROTH RET rir EEE EOTE EEO dhuih t Weibull Probability 003 001 0005 0002 0001 loululilinliulins T T T T T 1 5 10 50 100 Time to Failure Figure 13 5 Probability plot for comparing modds The plotted points in figure 13 5 are obtained from the separate model and show some deviation from the regression model H owever this is not statistically significant as we saw previously when we compared the models using a likelihood ratio test You can also add confidence intervals to the plot for each maximum likelihood estimate to get a feel for the variability of the estimated distribution s COMPUTING PROBSBLITIES AND QNES COMPUTING PROBABILITIES AND QUANTILES The predict method for censorReg objects computes predictions from a fitted model on either probability or response scales at designated quantiles or probabilities respectively for specified covariate values For example suppose you want to estimate the time to 10 50 and 90 failure from our regression model for the capacitor2 data for values of voltage at 16 20 and 24 The the call to the predict function is gt predict fitl newdata data frame voltage c 16 20 with resulting display voltage 16 Estimate Std Err 95 LCL 95 UCL 0 1 72097 22 1 028782 9598 82 541525 8 0 5 696503 03 1 1
66. Box Position Size Title l Border Rounding Style I Round Comers Color MM Black Harz Radius jo 3 weight fi Vertical Radius E a fi Fill Bar Fill Color Transparent Weight Fill Pattern E mpty M Color EE Pattern Color C JYelow Style Margins Vertical Margin o1 Horiz Margin 0 1 Cancel Apply id gt of current Help 29 CAPIRR2 NAW INIERFOINE GYPHG GPABLITIES RR SALS45 Position Size Page 30 The Position Size page allows users to specify the position and size of the scale legend as well as the orientation T he default is to position the legend on the right side of the corresponding graph when using a vertical orientation For a horizontal orientation the default is to position the legend across the top of the graph Scale Legend 1 x Labels Ticks Box Position Size Title Size r Position Height Auto x Position Auto Width Auto y Position Auto Orientation Vertical Hide current One option on the Position Size page deserves special mention The Hide checkbox allows you to format and store a color scale legend without rendering it to the screen or in print You may for example be creating a graph that will be used in different situations in some of which you want a legend and in some of which you dont To hide a legend 1 Check the H ide checkbox and click O
67. FromVariant GetStringFrom ariant IsValidVariantT ypel PutStringlntoVariant TxlnplaceReportE ror ACINEX CHIROSIN SA15 DAGS 3 Modify class inheritance Next we need to modify the inheritance of the class representing your ActiveX control so that it inherits from CSPlusOCX instead of from COleControl CSPlu sOCX is a parent class from which all ActiveX controls for which you desire sup port for S PLUS dialogs can inherit CSPlusOCX inherits directly from COleControl and its complete source code can be found in the SPlusOCX cpp and SPlusOCX h files To do this first double click on the class representing your ActiveX control in the ClassView page of the Project Workspace window to open the header for this class into your editor In this example that is the CMyOCXCtrl class Go to the top of this file in the editor Ej MyOCX classes CMyOCXApp et CMYOCXCHI H a CMyOCXPropPage E Add the following line before the class declaration line for CMyOCXCtrl at the top of this header file include SPlusOCX h Modify the class declaration line class CMyOCXCtrl public COleControl to read class CMyOCXCtrl public CSPlusOCX Next expand the class listing for CMyOCXCtrl so that all the methods are shown To do this click on the next to CMyOCXCtr in the Class View page of the 273 C PIR 16 DACGCNIROSINSALS 45 Project Workspace window EI MyOCX
68. H oO Reject H if Z gt Z _ 4 2 Which guarantees a level test The power of the test to detect y Lis Jno Ha SE iin F g Ho z m Power o ce 140 NORMALLY DSRBJID DSA Examples We can think of the left side of the sum as the lower power or the power to detect u lt Ho and the right side as the upper power or the power to detect Ha gt Ho Solving for n using both upper and lower power would be difficult but we note that when u H lt 0 the upper power is negligible lt a 2 and similarly the lower power is small when UL gt 0 So the equation can be simplified by using the absolute value of the difference between u and u and considering only one side of the sum T his results in the following sample size formula n HG Grut Zend Oe Comments While only one of upper power and lower power is used in deriving the sample size formula the S PLU S functions for computing power and sample size uses both the upper and lower power when computing the power of a two tailed test for a given sample size In practice the variance of the population is seldom known and the test statistic is based on the t distribution Using the t distribution to derive sample size requires an iterative approach since the sample size is needed to specify the degrees of freedom The difference between the quantile value for the t distribution versus the standard normal is only significant when small sample s
69. IN Handling errors during graph creation 50 Create S PLUS Graph Step 2 of 4 Conditioning Conditioned graphs allow you to view your data in a series of panels where each panel contains a subset of the original data The subset in each panel is determined by intervals of values of the conditioning variable s Variables Selected variables ydata3 Up Dr Use the Move button to move the variables to the Selected variables list Use the Up and Dn buttons to set the order of the selected variables Use the Del button to remove selected variables Cancel lt lt Back Next gt gt Finish A conditioned graph allows you to view your data in a series of panels where each panel contains a subset of the original data The subset in each panel is determined by the levels of the conditioning data range you select You can Skip conditioning by leaving the Selected variables list in this dialog empty If S PLUS encounters problems during the creation of a graph in SPSS any error messages will appear in a modeless dialog box in SPSS If errors occur it might mean that invalid data were specified for the plot created It might also indicate another problem related to the range or data type of the data specified The graph may not be created if errors occur Please see the S PLUS User s Guide for explanations of error messages FILE IMPROVEMENTS New Input O utput Features 52 Loading Libraries 53
70. K To show a hidden legend 1 Use the Object Browser to find the plot containing the hidden legend 2 Click on the plot in the left pane to view the objects within the plot COQ SAE KINS listed in the right pane Click on Scale Legend in the right pane to bring up the Color Scale Legend properties dialog Click the Position Size tab Uncheck the H ide checkbox and click OK 31 CAPIRR2 NAW INIERFOINE G4PHG GPABLITIES RR SALS45 Title Page The Title page allows you to specify and format a title for the legend The default is to not display a title Scale Legend 1 x Labels Ticks Box Position Size Title Specs H Font arial Color EE gt Size fiz Rotation booo Bold Italics T Underline T Strikeout Cancel Apply d current 32 S PLus EXCEL ADD IN Installing the S PLU S Excel Add In Installation during S PLUS setup Manual installation Removing the S PLUS Excel Add in Using the S PLUS Excel Add In Selecting data for S PLUS graphs 34 34 34 37 38 40 New to S PLUS 4 5 is a Microsoft Excel add in application that makes it easier to create and modify S PLUS graphs from within Microsoft Excel This add in includes the ability to create S PLUS graphs from selected data to modify the layout of an S PLUS graph embedded in Excel and to modify the properties of a plot in an embedded S PLUS graph in Excel A helpful wizard guides you through the
71. MathSoft S PLUS Documentation Supplement Version 4 5 April 1998 D ata Analysis Products D ivision M athSoft Inc Seattle Washington CAPER Proprietary Notice Copyright Notice Acknowledgments M athSoft Inc owns both this software program and its documentation Both the program and documentation are copyrighted with all rights reserved by M athSoft The correct bibliographical reference for this document is as follows S PLUS User s Guide Data Analysis Products Division M athSoft Seattle WA Copyright 1996 1998 M athSoft Inc All Rights Reserved Printed in the United States S PLUS would not exist without the pioneering research of the Bell Labs S team at AT amp T now Lucent Technologies Richard A Becker John M Chambers Allan R Wilks William S Cleveland and colleagues T his release of S PLUS includes specific work from a number of scientists The cluster library was written by Mia Hubert Peter Rousseeuw and Anja Struyf U niversity of Antwerp Updates to functions provided to this and earlier releases of S PLUS were provided by Brian Ripley Oxford University and Terry Therneau M ayo Clinic Rochester CONTENTS Chapter 1 Welcome to S PLus Introduction Installation System Requirements H elp Support and Learning Resources Getting H elp What s New in S PLus 4 5 N ew Features Chapter 2 New Interactive Graphics Capabilities for S PLUS 4 5 Using the Graph Tools Palet
72. Number of Replications Specify the number of times the complete design should be replicated Fraction Optionally specify the definition for the fraction desired in a fractional FARA SN Names Randomization Results factorial design This may either be a numerical fraction eg 1 4 for a quarter replicate or a model formula giving one or more defining contrasts eg A B D B C E Fractional factorials are provided only for 2 level factors By default a full factorial design is created Factor Names Optionally specify names for the factors T his may be a vector of character strings which are the names of the factors It may also be alist in which case the names attribute of the list is the names of the factors and the components of the list which need not be of mode character label the levels of the corresponding factor If factor names are not given they default to A B etc If levels are not given they default to the factor name possibly abbreviated followed by level numbers Row Names Optionally specify names to use for the rows of the design T he default is 1 nrows wherenrows isthenumber of observations in the design Randomize Row Order Check here to randomize the order of the rows in the design Restricted Factors Optionally specify a vector either numeric or character naming some factors columns in the design which shouldn t be scrambled Save As Enter thename for the object in which to sav
73. ON IMPROVEMENTS IN S PLus 4 5 Passing D ata to Functions via Automation Method to get and set parameter classes of functions exposed via automation New Automation M ethodsin S PLus 4 5 Automating Embedded S PLus Graphs Examples Of Automation Provided With S plus Examples Of Using S plus As An Automation Client Included With S plus Examples of ActiveX controls included with S PLus 242 243 246 254 255 257 258 245 CAPIR 15 AJOMAICN IMPPORMNSINSRLS 45 PASSING DATA TO FUNCTIONS VIA AUTOMATION 246 S PLUS functions that are exposed via automation by calling register ole object can be used in other automation client programs to accept data run the function and return the resulting data if any to the client program As discussed earlier the parameters of a function and the function s return value are properties of the function object and can be used in a client program You can pass data directly to a function using these properties and you can retrieve the result of running the function with the run method by using the ReturnValue property For example if you have a function called MyFunction a defined in S PLUS which takes in a data frame and returns a data frame when you expose this function via automation using register ole object you could use the following Visual Basic 4 0 script to set the function parameter run the function and get the return value Dim pArray 1 to 3 as double pArray 1 1 0
74. ONOIFENICCLEIERNS Monothetic Clustering Of x Model Results Plot r Printed Results Output Type C None Short Cancel Apply i current Figure 8 11 The M onothetic Clustering dialog Results page Results Page Printed Results Output Type Select N one for no printed output or Short for a short printed summary Monothetic Clustering Iof x Model Results Plot r Plots I Banner Plot Cancel Apply f current Figure 8 12 M onothetic Clustering dialog Plot page Plot Page Plots Banner Plot Check this to create a banner plot 107 CAPIR8 CLBIERNGINSRLS Related programming language functions mona 108 COMPUTE DSSMLARTIES COMPUTE DISSIMILARITIES Data Dissimilarity Measure This dialog calculates dissimilarities for a data frame Different types of variables e g numeric and factor are handled in appropriate manners See chapter 18 in the Guide to Statistics for details To calculate dissimilarities Choose Statistics M ultivariate C luster Dissimilarities from the main menu T he dialog shown below appears Compute Dissimilarities gt Data Data Frame v Ordinal Ratio 7 r Dissimilarity Measure Log Ratio x Metric euclidean 7 Asymmetric Binary t sRSY T Standardize Variables m Save Model Object Save As flast dissimilarity Cancel Apply f current Help Figure
75. Parameters gt oil s Initial S estimates Call I mRobMM formula Oil Market data oil df robust control control s Coefficients Intercept Market 0 06244374 0 8273216 Degrees of freedom 129 total 127 residual Residual scale estimate 0 1446283 Similarly you can get the final M estimates if you use esti m MM When computing the initial S estimates a resampling scheme is used S PLUS provides three resampling algorithms for the initial S estimates random resampling exhaustive resampling and genetic algorithm T hese algorithms can be selected by using the sampling argument to the function mRobMM robust control for which the valid choices are Random Exhaustive and Genetic Note that exhaustive resampling is only used recommended when the sample size is small and there are less than 10 predictor variables Random resampling is controlled by two paramemters a random seed and the number of subsamples to draw By default the number of subsamples is set at 4 6 2 where p is the number of explanatory variables and denotes the operation of rounding a number to its closest integer N ote that this number will work fine if you have less than 13 predictor variables H owever if you have more than 13 predictor variables the default number may be too big for computing in a reasonable time To choose a different value for the number of subsamples to draw use the optional argument nrep as
76. Resampling Assign Resampled Data to Frame 1 Options f Check this to assign the resampled data to frame 1 as each sample is generated See the language help forj ackkni fe for details 84 JAKNE INFERENCE Jackknife Inference x Model Options Results Plot Printed Results gt p Percentile Options M Summary Statistics Pace Levels c 0 025 0 05 0 95 I Empirical Percentiles I Correlation Matrix of Estimates Cancel Apply current Help Figure 7 8 ThejJackknife Inference dialog Results page Results Page Printed Results Summary Statistics Percentile Options Check this to print basic summaries such as the jackknife estimates of bias mean and standard error Empirical Percentiles Check this to print empirical percentiles for the statistic under consideration Correlation Matrix of Estimates Check this to print the correlation matrix for the estimates N ote that this is only relevant if the statistic under consideration is a vector such as a vector of regression coefficients Percentile Levels Specify a vector of percentile levels at which to evaluate the empirical percentiles 85 CAPIRR7 BMN MEHIS Jackknife Inference Of x Model Options Results Plot l Plots M Distribution of Replicates I Normal Quantile Quantile E Cancel Apply pf ren He Figure 7 9 T hejJackknife Inference dialog Plot page Plot Page Plots
77. Response vs Fit Check this to display a plot of the response variable versus the fitted values Theline y x is also drawn on the graph Residuals Normal QQ Check this to display a N ormal quantile quantile plot of the residuals Residual Fit Spread Check this to display a residual fit spread plot T his is a visual analog of the multiple R squared statistic It compares the spread of the fitted values to the spread of the residuals Cook s Distance This plot is not available for the robust MM model Include Smooth Check this to display a smooth curve computed with loess smooth on the Residuals vs Fit Sqrt Abs Residuals vs Fit and Response vs Fit plots See the on line help for oess smooth for details Include Rugplot Check this to display a rugplot on the Residuals vs Fit Sqrt Abs Residuals vs Fit and Response vs Fit plots A rugplot is a sequence of vertical bars along the x axis that mark the observed x values Number of Extreme Points to Identify Enter the number of extreme points that will be identified on the Residuals vs Fit Sqrt Abs Residuals vs Fit and Residuals Normal QQ The row names from the data frame specified on the model page will be used to identify the points Residuals Normal QQ Check this to include a graph showing the qqnorm plot of the residuals of the robust fit together with the qqnorm plot of the residuals of the standard least squares fit Estimated Residual Densities Check this t
78. Survival data 200 system requirements 11 T technical support 14 The Generalized K aplan M eier Estimate 202 Therneau Terry 201 training courses 13 Transform dialog 71 Add to Expression 72 Data 71 T ranspose dialog 73 Data 73 Results 73 Typelll Sum of Squares 115 U Use Only Selected Points 25 V VBEMBED EXE 258 W W here can the PROGID for the control be found 265 Why only OCX String 268 Win32s 10 Windows3 1 10 Windows for W orkgroups 3 11 10 297 INEX 298
79. These examples are C projects in Microsoft Visual C 4 1 using MFC Microsoft Foundation Classes and are intended for developers samples ocx myocx Microsoft Visual C 4 1 MFC project demonstrating how to write ActiveX controls that fully support S PLUS dialogs ocx1 Microsoft Visual C 4 1 MFC project demonstrating how to write ActiveX controls that fully support S PLUS dialogs support M icrosoft Visual C H 4 1 MFC headers and source files necessary for making ActiveX controls that fully support S PLU S dialogs DIALOG CONTROLS IN S PLUS 4 5 ActiveX Controls in S PLUs dialogs Adding an ActiveX control to a dialog Where can the PROGID for the control be found Registering an ActiveX control Why only OCX String Common error conditions when using ActiveX controls in S PLUS Designing ActiveX controls that support S PLUS New Dialog Controls In S PLus 4 5 260 260 261 263 264 264 265 279 263 CAPIR 16 DACGCNIROSINSALS 45 ActiveX CONTROLS IN S PLus DIALOGS Adding an ActiveX control to a dialog 264 S PLUS supports the use of ActiveX controls in dialogs for user defined functions created in the S PLUS programming language T his feature allows greater flexibility when designing a dialog to represent a function and its parameters Any ActiveX control can be added to the property list for a dialog however most ActiveX controls will not automatically communicate changed data back to the S PLUS dia
80. UES To view a brief description of a module s contents 1 From the File menu select Load M odule The Load M odule dialog appears From the M odule scrolled list select the module you want to load Select the Show D escription radio button Click OK Notepad will appear with the module s description 55 CEES HE IMPPORMNS 56 MANIPULATING DATA Select D ata Factorial D esign Orthogonal Array D esign Recode Split D ata By Group Stack Columns Subset Transform Transpose Set Dimensions 58 60 62 64 65 67 69 71 73 74 CAPIR6 MNPUAINGDYA SELECT DATA This dialog provides a convenient mechanism for selecting data for use in analyses To select data Choose D ata Select Data from the main menu The dialog shown below appears Select Data Of x Source Existing Data Existing Data Name C New Data m New Data C Import File evs Wane Cancel Apply current MV Show Dialog on Startup Help Figure 6 1 The Select D ata dialog Source Existing Data New Data 58 Select Existing Data to view an existing data frame in a Data Window Select New Data to create a new data frame and display it in a Data Window Select Import File to launch the Import D ata dialog Name Specify the name of the existing data frame to display N ote that the drop down list will contain all user created data sets which are in the
81. Usesink andcat to placean lt I MG gt tagin an HTML file N ote the use of to include quotation marks in the text gt sink my htm append T gt cat lt IMG SRC my gif gt gt sink TYPE III SUM OF SQUARES AND ADJUSTED MEANS Researchers implementing an experimental design frequently lose experimental units and find themselves with unbalanced but complete data T he data is unbalanced in that the number of replications is not constant for each treatment combination the data is complete in that at least one experimental unit exists for each treatment combination In this type of circumstance an experimenter may find the hypotheses tested by Type II sum of squares are of more interest than those tested by Type sequential sum of squares and the adjusted means of more interest than unadjusted means New options to the Im and aov object methods anova m summary aov and model tables aov will give the Type III sum of squares and the adjusted marginal means For anova and summary the new argument ssType can be 1 or 3 with ssType 1 as the default model tables has the new option adj means for the existing argument t ype An example is given to demonstrate the new capabilities of these in an analysis of a designed experiment The fat surfactant example is taken from Milliken and Johnson 1984 p 166 where they analyze an unbalanced randomized block factorial design H ere the specific volume of bread loave
82. Value WidePictureGroup ArgumentList c 0 ReturnValue 1 PictureList 2 GraphSelectedEdit Call backFunction call backPictureListFn Display Yes Callback function for this dialog call backPictureListFn lt function df if IslnitDialogMessage df AmI called to initialize the properties Set the GraphSelectedEdit property to the selected metafile pathname in the PictureList property sPictureList lt chGetCurrValue df PictureList df lt cbhSetCurrValue df GraphSelectedEdit sPictureList else if chlsOkMessage df Am I called when the Ok button is pushed else if cbhlsCancel Message df AmI called when the Cancel button is pushed 287 CAPIR 16 DACGGCNIROSINSALS 45 288 else if cbhlsApplyMessage df Am I called when the Apply button is pushed else Am I called when a property value is updated Set the GraphSelectedEdit property to the selected metafile pathname in the PictureList property if cbhGetActiveProp df PictureList sPictureList lt chGetCurrVal ue df PictureList df lt chSetCurrValue df GraphSelectedEdit sPictureList return df Show the dialog guiDisplayDialog Function Name PictureListFn NEW SCRIPT WINDOW FEATURES Automatic Matching of Delimiters Automatic Generation Of Right Braces Automatic Matching of Delimiters 285 Automatic Ge
83. You can also easily make inferences regarding the model parameters predicted failure probabilities and quantiles We begin by briefly discussing the non parametric estimates and how they may be computed This brief introduction is followed by the meat of the software a complete discussion of the model fitting software for censored data with emphass on accelerated failure time models We then discuss the ANOVA function which can be used to compare one or more fitted models and we describe the various visualizations that can be performed once a model has been fit In the final sections of this Chapter we discuss the estimation of quantiles and failure probabilities at various points for selected values of the independent variables For further reading on analyzing accelerated test data see N elson 1990 or M eeker and Escobar 1998 201 CAPIRR 13 PARAMEIRC REGRESSION FOR END DIA THE GENERALIZED KAPLAN MEIER ESTIMATE Specifying Interval Censored Data 202 The Kaplan M eier estimator produces nonparametric estimates of failure probability distributions for a single sample of data that contains the exact time of failure or contains data that is right censored A right censored observation is onein which the failure time is only known to be greater than the time it was for some reason removed censored from the study or experiment Because we consider data that may be left censored or observed in ainterval and or groupe
84. a new worksheet if one does not already exist From the Tools menu select Add Ins From the Add Ins dialog select the S PLUS Add in option in the list of add ins and un check this option Add Ins 24x Add Ins Available v AccessLinks Add In I Analysis ToolPak Cancel T Analysis ToolPak VBA I AutoS ave I MS Query Add In Browse T ODBC Add In IBES PLUS Add In V Template Wizard with Data Tracking T Update Add in Links j 5 PLUS Add In S PLUS Wizards which assist you in creating and modifying S PLUS graphs 5 The add in will be unloaded from Excel The add in file may still remain in your Excel library directory on disk You may have to manually delete this file 37 CHPER3 SRLS B ADIN USING THE S PLUS EXCEL ADD IN When installed in Excel whenever you have a worksheet in focus the following menu and toolbar will be available X Microsoft Excel Book2 3 File Edit View Insert Format Tools Data plela ells slale lt Window Help azu us There are several options on the toolbar and in the menu Table 1 To create a new S PLUS graph with the currently selected data in the current worksheet iA 1 Select blocks of data in the current worksheet you want to graph with S PLU S 2 Click on this button or select the Create Graph option from the S PLUS menu 3 Follow the wizard to create the graph 38 LENS THE SALSEXEL ADIN
85. ables Check this to standardize each data column by subtracting the variable s mean value and dividing by the variable s mean absolute deviation If Data Frame is already a dissimilarity matrix then this argument will be ignored Number of Clusters Specify the number of clusters to form Use Large Data Algorithm Check this box to use the Clustering Large Applications algorithm This algorithm considers data subsets of fixed size so that the overall time and storage requirements become linear in the total number of objects rather than quadratic Note that this algorithm is not available for dissimilarity objects Number of Samples Number of subsets to draw from the data when using the large data algorithm See the help file for clara for details Sample Size Size of each subset when using the large data algorithm See the help file for clara for details Save As Enter the name for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten 91 Results Page Printed Results Save Results Save Data Check this box to store a copy of the data in the model object This is necessary if you wish to produce a clusplot for the modal Save Dissimilarities Check this box to store a copy of the dissimilarities in the model object T his is necessary if you wish to produce a clusplot for the model Partitioning Around Medoids Model Results
86. ach data point The default values for plot colors line styles and other basic characteristics are set in O ptions Graph Styles O ther defaults can be modified by saving the object as a default guiPlot Use the gui Plot function as a convenient way to create editable graphics from S PLUS functions Unlike gui Create and gui Modify which can be used to create graphics but are also used to create other GUI objects gui Plot is used exclusively to create graphics It therefore has a simpler and more intuitive syntax For example suppose you want to create two line plots on the same graph in a new graph sheet and store the data within the graph sheet The following calls do exactly that gt x lt 1 30 gt guiPlot Line DataSetValues data frame x cos x sin x 1 GS2 Suppose you want to create a Trellis graph with two conditional variables You can do this with gui PI ot as follows gt guiPlot Loess DataSetValues environmental NumCondi ti oni ngVars 2 1 GS3 guiRefreshMemory 240 Use the gui RefreshMemory to remove unneeded objects from memory you can optionally restore the object s summary data after clearing the entire object from memory guiExecuteBuiltIn Use the gui ExecuteBui Itin function to launch dialogs or perform other operations that are built in to the GUI Built in operations are stored for each GUI property and can be viewed for any particular object using the gui Get PropertyVal ue functio
87. ack After Boot page 81 M odel page 76 O ptions page 77 Plot page 80 Results page 79 C censor 236 censorR eg 207 236 Accounting for Covariates 210 censorR eg function 207 censorR eg control 236 censorR eg distributions 236 censorReg fit 236 clara 93 ClassN ame 251 Clustering In S Plus 87 Color 24 Color Scale Legend 26 Hiding 30 Showing 30 Common error conditions when using Activex con trolsin S PLUS 268 Comparing M eans From T wo Samples 143 Comparing Proportions From T wo Samples 148 Compute Dissimilarities 109 Computing a Robust Fit 159 Computing Probabilities and Q uantiles 225 correlation matrix 193 CreateC onditionedPlots 253 CreateC onditionedPlots SeparateD ataG allery 256 CreateC onditionedPlotsG allery 255 CreateC onditionedPlotsSeparateD ata 254 CreatePlots 253 CreatePlotsG allery 255 CreatingHTML Output 111 Graphs 114 Tables 112 Text 113 Crop Graph to Selected Rectangle 20 293 INEX D daisy 110 Designing ActiveX controls that support S Plus 269 Dialog Controls In S Plus 4 5 263 diana 105 Display Selected Points 24 Dissimilarities 109 dissimilarity object 91 95 99 103 Divisive Hierarchical Clustering 102 Divisive Hierarchical Clustering dialog M odel Page 102 Plot Page 105 Results Page 104 Examples of ActiveX controls included with S Plus 262 Examples of Automation provided with S PLUS 259 ExamplesO f U sing S plusAsAn Automation Client Included With S plus 261 Exclude Selected Point
88. ahel W A 1986 Robust Statistics the Approach Based on Influence Functions John Wiley amp Sons H uber PJ 1981 Robust Statistics John Wiley amp Sons M arazzi A 1993 Algorithms Routines and S Functions for Robust Statistics Wadsworth amp Brooks Cole Pacific Grove CA Martin R D and Zamar R H 1989 Asymptotically M in M ax Robust M estimates of Scale for Positive Random Variables J Amer Statist Asoc 84 494 501 Martin R D and Zamar R H 1993 Bias Robust Estimates of Scale Annals of Statistics Ronchetti E 1985 Robust Model Selection in Regression S PLUS Statistics amp Probability Letters 3 21 23 Rousseeuw P J and Yohai V 1984 Robust Regression by M eans of S estimators In Robust and Nonlinear Time Series Analyss J Franke W Hardie and R D Martin eds Lecture N otes in Statistics 26 256 272 Springer Verlag Yohai V J 1987 High Breakdown Point and High Efficiency Estimates for Regression Annals of Statistics 15 642 665 Yohai V J 1997 A New Robust M odel Selection Criterion for Linear Models RFPE unpublished note Yohai V Stahel W A and Zamar R H 1991 A Procedure for Robust Estimation and Inference in Linear Regression in Stahel W A and Weisberg S W Eds Directionsin Robust Statistics and Diagnostics Part II Springer Verlag N ew York Yohai V J and Zamar 1998 Optimal locally robust M estimates of r
89. aining an edit field and the MyOCX control you just created When the dialog appears the ActiveX control contains the text Hello because this is set as the initial value in the S PLUS script callback function callbackMyOCXExample lt function df if sInitDialogMessage df Am I called to initialize the properties Set the initial value of the MyOCX property df lt cbSetCurrValue df MyOCX Hello When you enter a string use quotes around any string you enter in these dialog fields in the edit field the ActiveX control updates to show that string When you click the OK or Apply buttons in the dialog you will see the values of both prop erties printed in a report window 281 CFPIR 16 DACGCNIROSINSALS 45 282 Summary of steps to support S PLUS dialogs in ActiveX controls To summarize the above steps the list below shows you the tasks necessary to adapt your MFC ActiveX control project to support S PLUS dialogs 1 Add S PLUS dialog support files to your project OCXUtils cpp OCXUtils h SPDgClInf cpp SPDgClnf h SPlusOCX cpp SPlusOCX h SPlusOCX idl 2 Change the inheritance of your control class from base class COleControl to CSPlusO CX 3 Modify your control s ODL type library definition file to include SPlusO C X id sections 4 Add virtual overrides of key CSPlusOCX methods to your control Class virtual long GetSPlusDialog VerticalSize void virtual long GetSPl
90. alValue Set properties here m_sValue sInitial Value RefreshQ return TRUE Finally so we can see the effects of SPlusOnInitializeControl adda line to the OnDraw method of CMyOCXCtrl by editing the definition of this method in MyOCXCtl h void CMyOCXCtrl OnDraw CDC pdc const CRect amp rcBounds const CRect amp reInvalid TODO Replace the following code with your own drawing code pdc gt FillRect rcBounds CBrush FromHandle HBRUSH GetStockObject WHITE_BRUSH ACINEX CHIROSIN SRS DAGS pdc gt Ellipse rcBounds Display latest value pdc gt DrawText m_sValue LPRECT amp rcBounds DT_CENTER DT_VCENTER Rebuild the project now to test these changes 7 Test your new control in S PLUS To try out your new control in S PLUS you ll need to create an S PLUS script which creates properties and displays a dialog Open S PLUS and open the script file from SAMPLES OCX MyOCxX called MyOCX SSC Notice that the script begins by creating three properties one for the return value from a function and the other two for the parameters of a function The property for MyOCX uses the type OCX String and the PROGID for the control we just created guiCreate Property name MyOCX DialogControl OCX String ControlProgId MYOCX MyOCXCtrl 1 DialogPrompt My amp OCX Run the script MyOCX SSC and you will see a dialog cont
91. ale Axes menu 20 Reset Auto Scaling 21 residual fit soread plot 195 residuals censorReg 236 Return To All Panels 21 Robust Linear Regression 153 rugplot 195 S S 38 SAM PLES OCX 264 samples oleauto 256 samples oleauto vba 258 samples oleauto vbembed 258 Scale Legend dialog 27 Box page 29 Labels page 27 Position Size page 30 Ticks page 28 Select D ata 20 Select D ata dialog 58 Existing Data 58 N ew Data 58 Show Dialog on Startup 59 Source 58 Select T ool 20 Separate Panels with Varying X Axes 23 296 Separate Panels with Varying Y Axes 22 Set Dimensions dialog 74 Data 74 Dimensions 74 SetParameterC lasses 252 SeAtSAPIO bject 251 setup exe 10 ShowD ialoginParent 250 ShowD ialoginParentM odeless 250 S news mailing list 13 solve 236 Specifying Interval C ensored D ata 202 Specifying the Parametric Family 208 Split D ata By Group dialog 65 Data 65 Results 66 Splitting Variable 65 S PLUS Excel Add In Installing 34 Selecting data for S PLUS graphs 40 Using the Add In 38 S PLUS Excel Add in Removing 37 S Plus Excel Add In 33 S Press newsletter 14 SPSS Add In 43 Installing 44 Selecting data for conditioning S Plus graphs 49 Selecting data for S PLUS graphs 47 Using the Add In 46 SPSS Add in Removing 45 Stack Columns dialog 67 Data 67 Names 68 Results 68 standard errors 197 StatLib 13 Style 24 Subset dialog 69 Data 69 Results 70 Subset Rows with 21 summary censorR eg 236 INEX Survival analysis 200
92. andard errors robust t statistics and robust p values the robust residual scale estimate and the degrees of freedom the robust multiple R Squared value a test for bias and the seed parameter 192 RBA MREGESON Saved Results Correlation Matrix of Estimates Check here to display the robust correlation matrix of the regression coefficients T his is only available if the Long O utput is selected ANOVA Table Check here to display an analysis of variance table The sums of squares in the table are for the terms added sequentially Type sums of squares Comparison with LS Fit Check here to display the output of the robust M M estimate fit together with the results for a standard least squares linear model fit of the same formula Save In Enter the name of an S PLUS data frame in which fitted values and residuals of the analysis are to be saved If an object with the name you enter does not already exist in database 1 then it will be created If you enter the name of a data frame that already exists in database 1 and this data frame has the same number of rows as the number of observations used in the model fit then the saved values are appended to this data frame This allows you to keep fitted values from a model with the original data or to keep the residuals from a number of different models for the same data in one data frame If you give the name of an existing S PLUS object that is not a data frame or is not the appr
93. are printed and in what order To drop a column choose omit W hen a column number is changed 137 CAPRI POWRRANDSMAE SE Digits Group Save Object Group Export Object Group 138 the others are adjusted accordingly For example in the above dialog if you were to change Alpha to 7 Power and N 1 would each be reduced by 1 Pressing the Reset button will restore the values to their defaults The number of digits can be controlled for each column individually Pressing the Fill Down button will copy the last selected digit down the list Object Name If you enter a name here the printed table will be saved as a data framein the working directory Text File Entering a file name or full path will produce a tab delimited text file For more complete exporting capabilities save the table as a data frame see above and then choose File Export D ata from the menu POWER AD SMALE SE THEORY POWER AND SAMPLE SIZE THEORY W hen designing a study one of the first questions to arise is H ow large does my sample size need to be Intuitively we have a sense that this depends on how small a difference we re trying to detect how much variability is inherent in our data and how certain we want to be of our results Ina classical hypothesis test of H null hypothesis versus H alternative hypothesis there are four possible outcomes two of which are erroneous e Don t reject H whe
94. at a time is added to the model starting from the smallest possible model usually the intercept only model until the model contained in the object is obtained As an example consider the following model gt fit lt censorReg censor days event voltage voltage 2 weights weights data capacitor2 Applying theanova function to f i t as follows gt anova fit test Chi produces Likelihood Ratio Test Table Wei bull model Response censor days event Terms added sequentially first to last N Params 2 LogLik Df LRT Pr Chi NULL 2 745 5327 voltage 3 632 9178 1 112 6149 0 0000000 I voltage 2 4 632 8494 1 0 0684 0 7937407 It is suggested by the display that the location parameter of the distribution depends on voltage only linearly The quadratic term is unimportant We ll verify this with other models and graphically below When two or more class censor Reg orclass censorRegList objects are input into the a nova function the models are compared with likelihood ratio tests Suppose we are interested in testing whether the model for the capacitor data should be _ gly xB La O where x is voltage More general models in the sense of having more parameters are g y a O 218 ATTING MOBS ADA for voltage i or g y a z gt G L T hese three models plus an intercept only model can be generated in S Plus using the following statements gt fitO lt censorReg censor da
95. at object Click on any point in a 2D scatter plot to label it with its row name Click on any point or drag a rectangle around a group of points in a scatter plot to select them They will appear selected in the scatter plot in any other scatter plots using the same data set and in any grid views of the data set Points can be added to the selection by pressing the CTRL key when releasing the mouse button This tool can also be accessed from the annotation tools palette The way in which the data points are highlighted in the scatter plot can be defined on the Interactive page of the Graphs dialog To open this dialog choose Graph Options from the Options menu Crop Graph to Selected Rectangle Drag a rectangle around the area of a 2D graph on which you would like to refocus The X and Y axes will be rescaled to show only this area of the graph This tool can also be accessed from the Rescale Axes menu option in the graph sheet Format menu WNG THE GH TOS METE aid gt E pan Up l Pan Right Pan Left Pan D own oO el Extract Panel Auto Scale AxesC licking on this button will reset the axes scaling for both the X and the Y axes to include all points i e Auto minimums and maximums are used This can also be done by selecting Reset Auto Scaling menu from the graph sheet Format menu If you have cropped your graph to show only a subsample use this button to show th
96. ata frames to create when the Group Column is numeric and contains more than M aximum U nique N umeric Values unique values Result Type Select List to return a list containing the new data frames as components Select Separate D F s to return separate data frames When Separate D F s is selected a warning message will be issued giving the names of the new data frames Save As Specify the name for the results If the Result Type is specified to be List this is the name of the list If the Result Type is Separate D F s names are constructed for the new data frames by concatenating this name with the name of the appropriate level in the grouping variable Show in Data Window Check this box to display the new data frames in D ata W indows T hisis only available when the Result Type is Separate D F s Related programming language functions split SAK CLMN5 STACK COLUMNS This dialog stacks separate columns of a data frame into a single column with the values of other columns replicated appropriately To stack data frame columns Choose D ata Stack from the main menu T he dialog shown below appears Stack Columns lel Es Data Names Data Frame v Stack Column Name Columns to Stack stack Columns to Replicate Group Column Name Y Jaroup Results Save As Jlast stack I Show in Data Window IV Create Group Column ok can
97. cceptable values You can use the results of this function to help construct calls to gui Create and gui Modify For example suppose you wanted to make a line plot You could call guiPrintClass on the class LinePl ot and see what properties such a plot contains then construct a call to gui Create to build the plot you wanted as follows gt gui PrintClass LinePl ot CLASS LinePl ot ARGUMENTS Name Prompt Default DataSet Prompt Data Set Default a xCol umn Prompt x Col umn s Default ne yCol umn Prompt y Col umn s Default os LineStyle Prompt Style Default Solid Option List None Solid Dots Dot Dash Short Dash Long Dash Dot Dot Dash Alt Dash Med Dash Tiny Dash LineCol or Prompt Color Default Cyan Option List Black Blue Green Cyan Red Magenta Brown Lt Gray Dark Gray Lt Blue Lt Green Lt Cyan 239 TPRI NAVGI TOOKT PLINCIOS Lt Red Lt Magenta Yellow Bright White Transparent Userl User2 User3 User4 User5 User6 User7 User8 User9 Userl0 Userll Userl2 Userl3 Userl4 User15 Userl6 Line Wei ght Prompt Wei ght Default sr Option List Hairline 1 4 1 3 1 2 1 2 3 4 5 6 8 10 12 gt guiCreate LinePlot DataSet fuel frame xColumn Wei ght yColumn Mileage LineStyle Alt Dash LineColor Magenta S PLUS provides default values for most unspecified properties thus the plot produced by the above command shows cyan open circles at e
98. cel Apply d current Help Figure 6 6 T he Stack Columns dialog Data Data Frame Specify the data frame Columns to Stack Specify the column giving the variables to be tacked A new column will be created by stacking the selected columns Columns to Replicate Specify the columns to include in the new data frames By default no columns are replicated 67 CAPIR6 MNPUAINGDYA Names Results 68 Create Group Column Check this to add a factor column giving group membership for each stacked value The column names of the stacked columns are used as the factor levels Stack Column Name Specify the name for the new column containing the stacked data Group Column Name Specify the name for the group membership column This is only relevant if Create Group Column is checked Save As Enter the name for the data frame to contain the stacked data Show in Data Window Check this box to display the new data frame in a D ata Window SUBSET This dialog creates a subset of a data frame based on a subsetting expression The subset may be indicated by a logical column or a new data frame containing the subset of the data may be created To subset a data frame Choose Data Subset from the main menu The dialog shown below appears Subset lel Es Data Results Data Frame SDF1 v Result Type Data Frame Subset Rows with Add Column Columns in Subset ial Variables 7 Savas flacteubset Eolunn a
99. cept Flourl Flour2 Flour3 Fatl Fat2 Surfactant Surfactant2 FatlSurfactantl Fat2Surfactantl FatlSurfactant2 Fat2Surfactant2 0 Some justification to these functions may be in order T he parameterization chosen constrains the sum of the level estimates of each effect to zero T hat is 3 1 0 0 0 1 1 0 0 0 0 0 oooocoooao HBP eeer ocoocoooOoOpo CeCe r Lr sL DA L x a Therefore any effect that we are summing over in the mean estimate vanishes The intercept in the least squares fit estimates and the two coefficients for the Fat effect labeled in L asFat1 and Fat2 estimatefl and f2 respectively and f3 f1 f2 We can check that each function is in fact estimable by ensuring that they are in the row space of X then compute the adjusted means gt X lt model matrix Baking aov gt Is fit lt lsfit t X X L intercept F gt apply abs Is fit residuals 2 max lt 0 0001 Fat 1 Fat 2 Fat 3 T T T gt m lt t L Baking aov coefficients 123 CAPIR 10 TE III SMO SARS ANDADLSED MAB gt m 1 Fat 1 5 850197 Fat 2 6 577131 Fat 3 7 472514 Now use the summary method for the m object to obtain X X 1 and and compute the standard errors of the least squares means gt Baking sum lt summary m Baking aov gt Baking sum sigma sqrt diag t L Baking sum cov unscal ed L 1 0 1364894 0 1477127 0 1564843 A set of Type IIl estimable func
100. cept data in a variety of formats Some S PLU S plots require at least three columns of data and the data are interpreted as X Y and Z data values Other plots require at least four columns of data and interpret the data selected as X Y Z and W data values The list of plot types in the last page of the Create Graph wizard indicates what kind of data specification is required If no X Y Z or W specification is shown for a plot type in the list that means it accepts X single or multiple columns or X and Y data with single or multiple columns For an explanation of the data specifications for various S PLUS plot types please see the S PLUS U s s Guide Chapter 8 Creating a Graph Preparing D ata for Graphing Warning You should typically not select an entire column in Excel as part of a data spec for an S PLUS graph because Excel will send all rows of this column to S PLU S for graphing whether the rows are empty or not This may cause errorsin S PLUS or a failure to create the graph 40 The S PLUS Excel Add in fully supports multiple column and row selections and discontiguous block selections in Excel to specify data for an S PLUS graph For example if you wanted to create two line plots in an S PLUS graph and you had the following data in Excel 1 2 3 4 5 6 7 you could select the data The Create Graph wizard will treat the A column in this selection as the X data and the B and C columns as the
101. classes mS CMyOCXApp Be CMyOCXCtd Ee AboutBox E CMyOCXCtrIl ge CMyOCKCHI DoPropExchangel OnDraw OnResetStatel CMyOCxPropPage m Then double click on the constructor CMyOCXCtr1 to open the implemen tation CPP file for this class in your editor Go to the top of this file Using the find and replace function of the Developer Studio replace all occurrences of COleControl base class with the new base class name CSPlusOCX in this file Replace x Find what COleContro b Find Next Replace with cs PlusOCX r Re Replace Match whole word only m Replace in Replace AII J Match case m Selection J Regular expression Whole file Help 4 Modify your control s type library definition file Switch to the FileView page in the Project Workspace window and find the type library definition file ODL for your ActiveX control In this example it is My OCX odl Double click on this entry in the list to open this file into your editor Go to the top of this file 274 ACINEX CHIROSIN SRS DAGS I MyO0CX files MyOCX cpp MyOCX def MyOCX 1c A wane wn Find the properties definition section for the dispatch interface _DMyOCX in this file It should look like dispinterface _DMyOCX properties NOTE ClassWizard will maintain property information here _ Use extreme caution when editing thi
102. control back to S PLUS In turn if S PLU S needs to change the state of the control it will communicate a string back to the control Using a string permits the most general type of communication between S PLUS and the ActiveX control because so many different types of data can be represented with a string even for example lists In future versions other S PLUS property types may be added for Activex controls The most common problem when using an ActiveX control in an S PLUS dialog is that the control does not appear instead a string edit field shows up when the dialog is created This is usually caused by not registering the ActiveX control with the operating system After a control is first created and before it is ever used it must be registered with the operating system This usually occurs automatically in the development system used to make the control such as Microsoft Visual C However you can also manually register the control by using a utility called RegSvr32 exe This utility is included with development systems that support creating ActiveX controls such as M icrosoft Visual C 4 0 or higher For your convenience a copy of RegSvr32 exe is located in the SAM PLES OCX directory along with two useful batch files RegOCX BAT and UnRegOCX BAT which will register and unregister controls You can modify these batch files for use with controls you design ACINEX CHIROSIN SRS DAGS Designing ActiveX controls
103. d as well we use a generalization of the K aplan M eer estimate originally developed by Turnbull 1974 1976 Consider the following artificial table of failure times Table 2 unit failure upper Censor censor codes 1 7 2 right 0 2 4 2 exact 1 3 5 2 exact 1 4 9 2 right 0 5 3 2 left 2 6 2 9 interval 3 7 7 12 interval 3 8 4 2 exact 1 9 11 2 right 0 First we define what we mean by the censoring types Let C L U bea random censoring interval and let T be the failure time and suppose that C and T are independent less strict assumptions are possible see e g Andersen et al 1993 Then an observation is an exact failure if the failure time T is observed so that T lt L The observation is right censored if the censoring time L is observed so that T gt L The observation is interval censored if all that is known isthat L lt T lt U Finally the observation is left censored if all that is known is thatO lt T lt U i e that the observation is THE CAAD KALANMAR ESIMAE interval censored with a lower censoring time of zero In S PLUS a censoring code indicates the type of censoring Censoring codes are handled quite generally allowing you to specify a set of values for each type of censoring The default codes are 0 means the observation is right censored 1 means an exact failure 2 means a left censored observation and 3 means an interval censored observation To specify a censored distribution dependen
104. d for the plot Color Choose a color for the selected symbols If Transparent is chosen the same symbol color will be used as is specified for the plot Height Multiplier Choose a multiple for increasing the size of the symbol If 1 0 is specified the selected symbols will be the same size as is specified for the plot Line Weight Increment Choose the amount to increase the line weight used in drawing the symbol above what is specified for the plot If Hairline is chosen the line weight of the selected symbols will be the same as the plot EXTUDING QR INTLDNGS ONLY HEID PONISIN YOR AO EXCLUDING OR INCLUDING ONLY SELECTED POINTS IN YOUR PLOT T hree new menu options are available under the Format menu when a graph sheet is in focus Exclude Selected Points Selecting this menu option will remove any currently selected points from your plots If your plots require calculations such as for smoothing the calculations will be redone excluding the selected points An expression defining the currently selected rows is put into the Subset Rows with field of the D ata to Plot page of the plot dialog Because the plot is excluding the selected points the expression begins with a minus sign Any previous subsetting specifications will be replaced Further changes in data point selections will not alter the plot Use Only Selected Points Include All Points Selecting this menu option will remove all points from your plot exc
105. dd the S PLUS support classes To start adding support for S PLUS dialogs to your ActiveX control copy the fol lowing files from the SAMPLES OCX SUPPORT control example directory into the new ActiveX control project directory you just created OCXUtils cpp OCXUtils h SPDgClInf cpp SPDgClInf h SPlusOCX cpp SPlusOCX h SPlusOCX idl You also need to add these classes to your project before they will be compiled and linked to your control To do this select Files into Project from the Insert menu in Visual C You will then see a standard file open dialog Use this dialog to select the following files OCXUtils cpp SPDgClInf cpp SPlusOCX cpp To select all these files at once hold down the CTRL key while using the mouse to click on the filenames in the list 271 CFPIR 16 DACGCNIROSINSALS 45 272 Insert Files into Project x Look in 23 Myocx c eJ 2 MyOCX cpp A StdAfs cpp MyOCXCtl cpp File name SPlusOCX cpp SPDgClnf cpp OCXutils cp Add Files of type Source Files c cpp cxx Cancel Help ema e Add to project MyOCX nd When these files are selected click the Add button and the classes will appear as entries in your Project Workspace window BSTRtoCStringl CallSPlusMethod Convert ariantT oVoidPtr Convert oidPtrT o ariant DilRegisterServerl DllUnregisterS erver GetDispIDForName GetLong
106. ding can be spent in deciding upon the correct model that should be used The plotting functions discussed below can help in making this decision In the censorReg models above we considered only a single sample of observations from the same distribution Typically a survival model also includes covariate s to describe the distribution Accelerated failure time models for example include of covariates occurring in designed experiments in which the covariate is held fixed at a specified value for some observations and the time to failure for these observations is observed For example in the capacitor data four values of the covariate voltage were used voltage 20 voltage 26 voltage 29 and voltage 32 Suppose that we assume that the location parameter variables linearly with the covariate e g that i g y hy Qx Oo for intercept Ol Here x is voltage This model may be fitted using S PLUS state ments gt censorReg censor days event voltage weights weights data capacitor2 with resulting output CRAG Call censorReg formula censor days event voltage data capacitor2 weights weights Distribution Wei bull Coefficients Intercept voltage 24 14083 0 6403586 Dispersion scale 1 203945 Log likelihood 316 4589 Observations 125 Total 71 Censored Parameters Estimated 3 In the above model the location parameter is obtained by regression on the
107. distribution if nu l1 m 5 When using a continuous distribution to approximate a discrete one a continuity correction is usually recommended typically a value of 1 2 is used BNMA DYA Examples to extend the range in either direction so Pr X SX lt X using a binomial distribution becomes Pr X 5 lt X lt X 5 when using a normal approximation If the continuity correction is temporarily suppressed the sample size formula is derived very much as in the normal case a2 TC Z a 2 t T 1 Power Ta T There have been several suggestions concerning how to best incorporate a continuity correction into the sample size formula The one adopted in the S PLUS function bi nomi al sample size for aonesample test is 2 n n Ta To one sample case using all the defaults gt binomial sample size p alt 0 3 p null p alt delta alpha power n1 1 0 5 0 3 0 2 0 05 0 8 37 147 CAPRI POWRRANDSMAE SE Comparing Proportions From Two Samples 148 minimal output Ve HH H summary binomial sample size p alt 0 3 delta power nl 1 0 2 0 8 37 compute power binomial sample size p 2 p alt 12 n1 250 p null p alt delta alpha power nl 1 0 2 0 12 0 08 0 05 0 8997619 250 The two sample test for proportions is a bit more involved than the others we ve looked at Say we have data sampled from two binomial distributions X i B T n i l n
108. e 9995 y loglogistic logistic 998 4 9 4 x x 95 4 ciel Pe a 28 ee oe a 25 3 RE et z Pe ee g 3 ae aor et on See i 824 RE eee we E La Si st err ps 4 nak pei a Aai amp Ba ET a ree ix pee oe Bees xt sere 01 4 ase sen ete oz 3 0005 4 00005 4 F 5 10 50 100 6 50 160 180 260 250 360 Failure Time Failure Time Figure 13 4 Six distribution plot of the fit argument defaults to the KM or Kaplan M eier estimates but four other sets of estimates are possible These are 1 one or null intercept only model in which case amp Q H g Oo for location parameter u 2 regression model which allows _ gly xB L _ 3 O for covariate x 3 f actor models which uses g y a A ee O for covariate values i to compute separate locations for each value of the covariate and finally 4 separate model is the most general single variable parametric model which allows separate location and scale parameter estimate for 223 CAPIRR 13 PARAMETRC REGRESSION FOR ENED DA 224 00005 each value of the covariate g y a L O For our example comparing the regression fit with the more general separate fitin the probability plot is accomplished using the statement gt probplot fitl method separate add legend T legend loc auto which results in the following plot Weibull Probability Plot with MLE s Grouped by voltage method regression separate
109. e 12 3 Statistical Inference for LS vs Robust Fits 168 Sample Plots of oi cmpr A more detailed comparison particularly comparison of t values and p values can be obtained using the generic summary function on a compare fits object For example gt summary oil cmpr Calls oil ls Im formula Oil Market data oil df COMPARING LEAST SARS AND ROBEY ATS oil robust mRobMM formula Oil Market data oil df Residual Statistics Mi n 10 Medi an 3Q Max oil ls 0 6952 0 17323 0 05444 0 08407 4 842 oil robust 0 4566 0 08875 0 03082 0 10314 5 218 Coefficients oflsts Value Std Error t value Pr gt t Intercept 0 1474 0 07072 2 085 0 0390860 Market 2 8567 0 73175 3 904 0 0001528 oil robust Value Std Error t value Pr gt t Intercept 0 08396 0 02805 2 993 0 003321 Market 0 82888 0 28342 2 925 0 004087 Residual Scale Estimates oil ls 0 4867 on 127 degrees of freedom oil robust 0 1446 on 127 degrees of freedom Proportion of variation in response s explained by model s oti ig Delt oil robust 0 05261 Correlations oil s Market Intercept 0 7955736 oil robust Market Intercept 0 8168693 Caveat W hen the final M estimate is not used i e p values of test for bias indicates that the final M estimate is highly biased relative to the initial S estimates the asymptotic approximations for the inference may not be very good and you should not trust
110. e model results in the designated output window T hisincludes estimates of the coefficients dispersion scale degrees of freedom and 2 loglikelihood Long Output Check this to print a long summary of the model results in the designated output window This includes summary statistics for the deviance residuals 231 CAPIRR 13 PARAMEIRC REGRESSION FOR END DIA Saved Results 232 standard errors and z values for the coefficients number of iterations and correlation of coefficients Save In Enter the name of an S PLUS data frame in which a part such as fitted values and residuals of the analysis is saved If an object with the name you enter does not already exist in database 1 then it will be created If you enter the name of a data frame that already exists in database 1 and this data frame has the same number of rows as the number of observations used in the model fit then the saved values are appended to this data frame T his allows you to keep fitted values from a model with the original data or to keep the residuals from a number of different models for the same data in one data frame If you give the name of an existing S PLUS object that is not a data frame or is not the appropriate size then a warning is issued and a modified name is used Fitted Values Check this to save the fitted values from the model in the object specified in Save In Standardized Residuals Check this to save the standardized res
111. e region directly above the current region The amount of overlap between regions can be specified on the Interactive page of the Graphs dialog To open this dialog choose Graph O ptions from the O ptions menu If you have cropped your graph to show only a subsample use this button to show the region directly to the right of the current region If you have cropped your graph to show only a subsample use this button to show the region directly to the left of the current region If you have cropped your graph to show only a subsample use this button to show the region directly below the current region Use this button if you would like to extract a single panel from aconditioned graph After clicking on the tool button click anywhere within the panel that you would like to extract Conditioning for the graph will be turned off and the Subset Rows with expression for the plots will be set to the conditioning expression for that panel This can also be done by choosing Extract Panel Redraw Graph from the graph sheet Format menu To have the panel placed in a separate graph sheet select Extract Panel N ew Graph Sheet from the graph sheet Format menu 21 Return To All Panels 21 CAPIRR2 NAW INIERFOINE G4PHG GPABLITIES RR SALS45 22 H E Use this button if you have extracted a panel and would like to return to the full conditioned graph The Panel Type for the graph will be se
112. e size and don t use continuity correction 150 BNMA DYA co gt summary binomial sample rrect F delta power nl 0 2 0 8 92 99884 92 1 e Ve H H nV Fe sa nm Vo Fe y p N e round sample size then summar y binomial sample delta power nl n2 0 2 0 8000056 103 103 Unequal sample sizes binomial sample size p 0 9 alt less pl p2 delta alpha po 0 1 0 25 0 15 0 05 Compute minimum detecta mple size and power binomial sample c 8 9 95 pl p2 0 6 0 7063127 0 0 6 0 7230069 0 0 6 0 7367932 0 delta 1063127 1230069 1367932 compute power binomial sample size p 0 01 nl 1000 prop n2 p2 delta alpha 0 31 0 01 0 05 0 32 0 02 0 05 0 1 0 0 0 3 3 size p size p2 0 3 exact n T n2 99884 recompute power Ssize p2 0 3 recompute Ti ower tail test iy pe 25 prop n2 2 power wer nl n2 prop n2 0 9 92 184 2 ble difference delta given 6 nl 500 prop n2 5 power alpha power nl n2 prop n2 0 05 0 80 500 250 0 05 0 90 500 250 0 5 0 5 0 05 0 95 500 250 6 5 0 3 p2 seq 0 31 0 35 0 5 power nl n2 prop n2 06346465 1000 500 0 5 11442940 1000 500 0 5 151 CAPRI POWRRANDSMAE SE References 152 3 0 33 0 03 0 05 0 20446778 1000 500 3 0 34 0 04 0 05 0 32982868 1000 500 3 0 35 0 05 0 05 0 47748335 1000 500 uo Fe w oo o oo Oo aun wo Rosner Bernard 1990 Fundamentals
113. e the results of the analysis If an object with this name already exists its contents will be overwritten Show in Data Window Check this box to display the new design in a D ata W indow Related programming language functions fac design randomize 61 CGHPIER6 MNPUAINSDTA ORTHOGONAL ARRAY DESIGN T his dialog generates an orthogonal array design To generate an orthogonal array design Choose D ata D esign O rthogonal Array from the main menu The dialog shown below appears Orthogonal Array Design oe x Design Structure Randomization Levels l Randomize Row Order Minimal Residual DF Restricted Factors r Results Save As last design Show in Data Window Cancel Apply current Help Figure 6 3 T he Orthogonal Array D eign dialog Design Structure Levels Enter a vector of the number of levels for the factors in the design For example to generate a design with three levels of one variable and two levels of another specify c 3 2 Minimal Residual DF O ptionally specify the minimum residual degrees of freedom requested for a main effects only model T he default value is 0 unless the number of levels in the factors are all equal in which case the default is 3 Randomization Randomize Row Order Check here to randomize the order of the rows in the design 62 RHM ARY DESIGN Results Restricted Factors Optionally specify a vector either nume
114. each voltage This is done with the statement gt kmcap lt kaplanMeier censor days event voltage weights weights data capacitor2 with result voltage 20 Number Observed 25 Number Censored 25 1 Not enough failures available to fit a nonparametric censored data model voltage 26 Number Observed 50 Number Censored 39 Confidence Type identity Survival Std Err 95 LCL 95 UCL Inf 12 95 1 00 0 000 1 000 1 000 12 95 28 41 0 98 0 020 0 942 1 000 28 41 63 10 0 96 0 028 0 908 1 000 63 10 136 33 0 94 0 034 0 878 1 000 136 33 139 37 0 92 0 038 0 851 0 989 139 37 179 02 0 90 0 042 0 825 0 975 205 CAPIRR 13 PARAMETRC REGRESSION FOR END DA 179 02 187 80 0 88 0 046 0 801 0 959 187 80 201 28 0 86 0 049 0 777 0 943 201 28 214 28 0 84 0 052 0 755 0 925 For voltage 20 there are not enough observations in the sample to compute esti mates For voltage 26 voltage 29 and voltage 32 estimates are computed and displayed in a separate tables The Kaplan Meier estimates of failure probabilities can also be used to compute nonparametric estimates of the quantiles For example the statements gt qkaplanMeier kmcap p seq 1 to 9 by 1 produce the result voltage 20 1 NA voltage 26 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 139 37 271 73 Inf Inf Inf Inf Inf Inf Inf voltage 29 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 45 85 55 73 91 81 108 62 164 2 257 88 Inf Inf In
115. ed in the 1989 IMA summer conference on Directions in Robust Statistics and Diagnostics The S estimate approach has as its foundation an M estimate of an unknown scale parameter for observations y y assumed to be robustly centered i e by subtracting a robust location estimate The M estimate is obtained by solving the equation Def oe 2 La 5 an where p isa symmetric bounded function It is known that such a scale estimate has a breakdown point of one half H uber 1981 and that one can find min max bias robust M estimates of scale M artin and Zamar 1989 1993 The following regression S estimate method was introduced by Rousseeuw and Yohai 1984 Consider the linear regression model modification of 3 7 l yx JT ap Aa ae n Pp ix d 5 B a For each value of 6 we have a corresponding robust scale estimate s 8 The regression S estimate which stands for minimizing a robust scale 179 CPRD RAS LUNAR AGEN Optimal and Bisquare Rho and Psi Functions 180 estimate is the value B that minimizes s B A p arg min g s B 23 This presents another non linear optimization one for which the solution is traditionally found by a random resampling algorithm followed by a local search as described in Yohai Stahel and Zamar 1991 S PLUS allows you to use a genetic algorithm in place of the resampling algorithm and also to use an exhaustive form of sampling
116. ed up by the use of a special buffer changes in the Data Window are not transmitted to the S PLUS engine immediately but rather are recorded in the buffer and transmitted to the engine in chunks of approximately 50 edits An option in the Options menu s General Settings dialog Buffer Data Entry controls whether this special buffer is used If you turn off Buffer D ata Entry editing commands are transmitted immediately asin S PLUS 4 0 LOUNG LIERARES LOADING LIBRARIES S PLUS includes anumber of function libraries that extend basic functionality or provide instructive examples of S PLUS programming Some of these libraries such as the cluster library and the GUI library are loaded or attached automatically when you start S PLUS You can attach other libraries as needed using the Load Library dialog To load an S PLus library 1 From the File menu select Load Library The Load Library dialog appears as shown below Load Library On x Library Name a Action tf Load Library cluster Set editdata hd C Show Descriptio Attach at top of search list Cancel Apply K current Help 2 From the Library Name scrolled list select the library you want to load 3 If you want the library functions to appear before other system files in the search list select the checkbox labeled Attach at top of search list 4 Select the Load Library radio button 5 Click OK To view a brief description of a library s cont
117. egression Jour of Statist Inf and Planning PARAMETRIC REGRESSION FOR CENSORED DATA Introduction 196 The Generalized K aplan M eier Estimate 198 Specifying Interval Censored Data 198 Computing Kaplan Meier Estimates 200 censorR eg 203 An Example Model 203 Specifying the Parametric Family 204 Accounting for Covariates 206 Truncation Distributions 208 Threshold Parameter 210 Offsets 211 Fixing parameters 212 Fitting Models ANOVA 214 Fitting M odels The plot method for C ensorReg 216 Computing Probabilities and Q uantiles 221 Parametric Survival 223 Model Page 224 Options Page 226 Results Page 227 Plots Page 229 Predict Page 231 199 CAPIRR 13 PARAMEIRC REGRESSION FOR END DIA INTRODUCTION 200 Parametric regression models for censored data are used in a variety of contexts ranging from manufacturing to studies of environmental contaminants Because of their frequent use for modeling failure time or survival data they are often referred to as parametric survival models In this context they are used throughout engineering to discover reasons why engineered products fail They are called accderated failure time models or accelerated testing models when the product is tested under more extreme conditions than normal to accdeate its failure time Most product engineering cant wait long enough to observe ample failures for fitting models under normal operating conditions The results obtained under extreme conditions are
118. en the saved values are appended to this data frame T his allows you to keep predicted values from a model with the original data or to keep the residuals from a number of different models for the same data in one data frame If you give the name of an existing S PLUS object that is not a data frame or is not the appropriate size then a warning is issued and a modified name is used Predictions Check this to save the predictions in the data frame specified in Save In Confidence Intervals Check this to store lower and upper confidence limits in the object specified in Save In The column names will be N L C L and N U C L where N is 100 times the value specified in Confidence Level These confidence limits for the mean response are computed as the prediction plus or minus t value times standard error Standard Errors Check this to store the pointwise standard errors for the predictions in the object specified in Save In Confidence Level Enter the confidence level to use when computing confidence intervals T his value should be less than 1 and greater than 0 S PLus language functions related to Linear Models I mRobMM plot mRobMM predict Im print mRobMM summary mRobMM mRobMM robust control MRobMM genetic control Other related S PLus language functions aov gam gim Im loess nls 197 CAPIR 22 RAS LUNAR AGEN BIBLIOGRAPHY 198 Hampel F Ronchetti E M Rousseeuw P J and St
119. ents 1 From the File menu select Load Library The Load Library dialog appears 2 From the Library Name scrolled list select the library you want to load 3 Select the Show Description radio button 4 Click OK Notepad will appear with the library s description 53 CEES ALE IMPPORMNS LOADING MODULES M athSoft offers a number of add on modules for S PLUS that provide comprehensive solutions in specific subject areas Currently the following modules are available S SPATIALSTATS for the exploration and modeling of spatially correlated data S WAVELETS for wavelet analysis of signals time series images and other data S GARCH for modeling financial and econometric data S D OX for design and analysis of experiments To load an S PLUS module 54 1 From the File menu select Load M odule The Load M odule dialog appears as shown below Load Module Ox Module Action Load Module ha C Show Descriptio IV Attach at top of search list Cancel Apply current Help 2 From the M odule scrolled list select the module you want to load 3 If you want the module functions to appear before other system files in the search list select the checkbox labeled Attach at top of search list For modules this is the recommended and default behavior because some modules redefine system functions to ensure correct behavior 4 Select the Load M oduleradio button 5 Click OK LODNGMI
120. epresenting the win dow handle of the win dow you want the graph gallery dialog to appear inside and a data array to plot Returns TRUE if successful and FALSE if not The last parameter is an array of strings repre senting the names of columns in the data ar ray These names will be used as axes labels in plots Pass in an empty variant to not use col umn names Similar to Cre atePlotsGallery except that this method takes in a number speci fying the number of conditioning columns to use from the data array passed in The data col umns and conditioning columns are specified as part of the data array passed in 255 CAPIR 15 AJOMAICN IMPRORMNSINSRLS 45 256 Table 6 CreateConditionedPlots Returns TRUE if suc SeparateDataGallery cessful FALSE if not boolean obj CreateConditionedP ots SeparateDataGallery hwnd data array variant conditioning array variant data column names array conditioning col names array Similar to Create Conditioned PlotsGallery except that this method takes in a data array and a conditioning array separately instead of combined in one array The last two parameters are arrays of strings rep resenting the names of columns in the data ar ray and names of col umns in the conditioning array These names will be used as axes labels in plots Pass in an empty variant for either or both of these to not use col umn names Examples o
121. ept those that are selected If your plots require calculations such as for smoothing the calculations will be redone with only the selected points An expression defining the currently selected rows is put into the Subset Rows with field on the Data to Plot page of the plot dialog Any previous subsetting specifications will be replaced Further changes in data point selections will not alter the plot Selecting this menu options will turn off subsetting for the plots on the graph sheet The Subset Rows field on the Data to Plot page of the plot dialog will be set to ALL Any previous subsetting specifications will be replaced 25 CAPIRR2 NAW INIERFOINE G4RHG GPABLITIES RR SALS45 COLOR SCALE LEGENDS Usage 26 The Color Scale Legend may be used with any of the following GU plot types Line Plot Area Plot Bar Plot Contour Plot Surface Plot QQ Plot 3D Line Plot Pie Plot Scatter Plot M atrix The Color Scale Legend button located on Graph toolbar activates when a plot of an appropriate plot type is selected Selection is implicit if the required plot is the only plot in a GraphSheet and nothing is selected O therwise the plot must be selected specifically COQ SAE KINS Properties When you choose the Color Scale Legend button from the Graph toolbar S PLUS automatically creates a color scale legend To control the color scale legend use the Scale Legend dialog which you can access by
122. ering dialog Plot page Plot Page Plots Clustering Tree Check this to create a clustering tree plot Banner Plot Check this to create a banner plot Related programming language functions diana 105 CAPIR8 CLBIERNGINSALS MONOTHETIC CLUSTERING Model Page Data Save Model Object 106 This dialog performs monothetic clustering This clustering technique may be used to partition data when all variables are binary See chapter 18 in the Guide to Statistics for details To perform monothetic clustering Choose Statistics C luster Analysis Monothetic Binary Variables from the main menu T he dialog shown below appears Monothetic Clustering Oix Model Results Plot l r Data m Save Model Object Save As flast cluster Data Frame v Dd Cancel Apply i current Help Figure 8 10 The M onothetic Clustering dialog M oda page Data Frame Specify the data frame For monothetic analysis all variables must be binary A limited number of missing values N As is allowed Every observation must have at least one value different from NA No variable should have half of its values missing There must be at least one variable which has no missing values A variable with all its non missing values identical is not allowed Save As Enter the name for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten M
123. es due to Fat given all other terms are in the mode This simultaneously tests that the least squares coefficients Brat f1 and Bratz f2 are zero and hence f3 fl f2 is zero Searle 1987 The same argument applies to Surfactant It follows that the following Type III estimable functions for Fat can be used to test H or equivalently H pat 125 CAPIR 10 TE III SMO SUARSANDADLSED MAB References 126 gt L typelll Lo hl Ly 2 Intercept Flourl Flour2 Flour3 Fatl Fat2 Surfactant Surfactant2 FatlSurfactantl Fat2Surfactantl FatlSurfactant2 Fat2Surfactant2 gt h c lt t L typell Baking aov coef gt t h c solve t L typelll Baking sum cov unscal ed Litypelll h c 1 iy 10 11785 ooooooonO2SOSD oo i Milliken G A Johnson D E Analyss of M esy Data Volume I D edgned Experiments Van Nostrand Reinhold Co 473 pp SAS Institute Inc 1990 SAS Stat User s Guide Fourth Edition SAS Institute Inc pp 120 121 POWER AND SAMPLE SIZE Normal Power And Sample Size 124 Model Page 125 Options Page 126 Binomial Power And Sample Size 130 Model Page 131 Options Page 131 Printout Page 133 Power and Sample Size Theory 135 Normally D istributed D ata 136 One Sample Test of Gaussian Mean 136 Comparing Means From Two Samples 139 Binomial D ata 142 References 148 W hen contemplating a study one of the first statistical questions that arises is
124. esponse is specified by the censor function Because the model formula contains no covariates a parametric model is fit for a single sample of observations In this case the parametric family defaults to the Weibull distribution In the output that the location parameter for the Weibull distribution is estimated as 6 704 and the scale parameter is estimated as 1 82 As with other S PLUS model fitting functions the summary function can be used to obtain a more detailed summary of the fit Following is the result of 207 CAPIRR 13 PARAMETRC REGRESSION FOR ENED DA calling summary on the fit object Call censorReg formula censor days event 1 data capacitor2 weights weights Distribution Weibull Standardized Residuals Mi n Ma x Uncensored 0 020 0 553 Censored 0 577 0 577 Coefficients Est Std Err 95 LCL 95 UCL z value p value Intercept 6 7 0 296 6 12 7 29 22 6 3 01le 113 Extreme value distribution Dispersion scale 1 821207 Observations 125 Total 71 Censored 2 Log Likelihood 746 Specifying the The parametric distribution family is specified by inputting one of the 10 i distributions that are supported by censor Reg These are displayed in the Parametric following table 3 The distribution argument to censorReg is the Family quoted string in the first column along with the character string that is supplied to censor Reg asthe distribution argument tensorReg argument Distribution
125. eterized model parameters tested by each sum of squares The Type estimable functions can be obtained by performing row reductions on the cross products of the model matrix X X that reduce it to upper triangular with each nonzero row divided by its diagonal SAS Technical Report R 101 1978 gt round L 4 L2 L3 L4 L6 L7 L9 L10 L12 L13 L15 L16 10000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0 0 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0 0 0 10000 1 0000 0 0000 0 0000 0 0000 0 0000 0 0000 0 0 0 0 10000 0 0000 1 0000 0 0000 0 0000 0 0000 0 0000 0 0 0 0 0000 1 0000 1 0000 0 0000 0 0000 0 0000 0 0000 0 0 0 0 10667 0 0833 0 0952 1 0000 0 0000 0 0000 0 0000 0 0 0 0 13000 0 1250 0 2143 0 0000 1 0000 0 0000 0 0000 0 0 0 0 2333 0 2083 0 1190 1 0000 1 0000 0 0000 0 0000 0 0 0 0 2333 0 2083 0 1190 0 2152 0 1338 1 0000 0 0000 0 0 0 0 1000 0 2500 0 2143 0 1966 0 3235 0 0000 1 0000 0 0 0 0 1333 0 0417 0 0952 0 0814 0 1896 1 0000 1 0000 0 0 0 0 12000 0 2250 0 1429 0 3531 0 0359 0 3507 0 0037 1 0 0 0 11667 0 0417 0 0238 0 0060 0 3250 0 4242 0 0760 0 1 0 0 12000 0 1250 0 0000 0 2319 0 2271 0 2251 0 0797 1 1 0 0 10333 0 1667 0 0238 0 3167 0 0060 0 0149 0 3499 0 0 1 0 11667 0 0417 0 1667 0 0049 0 2034 0 0190 0 2971 0 0 0 1 10333 0 0417 0 0238 0 5182 0 5209 0 0041 0 3530 0 0 1 1 1667 0 0417 0 0238 0 3302 0 0299 0 3358 0 3536 1 0 1 0 10333 0 0417 0 0238 0 0011 0 4716 0 4432 0 3731 0 al 0 1
126. ethods This directory contains an example Visual Basic 4 0 project that demonstrates the use of the CreatePlots automation method EXAMPLES OF LSNGSPLLBAS AN AJOA CIENT INTLUDKD WITH SALS EXAMPLES OF USING S PLUS AS AN AUTOMATION CLIENT INCLUDED WITH S PLUS The following directories all paths relative to the S PLUS installation directory contain examples of using S PLU S as an automation client samples oleauto clitesta ssc Shows how to use S PLU S commands to start Excel and call method of Excel to convert inches to points and return the result in S PLU S clitestb ssc Shows how to use S PLU S commands to start Excel get a property and set a property clitestc ssc Shows how to use S PLU S commands to set a range of data in an Excel worksheet with data from an S PLUS vector and then how to get the data back from Excel into another vector clitestd ssc Shows how to get a property value from Excel cliteste ssc Shows how to send a vector from S PLUS to Excel and transpose it to a row in Excel clitestf ssc Shows how to send a vector from S PLUS to Excel and transpose it to a row in Excel using a different set of steps than in cliteste ssc 261 CAPIR 15 AJOMAICN IMPORMNSINSRLS 45 EXAMPLES OF ActiveX CONTROLS INCLUDED WITH S PLUS 262 Examples of ActiveX controls which implement support for S PLUS dialog con tainment are provided on disk in the SAM PLE S O CX directory beneath the pro gram directory
127. f voltage 32 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 2 81 5 45 6 26 11 51 15 16 20 86 65 9 94 08 149 2 for the quantiles Notice that because no failures were observed beyond 300 days survival drops to 0 0 in the final intervals for 26 and 29 volts resulting in quantile estimates that are infinite The true value is of course finite but is not estimable from this data 206 CENSORREG An Example Model Parametric rather than nonparametric estimates of the failure distributions can also be easily computed All estimates are computed by the censorReg func tion Like kapl anMeier censorReg can handle interval and other censor ing In addition the censorReg function can handle three general families of failure distributions with logged and unlogged versions truncated data offsets a threshold parameter fixed coefficients and much more As the simplest possible example use the defaults for most arguments in a censorReg model with no covariates Possible S PLUS statements for the capacitor data are gt censorReg censor days event 1 weights weights data capacitor2 with resulting display Call censorReg formula censor days event 1 data capacitor2 weights weights Distribution Wei bull Coefficients Intercept 6 704817 Dispersion scale 1 821207 Log likelihood 372 7664 Observations 125 Total 71 Censored Parameters Estimated 2 As with the kapl anMei er function the r
128. f containee ob jects of the class name specified or an empty array if none can be found NAV AUTOMATION MEIH ES IN SRLS 45 ObjectContainer object obj Obj ect Container ClassName string obj Cl assName PathName string obj Pat hName Application Object Methods ExecuteStringResult string obj ExecuteStringResult S PLUS syntax string boolean SetSAPIObject boolean obj Set SAPI Obj ect byte array variant object name string Table 6 Returns an object that is the container of this object This method is not available for function objects Returns a string repre senting the class name of this object Returns a string repre senting the path name of this object in S PLUS Returns a string repre senting the output from executing the string passed in The format of the return string depends on the setting of the second parameter If TRUE the older S PLUS 3 3 output formatting will be applied If FALSE the new format will be used Sets a binary SAPI object created in an automation client pro gram into S PLUS making it available to other operations in S PLUS Takes no parameters Returns the object that contains this object Takes no parameters Returns the object class name as a string Takes no parameters Returns the object path name in S PLUS Takes in a string repre senting any valid S PLUS syntax and
129. f using these new automation methods can be found in the following sub directories under samples oleauto in your S PLUS program directory dialogs This directory contains an example Visual Basic 4 0 project that demonstrates the use of ShowDialog ShowDialoginParent and ShowD ialogl nParentM odeless automation methods objects This directory contains an example Visual Basic 4 0 project that demonstrates the use of O bjectC ontainees O bjectC ontainer ClassN ame and PathN ame automation methods createplt NAV AUTOMATION MEIH ES IN SRLS 45 This directory contains an example Visual Basic 4 0 project that demonstrates the use of the CreatePlots CreateC onditionedPlots and CreateC onditionedPlotsSeparateD ata automation methods 257 CAPIR 15 AJOMAICN IMPORMNSINSRLS 45 AUTOMATING EMBEDDED S PLus GRAPHS 258 With S PLUS Automation support you can automate embedded graph sheet documents easily in any Automation client program such as Visual Basic Excel Word and others You can even create modify and save an enbedded S PLUS graph sheet with plotted data in place without ever leaving your Automation client program You can use S PLUS Automation to create a plot send data from your Automation client to the plot modify properties of the plot either through dialogs which you can display in your client program or directly via command execute S PLUS built in functions or functions that you ve written i
130. ffers a visual data analysis approach to a whole range of Signal processing techniques such as wavelet packets local cosine analysis and matching pursuits StatLib is a system for distributing statistical software data sets and information by electronic mail FTP and the World W ide Web It contains a wealth of user contributed S PLUS functions To access StatLib by FTP open a connection to lib stat cmu edu Login aS anonymous and send your e mail address as your password The FAQ frequently asked questions isin S FAQ or in HTML format at http www stat math ethz ch S FAQ To access StatLib with a web browser visit http lib stat cmu edu To access StatLib by e mail send the message send index from S to statlib lib stat emu edu You can then request any item in StatLib with the request send item from S where item is the name of the item S news is an electronic mailing list by which S PLUS users can ask questions and share information with other users To get on this list send a message with message body subscribe to s news request wubios wustl edu To get off this list send a message with body unsubscribe to the same address Once enrolled on the list you will begin to receive e mail To send a message to the S news mailing list send it to s news wubios wustl edu D o not send Subscription requests to the full list use the snews request address shown above M athSoft Educational Services offers a variety of cou
131. field in this dialog blank When specifying a data range for conditioning you may specify any valid data range in normal Excel range syntax For example say you specified the data range A1 B6 from the Sheet1 worksheet for the data to plot in a S PLU S graph You could also specify the data range C1 C6 from Sheetl for the conditioning data If a 2D line plot is created the plot will be conditioned on the datain C1 C6 Handling errors during graph creation If S PLUS encounters problems during the creation of a graph in Excel any error messages will appear in a modeless dialog box in Excel If errors occur it might mean that invalid data was specified for the plot created It might also indicate an other problem related to the range or data type of the data specified The graph may not be created if errors occur Please see the S PLUS User s Guide for expla nations of error messages S PLus SPSS ADD IN Installing the S PLUS SPSS Add In Installation during S PLUS setup Manual installation Removing the S PLUS SPSS Add in Using the S PLUS SPSS Add In Selecting data for S PLUS graphs Selecting data for conditioning S PLUS graphs Handling errors during graph creation 44 44 44 45 46 47 49 50 N ew to S PLUS 4 5 is an add in application that works with SPSS to make it easier to create and modify S PLUS graphs from within SPSS This add in includes the ability to create S PLUS graphs from selected variables in the SPSS data editor
132. follows gt oil tmp lt mRobMM Oil Market dataz oil df nrep 10 The seed of the random resampling can be controlled by specifying the argument seed toI mRobMM robust control 177 CAPIR 22 RAS LINAR AGEN Genetic Algorithm Parameters 178 If you choose to use the genetic algorithm the parameters for genetic algorithm can be changed through the mRobMM optional argument genetic control the default of which is NULL The optional argument genetic control Should bealist usually returned by a call to the function mRobMM genetic control To look at the arguments of the function mRobMM genetic control usethe following command gt args mRobMM genetic control function popsize NULL mutate prob NULL randomn NULL births n NULL stock list maxslen NULL stockprob NULL nkeep 1 For an explanation of the various arguments above you should read the help file for the function tsreg default TEIA EALS THEORETICAL DETAILS Initial Estimate Details The key to obtaining a good local minimum of the M estimation objective function when using a bounded non convex loss function is to compute a highly robust initial estimate B S PLUS does this by using the S estimate method introduced by Rousseeuw and Yohai 1984 as part of an overall M M estimate computational strategy proposed by Yohai Stahel and Zamar 1991 and supported by anumber of robustness experts who participat
133. for the clustering Silhouette Plot Check this to create a silhouette plot for the clustering Related programming language functions fanny 97 GPRS CLSERNGINSALE AGGLOMERATIVE HIERARCHICAL CLUSTERING This dialog performs agglomerative hierarchical clustering See chapter 18 in the Guide to Statistics for details To perform agglomerative hierarchical clustering Choose Statistics Cluster Analysis Agglomerative Hierarchical from the main menu T he dialog shown below appears Agglomerative Hierarchical Clustering Model Results Plot m Data m Options Data Frame hd Linkage Type average z Tl Data is Dissimilarities Result m Dissimilarity Measure Saee fast cinsler Metric euclidean v IV Save Data I Standardize Variables M Save Dissimilarities Cancel Apply i current Help Figure 8 4 The Agglomerative H ierarchical Clustering dialog M odd page Model Page Data Data Frame Specify a data frame ora dissimilarity object To use a subset of rows or columns use standard S PLU S subscripting of the data frame Note that all columns of the data frame must be numeric If non numeric columns e g factors are present use the Dissimilarities dialog to produce adissimilarity object and then use this object in clustering The Dissimilarities dialog provides special options for handling factors 98 AGGOMERATINE HERARHICAL CLLSIERNGS Dis
134. gma Constrained Parameterization 122 gt round Fat mcomp l mat 4 1 2 3 Intercept 1 0000 1 0000 1 0000 Flour 1 0 2500 0 2500 0 2500 Flour 2 0 2500 0 2500 0 2500 Flour 3 0 2500 0 2500 0 2500 Flour 4 0 2500 0 2500 0 2500 Fat 1 1 0000 0 0000 0 0000 Fat 2 0 0000 1 0000 0 0000 Fat 3 0 0000 0 0000 1 0000 Surfactant 1 0 3333 0 3333 0 3333 Surfactant 2 0 3333 0 3333 0 3333 Surfactant 3 0 3333 0 3333 0 3333 Fat 1 Surfactant 1 0 3333 0 0000 0 0000 Fat 2 Surfactant 1 0 0000 0 3333 0 0000 Fat 3 Surfactant 1 0 0000 0 0000 0 3333 Fat 1 Surfactant 2 0 3333 0 0000 0 0000 Fat 2 Surfactant 2 0 0000 0 3333 0 0000 Fat 3 Surfactant 2 0 0000 0 0000 0 3333 Fat 1 Surfactant 3 0 3333 0 0000 0 0000 Fat 2 Surfactant 3 0 0000 0 3333 0 0000 Fat 3 Surfactant 3 0 0000 0 0000 0 3333 The reader can verify that the Type III estimable functions for Fat are the differences between columns 1 and 3 and between columns 2 and 3 The function m reparameterizes the linear model in an attempt to make the model matrix full column rank We will next explore the computation of the adjusted means and the Type II sum of squares for Fat using the sigma constrained linear model The sigma constraints were used in the aov fit above aov calls Im with singul ar ok T This was done by specifying contr sumin thecontrasts argument In this setting the adjusted means can be computed with the following estimable functions Fat 1 Fat 2 Fat Inter
135. he total number of parame ters of the function plus its return value Takes no parameters Returns an array of strings representing the class names of the re turn value followed by each of the parameters of the function NAV AUTOMATION MEIH ES IN SRLS 45 CreatePlots boolean obj CreatePlots axis type string plot type string data array variant data column names array CreateConditionedPlots boolean obj CreateConditionedP ot s axis type string plot type string number of conditioning vars data array variant data column names array Table 6 Returns TRUE if suc cessful FALSE if not Takes in a string repre senting the axis type for the plots a string repre senting the plot type to create and the data to use to create plots in the graphsheet The axis type string may be one of 2D 3D Pie or Polar The plot type string is one of the choices shown in the Insert Graph dialog accessed by the menu item Insert Graph in S PLUS The last parameter is an array of strings repre senting the names of columns in the data ar ray These names will be used as axes labels in plots Pass in an empty variant to not use col umn names Returns TRUE if suc cessful FALSE if not Similar to Cre atePlots except that this method takes in a number specifying the number of conditioning columns to use from the data array passed in
136. he Picture and the Picture List Box controls you can specify either a pathname to a Windows metafile on disk or a pathname to a Windows 32 bit DLL and the resource name of the metafile in this DLL to use The syntax for each of these is specified below 283 CEERI DACGGCNIROSINSALS 45 284 Table 7 Pathname to Windows pathname metafile Example c spluswin home Metal WMF DLL Pathname and re pathname to DLL metafile resource name source name of metafile Example c mydll mydll dll MyMetaFile Please note that the leading semicolon is required in this case and the comma is required between the DLL pathname and the name of the metafile re source Several example S PLUS scripts follow which demonstrate how to use these new controls for your own dialogs Example script to show how to use a Picture control in a dialog in S PLUS Define a function for use with this dialog PictureFn lt function GraphToShowEdit sPictureShown lt paste sep The graph file GraphToShowEdit was last shown Create properties for the function guiCreate Property name ReturnValue DialogControl Invisible guiCreate Property name GraphToShowEdit DialogControl Wide String DialogPrompt amp Show Graph UseQuote T Create the Picture control guiCreate Property name Picturel DialogControl Picture DialogPrompt amp Pic
137. he S estimates yields a p value of 0 which indicates that the LS estimate is highly biased so you strongly prefer to use the robust M M estimator For technical details about how the tests for bias are calculated see Yohai Zamar and Stahel 1991 165 CAPIR 22 RAS URES COMPARING LEAST SQUARES AND ROBUST FITS Creating a Comparison Object for LS and Robust Fits Visualizing LS In the section Visualizing the Fit with the p2ot Function we compared the residuals vs fitted values plot for both the LS and robust fits You might have noted that the two plots do not have the same vertical scale It would be nice to have the capability of plotting different fits on the same scale for easy visual comparison and also making tabular displays of LS and robust fits which are conveniently aligned for ease of comparing inference results To this end S PLUS provides a function compare fits for creating a models comparison object along with appropriate print plot and summary methods for this class of object For example to compare the results from the two fits oil 1s and oil robust first create the comparison object oi I cmpr with the following command gt oil cmpr lt compare fits oil Is oil robust The object returned by compare fits is of class compare fits Now you can print a short summary of the comparison gt oi cmpr Calls oil lis Im formula Oil Market data oil df oil robust mRobMM for
138. he dialog shown below appears Jackknife Inference Of x Options Results Plot Data Data Frame SDFI z Save Model Object Save s last jackknife m Statistic to Estimate Expression ma Cancel Apply current Help Figure 7 6 ThejJackknife Inference dialog M odd page Model Page Data Statistic to Estimate Data Frame Specify the data to jackknife T his may be a vector matrix or data frame Expression Specify the expression describing the statistic to be jackknifed It may be a function that accepts data as the first argument and returns a vector or matrix or a call referring to the data that evaluates to a vector or matrix For example to jackknife the regression coefficients for regressing Mi eage 83 CAPIRR7 BMN MEHIS on Weight in the fuel frame data use the expresion coef Im Mil eage Wei ght fuel frame and specify fuel frame as the Data Frame To jackknife the mean of Mi eage use the expression mean Mileage Save Model Save As Object ee Enter the name for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten Jackknife Inference e x Model Options Results Plot Resampling Options x Assign Resampled Data to Frame 1 E Cancel Apply ff oren Help Figure 7 7 ThejJackknife Inference dialog O ptions page Options Page
139. he maximum likelihood estimate of the failure probability Coverage Type the confidence level for the maximum likelihood estimation Stress vs Failure Time Check this to plot stress versus failure time Probability for failure A vector of probabilities for which quantiles are to be computed The quantiles at each covariate value are plotted and quantiles with the same probability are connected with a line Six Distributions Plot Check this to plot six distributions of the fitted model Response vs Fit Check this to plot the response variable versus the fitted values T he line y x is also drawn on the graph Residuals vs Fit Check this to plot the deviance residuals versus the fitted values Sqrt Abs Residuals vs Fit Check this to plot the square root of the absolute values of the deviance residuals versus the fitted values This plot is useful for checking for the constant variance assumption of the model PARAVEIRCS ANA Parametric Survival Of x Model Options Results Plots Predict New Data I Predict Probabilities Predict Response m Predict Probabilities Predict Response At Response Value iE Probability selves i i TS o 0 5 0 9 Gontidence Level 1035 Probability Plot of Residuals Check this to create a probability plot of the standardized residuals onidence Level i 95 Save Results Pek Save In IV Print Results i Cancel Appl
140. he settings in the Startup page of the General Settings dialog Faster data entry A new option Buffer D ata Entry on the General page of the General Settings dialog under the O ptions menu allows S PLUS to buffer changes in a D ata Sheet so that they are sent to the data engine in chunks rather than as they are made as in S PLUS 4 0 Set this option to O ff to restore the old behavior M enu item and function to refresh memory Statistics 16 New robust regression method available via menu system and through the mRob MM function Power and sample size calculations Enhanced parametric survival accelerated failure time estimation Type lll sums of squares for ANOVA Bootstrap and jackknife estimation now available through the menu system Clustering methods are now available through the menu system WHATS NAWIN SRLS 45 Graphics e interactively select and highlight points Redraw excluding selected points e Linked highlighting in scatter plots nteractively rescale axes pan crop e Trellis drill down select one panel of a Trellis graph and create a full size copy e Color scale legends User Interface Select D ata dialog at startup for easy data selection More data manipulation dialogs Recode Split Stack Subset Transform Transpose Factorial D esign Orthogonal Array D esign Set Dimensions e Improved Insert Graph dialog with enhanced thumbnails e Excel add in f
141. hich yields output Call censorReg formula censor days event offset 0 5 voltage data capacitor2 weights weights Distribution Wei bull Coefficients Intercept 19 94567 Dispersion scale 1 090527 Log likelihood 1129 826 Observations 125 Total 71 Censored Parameters Estimated 2 Offset has been specified Computing the likelihood ratio test from the above two fits by hand we get LRT 2 1129 8 316 5 1626 6 which is compared with a chi squared distribution with one degree of freedom Clearly this is a significant result It is also possible to simply fix parameters in the model M ost often this will be the scale parameter but it is possible to fix any parameter For example in the capacitor example we may fix the voltage coefficient to be 0 5 using gt censorReg censor days event voltage data capacitor2 weights weights fixed list voltage 0 5 which gives result Distribution Wei bull Coefficients Intercept 19 94567 Dispersion scale 1 090527 Log likelihood 1129 826 Observations 125 Total 71 Censored Parameters Estimated 2 Comparing this with the results in which offset is set we see that the effect of fixing voltage to be 0 5 is the same as specifying the offset as 0 5 voltage 217 CERB PAAMERCREGESON RR EMRD DA FITTING MODELS ANOVA The anova function is used to compare models If a single object is input to anova then one term
142. hlighted in a Graphsheet window This 237 TPRI NAVGI TOOKT PLINCIO selection can be done interactively in the GUI this function permits the same behavior programmatically T his is useful for example if you want to highlight known outliers in a data set guiGetRowSelections Use the guiGetRowSelections function to obtain a list of rows in the current data set that are selected guiGetRowSelectionExpr Usethegui Get RowSelecti onExpr function to obtain an S PLUS expression for the set of rows currently selected in a GraphSheet or D ata Window For example consider the D ata Window shown in Figure 14 1 Hi fuel frame Weight Mazda 929 Y6 348000 Bo Nissan Maxima V6 3200 00 AS Oldsmobile Cutlass Ciera 4 276 00 49 Oldsmobile Cutlass Supreme V6 3220 00 sii Toyota Cressida 6 3480 00 Buick Le Sabre V6 aye Chevrolet Caprice Ve 3855 00 93 Ford LTO Crown Victoria Ws 3850 00 Figure 14 1 Data Window with two rows highlighted in fuel frame 238 guiPrintClass Rows 46 and 51 of the fuel frame data set are selected To store this information for future use you can uS guiGetRowSelectionExpr as follows gt guiGetRowSelectionExpr fuel frame 1 46 51 You can select those same rows in a gui Set RowSel ection later sesion using gt guiSetRowSelection fuel frame 46 51 Use the gui PrintClass function to obtain a list of properties for any GU class and for each property a list of a
143. iables to use to create an S PLU S graph Create S PLUS Graph Step 1 of 4 Data to Graph x Select variables in order For a 2D plot select x and y columns then depending on the plot type either additional y s or columns specifying symbol properties such as color or size For a 3D plot select x y and z Variables Selected variables lt Move Wp DF Use the Move button to move the variables to the Selected variables list Use the Up and Dn buttons to set the order of the selected variables Use the Del button to remove selected variables Cancel Finish T helist called Variables on the right is the list of all available variables in the data editor The list called Selected variables is a list of variables from the available variables you ve choosen to include in the S PLUS graph When a variable name is selected in either list you can use the M ove buttons to move it between the lists When a variable name is selected in the Selected variables list you can use the Up and Dn buttons to change the order of the variables The order of the selected variables is important because the order will determine how S PLUS graphs the data A similar dialog allows you to select variables for conditioning the graph you create Bact When you are using the Create Graph wizard in step 2 you can specify variables to use for conditioning the graph you are creating 49 CAPIRR4 SAs SSAD
144. ibution is given by F t y F t Yy The net effect of the threshold parameter is to shift the failure distribution to the right by a fixed amount Maximum likelihood estimation of yis not easily accomplished There is some discussion of this in Meeker and Escobar 1998 pp 224 231 You can either compute the value of y yourself and enter it as input to the censorReg function or censor Reg can be asked to estimate y in two different ways The first is to simply decrease the smallest value by 10 The second works only for log distributions and computes a value for y which optimally linearizes a qqplot of the Kaplan Meier estimate of survival and the censored observations By default Y 0 Once computed y is carried along with the censorReg object For the example in the table above we can set the threshold parameter to equal two as follows gt censorReg censor failure upper cens 1 data table4 truncation censor tlower tupper tcode distribution lognormal threshold 2 This yields output Call censorReg formula censor failure upper censor codes 1 data table4 truncation censor tlower tupper trunc codes distribution lognormal threshold 2 Distribution Lognormal Coefficients Intercept 1 664897 Dispersion scale 1 38711 Log likelihood 12 23809 Observations 9 Total 6 Censored Parameters Estimated 2 Threshold Parameter 2 Offsets Notice that the coeffic
145. iduals Deviance Residuals Check this to save the deviance residuals T he sum of squares of these added up to the deviance Pearson Residuals Check this to save the pearson residuals T hese are standardized residuals on the scale of the response Response Residuals Check this to save the response residuals PARAVEIRCS ANA Parametric Survival Of x Model Options Results Plots Predict Fit Plot Other Plots Probability Plot Of Failure Time T Six Distributions Plot a Shaw Marimun likelifeod estimate Iv Response vs Fit Shaw lontidence Bends Residuals es ass M Residuals vs Fit oycragde Uo MW Add Legend I Sart Abs Residuals vs Fit IV Prob Plot of Residuals m Stress Plot V Stress vs Failure Time Probabilttes for failure 0 01 0 05 0 1 0 5 M Add Legend gt Jitter Data Cancel Apply d current Figure 13 9 The Parametric Survival dialog Plots page Plots Page Fit Plot Probability Plot Of Failure Time Check this to plot failure probability versus failure time in models with one or fewer covariates or stratification variables Show Maximum likelihood estimate Check this to plot the maximum likelihood estimate of the failure probability on the fit plot 233 CAPIRR 13 PARAMEIRC REGRESSION FOR END DIA Stress Plot Other Plots Residuals 234 Show Confidence Bands Check this to plot the confidence bands for t
146. ient estimates have dramatically changed O ffsets are also used to change the distribution of the failure time variable Let denote the offset and let y denote the failure time W hen offsets are used the transformed failure time becomes _ gy xB e o where the offset is a known and fixed value A typical use of offsets is in likelihood ratio tests Suppose that x i xa 2 optimizes the likelihood when covariates x and x are included in the model Then a likelihood ratio test of Hy Bi K is obtained by setting x and comparing the optimized value of the likelihood of a model x52 with the optimized likelihood for model x i x gt B2 We illustrate using the capacitor2 failure data discussed above When voltage is included in the model the output is Call censorReg formula censor days event voltage data capacitor2 weights weights Distribution Wei bull Coefficients Intercept voltage 24 14083 0 6403586 Dispersion scale 1 203945 Log likelihood 316 4589 Observations 125 Total 71 Censored Parameters Estimated 3 A likelihood ratio test that the voltage coefficient is fixed at 0 5 is obtained by fitting a second model with offset specified to fix the parameter estimate of voltage 215 CAPIRR 13 PARAMETRC REGRESSION FOR ENED DA Fixing parameters 216 gt censorReg censor days event offset 0 5 voltage weights weights data capacitor2 w
147. imated coefficient of the market return is called the beta which measures the riskiness of the stock in terms of standard deviation and the expected returns T he larger the beta the more risky the stock is compared with the market but the larger the expected returns For comparison purposes first fit an LS model to the data as follows gt oil Is lt m Oil Market data oil 1s and print a short summary of the fitted mode gt oil s Call Imi formula Oil Market data oil df Coefficients Intercept Market 0 1474486 2 85674 Degrees of freedom 129 total 127 residual Residual standard error 0 4866656 Computing a To obtain a robust fit you use the mRobMM function just like the Im Robust Fit function gt oil robust lt mRobMM Oi Market data oil df gt oil robust Final M esti mates Call I mRobMM formula Oil Market data oil df Coefficients Intercept Market 0 08395777 0 8288791 Degrees of freedom 129 total 127 residual Residual scale estimate 0 1446283 Obviously the robust estimate of beta is dramatically different from the LS estimate According to the LS method the beta of this stock is 2 857 which 159 CAPIR 22 RAS LUNAR AGEN Least Squares vs Robust Fitted Model Objects 160 implies that the stock is 2 857 times as volatile as the market and has about 2 857 times the expected return T he robust estimate of beta is 0 829 which implies that
148. ine and each set of points corresponds to the fit and non censored observations for a different value of the covariate This plot gives a good assessment of the fit H owever it is currently only available for single covariate models The censorReg function is not constrained to single covariates but this plotting function is You can access this function directly by calling probplot See the help file for probpl ot censor Reg for more details Figure 13 3 displays what engineers refer to as a stress plot It plots the non censored observations and equi probability lines for the predictor variable the stressor verus failure times It is quite clear from the graph that as voltage stress decreases failure times increase This plot is also constrained 221 CAPIRR 13 PARAMETRC REGRESSION FOR ENED DA 222 voltage 22 24 26 28 30 32 20 Figure 13 3 Stress to single covariate regression models For more details see the help file for stressplot censorReg Stress Plot method regression KM extreme log fe O GD Q oW GD COM N N Soo anso as DUUDD T T T 100 0 1000 0 10000 0 Time to Failure plot of the fit The final diagnostic plot also for a fit with a single covariate is displayed in figure 13 4 This is the same plot as figure13 2 but repeated for six distributions T he distributions are the weibull the lognormal and loglogistic coupled with their non logged counterpa
149. ing the maximum number of iterations respectively for final coefficient estimates the refinement step and the final scale estimate The default value Auto sets all three to 50 Tolerance Enter the name of a list with components tlo tua and tl representing respectively the relative tolerance in the iterative algorithms the tolerance used for the determination of pseudo rank and the tolerance for scale denominators The default value Auto sets the tolerances as follows tlo 0 0001 tua 1 5e 006 tl 1le 006 Random Select this option to use the random resampling algorithm Exhaustive Select this option to use the exhaustive resampling algorithm only if the sample size is less than 300 and the number of predictor variables is less than 10 Genetic Select this option to use the genetic resampling algorithm Subsamples Enter the number of random subsamples to be drawn The default value Auto draws 4 6 2 ncol x samples RBA MREGESON Genetic Algorithm Random Seed Enter the seed parameter used in the random sampling algorithm Population Size Enter the population size of the genetic stock The default is 10 times the number of parameters being fit Random Samples Enter the number of random samples taken after the stock is filled The default is 50 times the number of parameters being fit Max Observations Enter the maximum number of observations including duplicates in a member of
150. is Fat but Surfactant is not at say a test size of 0 05 H owever in the presence of a significant interaction the test of the marginal means probably has little meaning for Fat and Surfactant Adjusted Means gt Baking aov lt aov Specific Vol Flour Fat Surfactant data Baking contrasts list Flour contr sum 4 Fat contr sum 3 Surfactant contr sum 3 gt anova Baking aov Analysis of Variance Table Response Specific Vol Terms added sequentially first to last Df Sum of Sq Mean Sq F Value Pr F Flour 3 6 39310 2 131033 12 88269 0 0002587 Fat 2 10 33042 5 165208 31 22514 0 0000069 Surfactant 2 0 15725 0 078625 0 47531 0 6313678 Fat Surfactant 4 5 63876 1 409691 8 52198 0 0010569 Residuals 14 2 31586 0 165418 gt anova Baking aov ssType 3 Analysis of Variance Table Response Specific Vol Type III Sum of Squares Df Sum of Sq Mean Sq _ F Value Pra Fi Flour 3 8 69081 2 896937 17 51280 0 00005181 Fat 2 10 11785 5 058925 30 58263 0 00000778 Surfactant 2 0 99721 0 498605 3 01421 0 08153989 Fat Surfactant 4 5 63876 1 409691 8 52198 0 00105692 Residuals 14 2 31586 0 165418 The adjusted marginal means given below estimate the means given in the Type III hypotheses for Flour Fat and Surfactant The means for Flour x Surfactant for the over parameterized model are DH oo a Hj Interestingly these means are still estimable even though not all Flour x Surfactant x Flour combinations we
151. izes are required so the standard formula based on the normal distribution was chosen Keep in mind that for samples sizes less than 10 the power of a t test could be significantly less than the target power The formula for a one tailed test is derived along similar lines and is exactly the same as the two tailed formula with the exception that Za a72 isreplaced by Z Q The function for computing sample size for normally distributed data is normal sample size 1 his function can be used to compute sample size 141 CAPRI POWRRANDSMAE SE power or minimum detectable difference and will automatically chose what to compute based on what information is input Here are some simple 0 3 examples one sample case using all the defaults gt normal sample size mean alt 0 3 mean null sdl mean alt delta alpha power n1 1 0 1 0 3 0 3 0 05 0 8 88 reduce output with summary gt summary normal sample size mean alt delta power nl 1 0 3 0 8 88 upper tail test recomputing power gt normal sample size mean 100 mean alt 105 sdi 10 power c 8 9 95 99 alt greater recompute power T mean null sdl mean alt delta alpha power nl 1 100 10 105 5 0 05 0 8037649 25 2 100 10 105 5 0 05 0 9054399 35 3 100 10 105 5 0 05 0 9527153 44 4 100 10 105 5 0 05 0 9907423 64 calculate power gt normal sample size mean 100 mean alt nl 1 5 20 105
152. jective choice of the user Similarly using evel 0 forces mRo bmm to return the final M estimates gt control mm lt mRobMM robust control level 0 gt oil mm lt mRobMM Oil Market data oil df robust control control mm Sometimes you may want to change the level of the test after fitting a robust regression model For this purpose you can use the generic function update which has a method for mRobMM objects For example to change the level of test for bias for oi I s use the following command gt oil tmp lt update oil s level 0 2 gt oi tmp Final M esti mates Call I mRobMM formula Oil Market data oil df robust control control s Coefficients Intercept Market 0 08395777 0 8288791 Degrees of freedom 129 total 127 residual Residual scale estimate 0 1478398 Now the final M estimates are returned Also if both the f or mul a and the level arguments are missing for update the function alternates between the initial S estimates and final M estimates N ote If you only want to compute the S estimates and do not care about the final M estimates you can do so by specifying the estim argument to mRobMM robust control as follows gt control s lt mRobMM robust control esti m gt oil s lt mRobMM Oil Market data oil df robust control control s CONFOLINS OOS RR RBA RRESON Resampling Algorithms Random Resampling
153. l value or current value if any for the control This method should return TRUE to indicate suc cessful completion and FALSE to indicate failure Included in the file OCX Utils h copied previously into your control project directory are numerous helper functions such as the one used here Get St ringFromVariant which will convert the incoming variant into a string if possible You can then use this string to set one or more properties in your control To use the SPlusOnInitializeControl in this example ActiveX con trol first add a member string to the control class Edit the MyOCXCtl h file and add a CString member variable called m_sValue to the CMyOCXCtrl class private CString m_sValue Next initialize this value in the constructor for CMyOCXCtrl by modifying the 279 CFPIR 16 DACGCNIROSINSALS 45 280 constructor definition in MyOCXCtL cpp CMyOCXCtrl CMyOCXCtl0 Initialize IDs amp ND_DMyOCX amp ID_DMyOCXEvents TODO Initialize your control s instance data here m_sValue Empty Then add lines to the definition of the override of SPlusOnInitializeCon trol in your control class to set this member variable and refresh the control by modifying MyOCXCtl cpp BOOL CMyOCXCtrl SPlusOnInitializeControl const VARIANT FAR amp vInitial Value CString sInitialValue sInitialValue Empty if GetStringFromVariant sInitial Value vInitialValue Initi
154. larity matrix then this argument will be ignored Save As Enter thename for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten Save Data Check this box to store a copy of the data in the model object Save Dissimilarities Check this box to store a copy of the dissimilarities in the model object 103 CAPIR8 CLBIERNGINSRLS Divisive Hierarchical Clustering Model Results Plot r Printed Results q Saved Results Output Type C None Save ln Short I Cluster Membership Number of Clusters 2 4 Cancel Apply i current Help Figure 8 8 TheDividveH ierarchical Clustering dialog Results page Results Page Printed Results Output Type Select N one for no printed output or Short for a short printed summary Saved Results Save In Specify the name of a data frame in which to save cluster membership if Cluster M embership is checked Cluster Membership Check this to save a vector of indices giving cluster memberships in the specified data frame Number of Clusters Specify the number of clusters to form when generating cluster membership indices 104 ONSE HEARTH CLSIERNG Divisive Hierarchical Clustering Model Results Plot m Plots T Clustering Tree I Banner Plot cencet anol id gt f curer Heb Figure 8 9 TheDivisveH ierarchical Clust
155. le Note that ht ml tabl e is designed to work with the previously mentioned data structures For other structures such as functions calls and objects with specific pri nt methods the results of ht ml tabl e may not be satisfactory Instead the object may be printed as preformatted text and embedded in the HTML page TEXT Thesi nk function may be used to direct S PLUS text output to an HTML file The preformatted output may be interspersed with the HT ML markup tag lt PRE gt to denote that it is preformatted output Additional textual description and HTML markup tags may be interspersed with the S PLUS output usingcat gt sink my htm gt cat lt H3 gt Linear Model Results lt H3 gt n gt cat lt PRE gt gt summary m Mileage Weight fuel frame gt cat lt PRE gt gt sink The paste and deparse functions are useful for constructing strings to display with cat See their help files for details 113 CAPIRY GEAINGHM OURO GRAPHS 114 The two steps involved in embedding an S PLUS graph in an HTML page are exporting the graph in a format such as GIF or JPG which is viewable with a web browser and placing an lt I MG gt tag in the HTML file describing the location of the image Use the export graph command to export a graph to a specific file gt graphsheet Name MyGraph gt xyplot Mileage Weight fuel frame gt export graph Name MyGraph FileName my gif
156. le Test Resource dili From the workspace dialog that appears select OLE ControlWizard from the list of workspace types available Enter a name for the project and specify the loca tion then click the Create button 269 CFPIR 16 DACGCNIROSINSALS 45 New Project Workspace x Type KA MFC ppw izard exe Ee MFC AppWizard di OLE Control Name Create MyOCX Cancel ddi Help Platforms A Application Mwina l Dynamic Link Library Location Console Application ai E MyOC noes i After accepting this dialog you will see a series of dialogs associated with the OLE ControlWizard asking questions about how you want to implement your control For now you can simply accept the defaults by clicking Next on each dialog When you reach the last dialog click the Finish button You will see a confir mation dialog showing you the choices you selected and names of classes that are about to be created Click the OK button to accept and generate the project files In the ClassView page of the Project Workspace window in Visual C you will see the classes that the OLE ControlWizard created for your ActiveX control 270 ACINEX CHIROSIN SR1s DAGS m CMyOCXApp Be CMyOCKCt Be CMyOCXPropPage 3 Globals DliRegisterServer DllUnregisterServer _tlid _werajor _wVerMinor a TP Aki mm 1 2 A
157. ll path will produce a tab delimited text file For more complete exporting capabilities save the table as a data frame see above and then choose File Export D ata from the menu 133 CPR PONRADSMIESE BINOMIAL POWER AND SAMPLE SIZE The Binomial Power and Sample dialog assists in computing power sample size or minimum detectable difference C hoose Statistics Power and Sample SizeBinomial Proportion from the main menu The dialog shown below appears Binomial Power and Sample Size Of x Model Options Printout Select Null Hypothesis Compute Sample Size Proportion 0 5 Power Ronee rece fn Min Difference Suhr Medals m Alternative Hypothesis Alt Proportion One Sample Groupe Proportion m Probabilities Alphals 0 05 Test Type two sided 7 Power s 0 8 v Results J Save m Sample Sizes wans T M Print Results Sample Type Cancel Apply d current Figure 11 4 The Binomial Power and Sample Size dialog M odd page 134 BNCMAL POWER AND SALE SE Model Page Select Group Probabilities Group Sample Sizes Group Null Hypothesis Group Alternative Hypothesis Group Results Group Options Page Compute Choose one of Sample Size default Power or M in Difference Sample Type The choices are O ne Sample or Two Sample T his group is where alpha and power are specified defined a
158. log nor will most tell S PLUS how much space to give the control in the dialog To fully support S PLU S dialog layout and data communication to and from S PLU S dialogs a few special ActiveX methods properties and events need to be implemented in the control by the control designer Examples of ActiveX controls which implement support for S PLUS dialog containment are provided on disk in the SAM PLES OCX directory beneath the program directory These examples are C projects in M icrosoft Visual C 4 1 using MFC Microsoft Foundation Classes Any MFC Activex project can be modified to support S PLUS dialogs easily and this will be discussed later in this section Also in SAM PLES O CX are example scripts which use S PLUS to test these ActiveX controls To use an ActiveX control for a property in a dialog when creating the property specify a DialogC ontrol of type OCX String and specify the program id or PROGID of the control using the ControlProgld subcommand Below is an example S PLUS script which creates a property that uses an ActiveX control guiCreate Property name OCXStringField DialogControl OCX String Control Progid TXTESTCONTROLI TxTestControliCtri 1 ControlServerPathName c myocx myocx ocx DialogPrompt amp OCX String If you are editing or creating a property using the object browser the Property object dialog for the property you are editing allows you to set
159. longs T he class name is a required argument in gui Modif y 2 If no plot type is specified return a list of valid plot types T hese are the valid plot types for gui Plot For example gt guiGetPlotClass Scatter 1 LinePl ot gt guiGetPlotClass 1 Scatter Line LineScatter 4 IsolatedPoints HighDensity TEKE 7 Bubble Color Bubbl eCol or 10 Loess Spline Robust 13 Dot Ti meSeries Step 16 Vertical Step HorizDensity YZeroDensity 19 Super Kernel LinearCF 22 Pol yCF ExpCF LaCF gt guiPlot Loess DataSetValues environmental 1 2 gt guiModify guiGetPlotClass Loess Name gui Get Pl otName LineCol or Red 243 TPRI NAVGI TOOKT RLINCIOS guiRemoveContents guiUpdatePlots 244 Use gui RemoveContents to remove the objects contained by the specified container For example gt guiRemoveContents GraphSheet Name gui Get GSName will clear the contents of the current graph sheet leaving it blank To update the plots created by gui Pl ot DataSet Values with new data set values US gui UpdatePlots For example gt gsName lt guiPlot Scatter DataSetValues fuel frame 1 21 gt guiUpdatePlots GraphSheet gsName DataSetValues environmental 1 2 The number of columns in the data set used in gui UpdatePI ots should be the same as the number of columns in the original data set used in gui PI ot AUTOMATI
160. me subset I Show in Data Window Cancel Apply current Help Figure 6 7 The Subset dialog Data Data Frame Specify the data frame Subset Rows with Enter an S PLU S expression that identifies the rows to include in the subset T he expression must evaluate to a vector of logical values T RU E values are used FALSE values are dropped or a vector of indices identifying the numbers of the rows to use 69 CAPIR6 MNPUAINGDYA Results 70 Columns in Subset Select the columns to be included in the new data frame By default all columns are included Result Type Select D ata Frame to return a new data frame containing only the specified subset of rows Select Add Column to return all rows with a new logical column indicating subset membership Save As Enter the name for the new data frame If an object with this name already exists its contents will be overwritten Column Name Specify the name for the new column indicating subset membership T his is only relevant if Result Type is Add Column Show in Data Window Check this box to display the new data frame in a D ata Window TRANSFORM This dialog creates a new variable based on a transformation of other variables To transform variables Choose Data Transform from the main menu The dialog shown below appears Transform Biel Es Data Add to Expression Data Frame Variable al v New Colum
161. me for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten Save Data Check this box to store a copy of the data in the model object This is necessary if you wish to produce a clusplot for the modal Save Dissimilarities Check this box to store a copy of the dissimilarities in the model object T his is necessary if you wish to produce a clusplot for the moda 95 CAPIR8 CLBIERNGINSRLS Fuzzy Partitioning e x Model Results Plot r Printed Results r Saved Results Output Type C None Save In oy shee I Cluster Membership C Long i Cancel Apply i current Figure 8 2 The Fuzzy Partitioning dialog Results page Results Page Printed Results Output Type Select N one for no printed output Short for a short printed summary or Long for amore detailed printed summary Saved Results Save In Specify the name of a data frame in which to save cluster membership if Cluster Membership is checked Cluster Membership Check this to save a vector of indices giving cluster memberships in the specified data frame 96 PUY PARITIONNGS Fuzzy Partitioning Mi x Model Results Plot r Plots T Clusplot I Silhouette Plot Cancel Apply i current Figure 8 3 TheFuzzy Partitioning dialog Plot page Plot Page Plots Clusplot Check this to create a clusplot
162. mula Oil Market data oil df Coefficients oil Ils oil robust Intercept 0 1474 0 08396 Market 2 8567 0 82888 Residual Scale Esti mates oil ls 0 4867 on 127 degrees of freedom oil robust 0 1446 on 127 degrees of freedom You can easily plot acompare fits object to obtain a visual comparison of vs Robust Fits the LS and robust fits 166 gt plot oil cmpr COMPARING LEAST SARS AND ROBLET ATS Make a plot selection or 0 to exit 1 Normal QQ Plots of Residuals 2 Estimated Densities of Residuals 3 Residuals vs Fitted Values 4 Response vs Fitted Values Selection For example the normal QQ plot and estimated densities for oi 1 cmpr are shown in Figure 3 T he densities of residuals are estimated using a kernel type density estimate For a good modal fit the probability density estimates for the residuals will be centered at zero and nearly as narrow as possible Figure 3 shows that the density of residuals from the LS estimate is shifted to the left of the origin whereas that of the robust fit is well centered Furthermore the outlier bumps in the residual density estimates for the M M estimator are pushed further from the mode of the density and thus are a little more pronounced than those for the LS estimates because there is one big outlier in the data 167 CAPIR 22 RAS UGRESS oil ls o oil robust oD oD 1 5 2 0 1 0 0 5 0 0 Figur
163. n For example suppose we wanted to view the About S PLUS dialog at some point in our function O pen the O bject Browser and create a new page containing the Interface Class M enu Item Expand the SPlusM enuBar node and highlight the menu of interest in the left pane Right click on the desired menu item in the right pane and select Command from the right click menu T he built in operation is shown at the top of the page gt guiExecuteBuiltin SPlusMenuBar Obj ect Browser Wi ndow Tile Vertical We can then use this command in a call to guiExecuteBuiltin gt guiExecuteBuil tl n SPlusMenuBar Obj ect Browser Hel p About S PLUS guiGetPropertyOptions Use the gui Get Propert yOptions function to see a list of acceptable values for a given GUI property For example you can determine the available border styles for objects of GU I class Box as follows gt guiGetPropertyOptions Box BorderStyle 1 None Solid Dots Dot Dash 5 Short Dash Long Dash Dot Dot Dash Alt Dash 9 Med Dash Tiny Dash guiGetPropertyPrompt Use the guiGetPropertyPrompt to see basic information about the property such as its GUI prompt its default value and whether it isa 241 TPRI NAVGI TOOKT PINTO required property For example for the GUI class Box the Border Style property information is as follows gt guiGetPropertyPrompt Box BorderStyle PropName 1 BorderStyle prompt 1 Style
164. n Name Expression Function lt None gt fad Operator X Add m Cancel Apply f current Figure 6 8 The Transform dialog Data Data Frame Specify the data frame New Column Name Specify aname for the new column containing the transformed data Expression Specify an expression describing the transform T his expression may refer to other columns in the data frame The expression may be typed in or built using the Add to Expression controls 71 CAPIR6 MNPUAINGDYA Add to Expression 72 Variable Select a variable to use in the expression Function Select a function to apply to the specified Variable in the expression Generally this will be a function that takes a single vector as input and returns a vector or scalar If the result is a scalar the value will be replicated to match the length of the result vector as is standard in S PLUS If the function takes more than one argument the other arguments will be written in the expression with their default values T hese values may be edited in the Expression field Operator Select the operator to use when placing the new term in the expression Add Press this to append the new term to the expression TRANSPOSE Transpose T his dialog transposes a data frame To transpose a data frame Choose Data Transpose from the main menu The dialog shown below appears Data Data Frame SDF1 Resul
165. n is H true e Reject H when H is false e Reject H when H istrue typel error e Dont reject H when H isfalse typell error To construct a test the distribution of the test statistic under H is used to find a critical region which will ensure the probability of committing a type error does not exceed some predetermined level This probability is typically denoted a The powe of the test is its ability to correctly reect the null hypothesis or 1 Pr typell error which is based on the distribution of the test statistic under H T he required sample size then will bea function of 1 Thenull and alternative hypotheses 2 Thetarget a 3 Thedesired power to detect H 4 The variability within the population s under study Our objective is for a given test to find a relationship between the above factors and the sample size that will enable us to select a sample size consistent with the desired and power 139 CPR PONRADSMIESE NORMALLY DISTRIBUTED DATA One Sample When conducting a one sample test of a normal mean we start by writing Test of our assumptions and hypotheses Gaussian Mean X N p 0 where i l n and G2 is known To perform a two sided test of equality the hypotheses would be as follows Ay UW H U Ha O ur best estimate of u is the sample mean which is normally distributed Z o2 X mus and the test statistic is Z Jn X u 5 NH Ho 1 N 0 1 for
166. n the S PLUS language and exposed via Automation to transform the data and save the plot with your Automation client document Examples written in Visual Basic 4 0 and in Visual Basic for Applications with Excel 7 0 are distributed with S PLUS to demonstrate automating an embedded graph sheet VBEM BED EXE and corresponding Visual Basic source files can be found in samples oleauto vbembed off your S PLUS program directory This example demonstrates how to do the following embed an S PLUS graph sheet add objects to it modify those objects by displaying object property dialogs in the client program delete objects from it save a document containing the embedded graph sheet P PLOTDATA XLS can be found in samples oleauto vba This example demonstrates how to do the following embed an S PLUS graph sheet add a plot to it e send Excel data from a worksheet to S PLUS to be graphed in the plot modify plot properties using property dialogs EXAVPLES O AUICMATION FROWDED WH SALS EXAMPLES OF AUTOMATION PROVIDED WITH S PLUS The following directories all paths relative to the S PLUS installation directory contain examples of using S PLUS as an automation server included with S PLU S samples oleauto senddata vbembed vbclient vba vbrunfns dialogs Example Visual Basic 4 0 project that shows how to send data to S PLU S data objects Example Visual Basic 4 0 project that
167. nction recently discovered by Yohai and Zamar 1998 Figure 4 shows the Tukey bisquare function on the left 173 CAPIR 22 RAS UGRESS and the optimal loss function on the right foo foo S S o o c c 4 wt S c N N S c o 2 T T T T T E T T T T T 4 2 0 2 4 4 2 0 2 4 Bisquare Rho Optimal Rho N N e N N T T T T T T T T T T 4 2 0 2 4 4 2 0 2 4 Bisquare Psi Optimal Psi Figure 12 4 Available Loss Functions The exact forms of these functions can be found in the Theoretical D etails section Since the optimal loss function above has better combined Gaussian efficiency and non Gaussian bias control properties it is used as the default for robust regression H owever you can choose to use the Tukey bisquare function or a combination of those two functions by controlling the wei ght argument to mRobMM robust control as follows gt control lt mRobMM robust control wei ght c Bisquare Optimal 174 CONFOLUNS OTOS6 RR RBA RESON Confidence Level of Bias Test gt oil tmp lt mRobMM Oil Market dataz oil df robust control control gt coef oil tmp Intercept Market 0 08371818 0 8291069 In the above commands the rescaled bisquare function is used for the initial S estimates and the optimal loss function is used for the final M estimates In theoil robust example shown above the final M
168. nd x are different names W here appropriate Save As defaults to a name that starts with last For example last censorreg is the most 229 CAPIRR 13 PARAMEIRC REGRESSION FOR END DIA Parametric Survival Figure 13 recent parametric survival model fit Model Options Results Plots Predict m Optimization Parameters Convergence Tolerance 0 0001 Maximum Iteration 500 Cancel Apply current 7 The Parametric Survival dialog O ptions page Options Page Use the Options page to define optimization parameters for model computations Optimization Convergence Tolerance Parameters 230 Enter anumber specifying the convergence tolerance Iteration will continue until the relative change in deviance is less than this number Maximum Iteration Enter a number specifying the maximum number of iterations If convergence has not been reached after this number of iterations the PARAVEIRCS ANA Parametric Survival Of x Model Options Results Plots Predict Printed Results Saved Results l Short Output Save In MV Long Output Tl Fitted Values procedure will stop I Standardized Residuals I Deviance Residuals J Pearson Residuals I Response Residuals Cancel Apply d current Figure 13 8 The Parametric Survival dialog Results page Results Page Printed Results Short Output Check this to print asummary of th
169. ndow sessions use the O ptions Save Window Size Properties as Default menu selection To change the number of characters through which S PLUS will search for an automatic match enter a value in the Match CharLimit text field The default value 1 means to search from the cursor to the top of the file The properties of a Script Window can also be accessed from the O bject Browser To do this first be sure that you are filtering on the Interface C lass Script T his Interface Class is not included in the filter by default T hen select Script in the left pane of the O bject Browser and right click on the appropriate script in the right pane Select Properties from the pop up menu 291 CAPIR 17 NAVSAPT WNOOWFEAIURS 292 INEX INDEX Numerics 4 Pane Conditioning 22 9 Panel Conditioning 22 A Accelerated failure time models 200 Accelerated testing models 200 ActiveX Controls in S Plus dialogs 264 Adding an ActiveX control to adialog 264 add on modules 13 Adjusted M eans 115 Agglomerative H ierarchical Clustering 98 Agglomerative H ierarchical Clustering dialog M odel Page 98 Plot Page 101 Results Page 100 agnes 101 analysis of variance table 193 anova censorReg 236 Auto Scale Axes 21 Automatic G eneration Of Right Braces 289 Automatic Indentation 290 Automatic M atching of D elimiters 289 Automating Embedded S Plus Graphs 258 Automation Improvements in S Plus 4 5 245 Bootstrap Inference dialog 76 J
170. ne above the other WNG THE GH TOS METE Separate Panels with Varying X Axes If you are plotting more than one set of data series on a graph use this button to have each plot drawn in a separate panel T he Panel Type for the graph will be set to By Plot The axes scaling for the Y axis will be the same for each panel but the X axis ranges will vary according to the data in each panel The Number of Rows for the panels is set to Auto which defaults to 1 so that the panels will appear side by side E Panels with Varying X and Y Axes If you are plotting more than one set of data series on a graph use this button to have each plot drawn in a separate panel T he Panel Type for the graph will be set to By Plot The axes scaling for the X and Y axes will vary according to the data in each panel 23 CAPIRR2 NAW INIERFOINE GYPHG GPABLITIES RR SALS45 HIGHLIGHTING SELECTED DATA POINTS 24 You can modify the way in which points are highlighted in the Interactive page of the Graphs dialog To open this dialog choose Graph O ptions from the O ptions menu T he options are Display Selected Points If this box is not checked scatter plot points will not be highlighted The remainder of the fields in this dialog will not be used The options for specifying the selected symbols are Style Choose a symbol style for the selected symbols If None is chosen the selected symbols will be the same style as is specifie
171. neration Of Right Braces 285 Automatic Indentation 286 Modifying Script Window Settings 286 Several new features have been added to the Script Window in S PLUS 4 5 T hese features are intended to simplify typing S PLUS functions Each of these features can be enabled or disabled independently of the others S PLUS automatically matches parentheses brackets braces and quotation marks and For example whenever you type a right parenthesis the editor automatically highlights the matching left parenthesis T he behavior is the same for brackets braces single quotes and double quotes This helps a programmer ensure that matches are as intended By default S PLUS searches through the entire Script Window to find an automatic match For large scripts this can be very time consuming so you can restrict the search to a specified number of characters More precisely after you type the right parenthesis the cursor moves automatically to the matching left parenthesis and highlights it for a predetermined length of time by default 0 5 seconds or 500 milliseconds The cursor then moves to the the space following the right parenthesis Any intervening keystrokes are buffered so that no keystrokes are lost if you keep typing while the matching parenthesis is being highlighted The length of time for highlighting can be changed When automatic generation of right braces is enabled
172. o include a graph showing the density estimate for the residuals of the robust fit together with the density estimate for the residuals of the standard least squares fit Residuals vs Fit Check this to include a graph showing the residuals vs fit plots for both the robust model and the standard least squares fit Response vs Fit Check this to include a graph showing the response vs fit plots for both the 195 CAPIR 22 RAS LINAR AGEN robust model and the standard least squares fit Robust Linear Regression Of Xx Model Options Results Plot Predict New Data Options Save Confidence Level 0 95 Save In J Predictions l Confidence Intervals l Standard Errors A Cancel Apply ne eo btali 1 Help bmc linreg4 bmp Predict Page New Data Enter the name of a data frame to use for computing predictions It must contain the same names as the terms in the right side of the formula for the model If omitted the original data are used for computing predictions Save Save lIn Enter the name of an S PLus data frame in which predictions confidence intervals and standard errors are to be saved If an object with the name you enter does not already exist in database 1 then it will be created If you 196 RBA MREGESON Options enter the name of a data frame that already exists in database 1 and this data frame has the same number of rows as the number of observations used in the model fit th
173. olean obj SetParameterClasses comma delimited string GetParameterClasses string array obj GetParameterClasses Table 5 Returns TRUE if successful FALSE if not Returns an array of strings representing the class names of the return value fol lowed by each of the parameters of the function Takes in a comma de limited string specifying the class names of the return value followed by each of the parame ters of the function It is required that the return value class name be specified first and that the number of class names specified in this string match the total number of parameters of the function plus its return value Takes no parameters Returns an array of strings representing the class names of the re turn value followedby each of the parameters of the function The above example in Visual Basic 4 0 can be modified to show how to use SetParameterClasses We can use SetParameterCl asses to adjust how the data from Visual Basic is interpreted by My Function Dim pArray 1 to 3 pArray 1 1 0 pArray 2 2 0 pArray 3 3 0 as double Dim pMyFunction as Object Set pMyFunction CreateObj ect S PLUS MyFuncti on 247 CAPIR 15 AUOMAICN IMPORMNSINSRLS 45 248 LE pMyFunction SetParameterClasses data frame vector TRUE _ then pMyFunction a pArray pMyFunction Run Dim pReturnArray as Variant pReturnArray pMyFunction ReturnVal ue
174. om Resampling Initial Robust Optimal Subsamples auto C Bisquare Random Seed has 0 Final Robust Optimal AEU N C Bisquare aain si a i Inference ra fuo Efficiency 0 85 Confidence Level 0 10 m Optimization Max Iterations l Tolerance l Auto v Auto ka fomc robmm2 bmp Options Page The Options page of the Robust Linear Regression dialog contains the controls specific to the robust M M estimate regression method Estimation Method Test Based Select this option to have S PLUS calculate both initial S estimates and final M estimates and report results for one of these estimates based on a test for bias 189 CAPIR 22 RAS UGRESS 190 Loss Functions Inference Optimization Resampling Random Resampling Initial Robust Select this option to have S PLUS calculate only initial S estimates Final Robust Select this option to have S PLUS calculate only final M estimates Initial Robust Select the desired loss function Optimal or Bisquare for the initial S esti mates Final Robust Select the desired loss function Optimal or Bisquare for the final M estimates Efficiency Enter the asymptotic efficiency of the final M estimates Confidence Level Enter the desired level of significance of the test for bias of the final M estimates Max Iterations Enter the name of a list with components mxf mxr and mxs represent
175. ootstrapped It may be a function that accepts data as the first argument and returns a vector or matrix or a call referring to the data that evaluates to a vector or matrix For example to bootstrap the regression coefficients for regressing Mi ea ge on Weight in the fuel frame data use the expresion coef Im Mil eage Wei ght fuel frame and specify fuel frame asthe Data Frame To bootstrap the mean of Mi I eage use the expression mean Mileage Save As Enter thename for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten Save Resampling Indices Check this to save the matrix of resampling indices describing which observations appear in each resample Bootstrap Inference p x Model Grouping Print Resampling Options Number of Resamples Random Number Seed Block Size I Assign Resampled Data to Frame 1 Options Results Plot Jack After Boot fi 000 Variable v teration Numbers Cance Apply d current Figure 7 2 The Bootstrap Inference dialog O ptions page 77 CAPIRR7 BMN MHIS Options Page Resampling Options 78 Number of Resamples Specify the number of replicates to draw T he default is 1000 replicates as this isa minimal number recommended for estimating percentiles Grouping Variable Specify a grouping variable to use when resampling observations
176. opriate size then a warning is issued and a modified name is used Ny Tip You may want to specify the same data frame as on the M odad page T his allows easy plotting of the fitted values or reiduals with the original data Fitted Values Check this to save the fitted values from the model in the object specified in Save In Residuals Check this to save the residuals from the model in the object specified in Save 193 CAPIR 22 RAS LINAR AGEN 194 In T hese are the ordinary residuals the response minus the fitted value Robust Linear Regression Bi E Model Options Resuts Pit Predict Plots Options T Residuals vs Fit F Include Smooth Sort Abs Residuals vs Fit T Include Rugplot l Response vs Fit Number of Extreme Points To Identify a Comparison Plots with LS Fit M Residuals Normal QQ l Residuals Normal QQ l Residual Fit Spread M Estimated Residual Densities T Residuals vs Fit l Response vs Fit P i Cancel Apply gt lof 1 Help omc linreg3 bmp Plot Page Plots Residuals vs Fit Check this to display a plot of the residuals versus the fitted values Sart Abs Residuals vs Fit Check this to display a plot of the square root of the absolute values of the residuals versus the fitted values This plot is useful for checking for the constant variance assumption of the model RBA MREGESOWN Options Comparison Plots with LS Fit
177. or S PLUS graphics Import and Export New Excel add in to create S PLUS graphics from Excel 17 CAPR 1 WAGE OSAL Function to generate H TM L tables Programming Dialogs now support ActiveX controls e Enhanced automation support including many new included examples e Enhanced editing features in script windows include automatic delimiter matching and auto indent feature License Management e License manager for network version 18 NEW INTERACTIVE GRAPHICS CAPABILITIES FOR S PLUS 4 5 Using the Graph Tools Palette Highlighting selected data points Excluding or Including Only Selected Points in Your Plot Color Scale Legends Usage Properties 20 24 25 26 26 27 CAPIRR2 NAW INIERFOINE GAEHC GPABLITIES RR SALS45 USING THE GRAPH TOOLS PALETTE 20 A new Graph Tools Palette has been introduced in S PLUS 4 5 It provides tools for selecting data refocusing the graph on a subregion or specific panel and for creating and modifying interactive Trellis graphs Some of these tools were also available on the Annotations or the Plot2D palettesin S PLUS 4 0 To bring up the graph tools palette click on the Graph Tools button on the graph sheet toolbar shown when a graph sheet isin focus To enable any of the tools click on the appropriate button on the Graph Tools Palette 2 Select Tool m Label Point Bal sadet Data Standard selection mode where clicking on a graphical object selects th
178. or the control and a class for the property sheet for the control In the control class section of this dialog you will see the Type ID field This is 266 ACINEX CNIROSIN SR1s DAGS the PROGID for the control Edit Names xi Short Name Blip OK Cancel Control Class Name m Property Page Class Name CBlipCte BlipCtlh Help dili Header File Type Name Implementation File BlipCt cpp BLIP BlipCtrl 1 CBlipPropPage BipPpah Blip Property Page Implementation File Type ID BipPpa cpp BLIP BlipPropPage 1 Header File Type Name Registering an ActiveX control It is important to register an ActiveX control with the operating system at least once before using it so that whenever the PROGID of the control is referred to such as in the ControlProgld subcommand above the operating system can properly locate the control on your system and run it Registering an ActiveX control is usually done automatically during the creation of the control such asin M icrosoft Visual C 4 0 or higher If the subcommand ControlServerPathN ame is specified in an S PLUS script using the control then this value will be used to register the control automatically A control can also be registered manually by using a utility called RegSvr32 exe This utility is included with development systems that support creating ActiveX controls such as Microsoft Visual C 4
179. ou to modify properties of this plot Before you can create a graph you must first select data in the data editor You can select variables in the SPSS data editor by clicking on the column header where the variable name appears for each variable you want to include in the graph S PLUS plots accept data in a variety of formats Some S PLUS plots require at least three columns of data and the data are interpreted as X Y and Z data values O ther plots require at least four columns of data and interpret the data selected as X Y Z and W data values For an explanation of the data specifications for various S PLUS plot types please see the S PLU S U s s Guide Chapter 8 Creating a Graph Preparing D ata for Graphing For example if you wanted to create two line plots in an S PLUS graph and you had the following variables in SPSS 47 CAPIRR4 SAs SSADIN 48 Coama in yin yi ooo The Create Graph wizard will treat the xdata variable in this selection as the X data and the ydatal and ydata2 variables as the Y data This will create two line plots the first one with X data as the xdata variable and Y data as the ydatal the second plot with X data as the xdata variable and Y data as the ydata2 variable Steps 1 and 2 of the Create Graph wizard allow you to add to remove from WNG THE SALSSSADIN Selecting data for conditioning S PLus graphs and reorder the list of selected var
180. pArray 2 2 0 pArray 3 3 0 Dim pMyFunction as Object Set pMyFunction CreateObject S PLUS MyFuncti on pMyFunction a pArray pMyFunction Run Dim pReturnArray as Variant pReturnArray pMyFunction ReturnVal ue In this example after ther un method is called the function will be executed and the ReturnValue property will contain the result of running the function in S PLUS This is retrieved in the Visual Basic variable pReturnArray By default all parameter data is passed as a data frame to the function This means that in the above example pArray is first converted into a data frame and then this data frame is passed to the function MyFunction This default behavior could cause errors if the function you ve exposed expects data types other than data frames You can control the data types used in a function exposed via automation in one of two ways You can call the Set ParameterClasses method of the function with a comma delimited string specifying the data types or class names for each of the parameters and the return value of the function PASSING DAA OANTOS VA AJOATON Method to get and set parameter classes of functions exposed via automation Alternatively you can set a property of the FunctionlInfo object called Argument ClassList with a comma delimited string specifying the data types or class names for each of the parameters and the return value of the function SetParameterClasses bo
181. pletion dialog Close Excel to continue with the rest of S PLU S setup If you choose not to install the S PLU S Excel Add in during S PLUS setup you can install this option at any later time using S PLU S setup and choosing the custom setup mode Then select the S PLUS Add in from the list of custom setup options If you installed the S PLUS Excel Add in on a server you can install the add in on a workstation without using S PLUS setup Open the file called INSTALL XLA from the ExcelWiz subdirectory of the S PLUS program INSALUING THE SALSEXEL ADIN directory on the server system T his will start an automatic installation of the add in from the server to the workstation You can also manually install the add in using Excel To do this follow these steps oi Ia Start M icrosoft Excel 7 0 or higher on your workstation Create a new worksheet if one does not already exist From the Tools menu select Add Ins From the Add Ins dialog click the browse button Add Ins 21x T Analysis ToolPak Cancel T Analysis ToolPak VBA I AutoSave MV MS Query Add In EION T ODBC Add In IV Template Wizard with Data Tracking T Update Add in Links g AccessLinks Add In Lets you use Microsoft Access Forms and Reports on Microsoft Excel data tables For Excel 7 0 select SPLUS95 XLA on the server in the ExcelWiz subdirectory of the S PLUS program directory For Excel 8 0 or higher select
182. process of selecting data choosing an S PLUS graph and plot type and creating the graph in Excel much like Excel s ChartW izard 33 CAPIR3 SA EXEL ADIN INSTALLING THE S PLUS EXCEL ADD IN Installation during S PLUS setup Manual installation 34 During atypical custom or server installation of S PLU S 4 5 S PLUS setup will examine your system for an appropriate version of M icrosoft Excel The S PLUS Excel Add in requires M icrosoft Excel version 7 0 or higher Once detected setup will automatically enable the option to install this add in You can disable installation of the add in by choosing the custom install and un checking this option from the list of options At the end of setup you will be prompted to install the S PLUS Add in Setup will then start Excel and load a special add in installation program in Excel to continue with installation You will see a dialog asking you to confirm some paths Install S PLUS Add in EI To install the S PLUS Add in with helpful wizards for creating and modifying S PLUS graphs in Excel click the Install button Click the Cancel button to skip this installation Install From fe spluswin E xcelwiz SPLUS95 L4 Browse Install To E OFFICESS EXCELSLIBRARYSSPLUS95 XL4 Browse Coros You can use the browse buttons to change the paths detected Click the Install button to install the S PLU S Add in in Excel When completed you will see a successful com
183. r columns use standard S PLUS subscripting of the data frame Number of Clusters Specify the number of clusters to form or a matrix of initial values for cluster centers Maximum Iteration Specify the maximum number of reallocation iterations to perform KMA CLASHING Save Model Object Results Page Printed Results Saved Results Save As Enter the name for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten K Means Clustering Iof xi Model Results Printed Results r Saved Results Dutput Type C None Saveln r ahon a Cluster Membership Long 4 Cancel Apply of cuter Help Output Type Select N one for no printed output Short for a short printed summary or Long for amore detailed printed summary Save In Specify the name of a data frame in which to save cluster membership if Cluster Membership is checked Cluster Membership Check this to save a vector of indices giving cluster memberships in the specified data frame Related programming language functions kmeans 89 CAPIR8 CLBIERNGINSRLS PARTITIONING AROUND MEDOIDS Model Page Data 90 This dialog performs partitioning around medoids See chapter 18 in the Guide to Statistics for details To perform partitioning around medoids Choose Statistics Cluster Analysis Partitioning Around Medoid
184. raphical displays in a form that makes it easy for you to compare the results of the least squares and robust fits It is not enough for you to use a robust linear model fitting method when you are trying to decide which of several alternative models to use based on alternative sets of predictor variables You also need a robust model selection criterion To this end you may use one of the following three robust model Selection criteria robust F test robust Wald test and robust FPE RFPE criterion 157 CGHPER 12 RES LINAR REGEN COMPUTING LEAST SQUARES AND ROBUST FITS Computing a The S PLUS data frame oi 1 df contains monthly excess returns on the stocks of Oil City Petroleum Inc from April 1979 to December 1989 and Least Squares the monthly excess returns of the market of the same period Returns are Fit defined as the relative change in the price of the stock over a onemonth interval and excess means relative to the monthly return at the risk free rate of a 90 day U S Treasury bill T he scatter plot of the data is shown in Figure 1 O bviously there is one big outlier in the data oil robust oills i ats RS Oil City Returns Po Lge weeds Ree Cup Market Returns Figure 12 1 LS Fit and Robust Fit of oi df Financial economists usually use LS to fit a straight line to a particular stock 158 COMPUTING LEAST SARS AND ROBEY ATS return and the market return and the est
185. rd error Empirical Percentiles Check this to print empirical percentiles for the statistic under consideration BCa Percentiles Check this to print BCa percentiles for the statistic under consideration Note that BCa percentiles are generally more accurate than empirical percentiles 79 CAPIRR7 BMN MHIS Correlation Matrix of Estimates Check this to print the correlation matrix for the estimates N ote that this is only relevant if the statistic under consideration is a vector such as a vector of regression coefficients Percentile Percentile Levels Options a Specify a vector of percentile levels at which to evaluate the empirical or BCa percentiles Bootstrap Inference Of x Model Options Results Plot Jack After Boot Plots IV Distribution of Replicates T Normal Quantile Quantile Cancel Apply current Figure 7 4 The Bootstrap Inference dialog Plot page Plot Page Plots Distribution of Replicates Check this to plot the distribution of the replicates for each statistic of interest 80 BOIR INANE Normal Quantile Quantile Check this to plot a Normal quantile quantile plot for each statistic of interest Bootstrap Inference Of x Model Options Results Plot Jack After Boot m Jackknife After Bootstrap Plots Functional mean v T Influence Plot Results Tl Print Results Save In E Cancel Apply d cur
186. re observed 117 CAPIR 10 TE III SMO SARS ANDADLSED MAB Multiple Comparisons 118 gt model tables Baking aov type adj means Tables of adjusted means Grand mean 6 633281 se 0 084599 N 26 000000 Flour 1 2 3 4 7 3020 5 7073 6 9815 6 5423 se 0 1995 0 1467 0 1621 0 1785 rep 5 0000 8 0000 7 0000 6 0000 Fat l 2 3 5 8502 6 5771 7 4725 se 0 1365 0 1477 0 1565 rep 9 0000 9 0000 8 0000 Surfactant 1 2 3 6 3960 6 5999 6 9039 se 0 1502 0 1432 0 1473 rep 8 0000 9 0000 9 0000 Fat Surfactant Dim 1 Fat Dim 2 Surfactant 1 2 3 1 5 5364 5 8913 6 1229 se 0 2404 0 2392 0 2414 rep 3 0000 3 0000 3 0000 2 7 0229 6 7085 6 0000 se 0 2414 0 3006 0 2034 rep 3 0000 2 0000 4 0000 3 6 6286 7 2000 8 5889 se 0 3007 0 2034 0 3001 rep 2 0000 4 0000 2 0000 The F statistic for the Fat x Surfactant interaction in the Type III ANOVA table is significant so the tests for the marginal means for Fat and Surfactant have little meaning We can however use mul ti comp to find all pairwise comparisons of the mean Fat levels for each level of Surfactant and those for Surfactant for each level of Fat gt mul ticomp Baking aov focus Fat adjust list Surfactant seq 3 95 simultaneous confidence intervals for specified linear combinations 312117 critical response variable point Flour by the Sidak method intervals excluding 0 are flagged by Estimate Std Error Lower Bound Upper Bound 0 3
187. relationships with the independent variables will be fitted and compared Visual comparison and statistical tests are then used to determine the most appropriate model Given that amodel has been obtained the results may be extrapolated to new values for the independent variables and inference procedures may be used to obtain interval estimates for failure probabilities or quantiles of the response In doing this the usual precautions apply one should not try to extrapolate model information to far beyond the values collected in the data Moreover because the interval estimate procedures are asymptotic the confidence levels should be treated as approximate especially in small INIROUCTION samples In this chapter we discuss a set of functions for the analysis of censored and or truncated data or more specifically for the analysis of accelerated failure time and survival data These functions are based upon estimation code originally developed by M eeker and Duke 1981 and refined subsequently by W Q M eker personal communication T his estimation code has been modified slightly for inclusion in the S PLUS product The S PLUS code which calls the underlying estimation routines borrows from work done by both W Q Meeker and Terry T herneau Taken as a whole these functions allow you to easily specify and fit censored data models and to graph and compare the fitted models with appropriate non parametric estimates of these models
188. rence for LS vs Robust Fits ROBUST MODEL SELECTION Robust F and Wald T ests Robust FPE Criterion CONTROLLING OPTIONS FOR ROBUST REGRESSION Efficiency at Gaussian M odel Alternative Loss Function Confidence Level of Bias T est Resampling Algorithms Random Resampling Parameters Genetic Algorithm Parameters THEORETICAL DETAILS Initial Estimate D etails Optimal and Bisquare Rho and Psi Functions vi 139 140 140 143 146 152 153 155 155 156 157 157 158 158 159 160 161 161 163 166 166 166 168 170 170 171 173 173 173 175 177 178 179 179 180 The Efficient Bias Robust Estimate Efficiency Control Robust R Squared Robust D eviance Robust F T est Robust W ald T est Robust FPE RFPE Appendix ROBUST MM REGRESSION BIBLIOGRAPHY Chapter 13 Parametric Regression For Censored Data Introduction The Generalized K aplan M eier Estimate Specifying Interval C ensored D ata Computing K aplan M eier Estimates censorR eg An Example M ode Specifying the Parametric Family Accounting for C ovariates Truncation D istributions T hreshold Parameter O ffsets Fixing parameters Fitting Models ANOVA Fitting M odes The plot method for C ensorReg Computing Probabilities and Q uantiles Parametric Survival M odel Page O ptions Page Results Page Plots Page Predict Page Chapter 14 New GUI Toolkit Functions guiSetO ption guiG etO ption guiPrintC lass guiPlot 181 181 181 183 183 183 183 184 186
189. rent Figure 7 5 The Bootstrap Inference dialog Jack After Boot page Jackknife Jackknife after bootstrap is a technique applied to the results of a bootstrap After analysis which is used to get estimates of variability and influence for some functional of the distribution of bootstrap replicates It is useful for Bootstrap determining which observations most influence the bootstrap results and for Jack After getting estimates of standard error for bootstrap statistics Boot Page Jackknife After Functional Bootstra p Specify the functional to apply to the distribution of replicates This may be M ean Bias SE or the name of a function such as max 81 Results Plots Print Results Check this to print the jackknife after bootstrap summaries Save In Enter the name for the object in which to save the jackknife after bootstrap results If an object with this name already exists its contents will be overwritten Influence Plot Check this to plot a jackknife after bootstrap influence plot indicating the degree of influence of each observation on the bootstrap results Related programming language functions bootstrap jack after bootstrap 82 JACKKNIFE INFERENCE This dialog performs jackknife inference for a specified statistic and data frame See chapter 30 in the Guide to Statistics for details To perform jackknife inference Choose Statistics Resample Jackknife from the main menu T
190. return 1 takes up 1 column in dialog BOOL CMyOCXCtrl SPlusOnInitializeControl const VARIANT FAR amp vInitial Value ACINEX CHIROSIN SR1s DAGS CString sInitialValue sInitialValue Empty if GetStringFromVariant sInitial Value vInitialValue InitialValue Set properties here return TRUE These three methods should be implemented in the control class of any ActiveX control supporting S PLUS dialogs fully The first two methods support dialog layout while the third supports setting values for the control from S PLUS The value returned by Get SPlusDialogVerticalSize should be along number representing the number of lines the control takes up in an S PLUS dialog A line is the size of an String edit field property in an S PLUS dialog The value returned by Get SPlusDialogHorizontalSize should be either 1 or 2 Returning means that this control takes up only one column in an S PLUS dialog Returning 2 means the control takes up two columns A column in an S PLUS di alog is the width of a single String property field There are at most two columns in an S PLUS dialog In the example above the MyOCX control takes up three lines and only one column in an S PLUS dialog SPlusOnInitializeControl is called when the control is first enabled in the S PLUS dialog and every time the property that this control corresponds to in S PLUS is changed It receives a variant representing the initia
191. ric or character naming some factors columns in the design which shouldn t be scrambled Save As Enter the name for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten Show in Data Window Check this box to display the new design in a D ata W indow Related programming language functions oa design randomize 63 CAPIR6 MNPUAINGDYA RECODE This dialog recodes all occurrences of a specific value in specified columns to a specified new value To recode a value Choose Data Recode from the main menu The dialog shown below appears Recode Iof x Data Values Data Frame Current Value Columns X New Value Cancel Apply current Help Figure 6 4 The Recode dialog Data Values 64 Data Frame Select or enter the name of the data frame containing the columns to be recoded Columns Select the columns to recode Current Value Value to be changed If the column being recoded is a factor then this will be coerced to a character string New Value New value used to replace all occurrences of the Current Value in the specified columns SUT DYABY GOP SPLIT DATA BY GROUP This dialog splits a data frame into multiple new data frames based on the values of a splitting variable To split a data frame Choose D ata Split from the main menu T he dialog shown below appears Split
192. roups 3 11 you will need to have version 1 30 172 or higher of the Win32s subsystem on your machine before you can install S PLUS W in32s is included in the Win32s directory on the CD ROM and may be installed by running setup exe in the Win32s disk1 directory Be sure to install W in32s before installing S PLUS Note 10 Installing and running S PLUS under Win32s will require approximately 50M B of combined RAM and swap file space If you encounter the message S_apiSyncC onnect Failure several times during sart up try increasing the swap file size to 40M B in the virtual memory settings accessed through the 386 Enhanced icon in the control panel SSEVIRAUREMENS Network T his version of S PLUS may not be installed on a network server If you want Installation to run S PLUS on a network server contact your sales representative for a network license System e Minimum platform configuration Pentium processor with 32M B of Requirements memory H ard disk space required 61M B Typical installation 128M B Full installation Add 5M B for Adobe Acrobat Reader and 6M B for ODBC 8MB for ODBC for Win32s M icrosoft Windows 95 WindowsNT or Windows 3 1x VGA Super VGA or most other Windows compatible graphics cards and monitors OneCD ROM drive local or networked M icrosoft M ouse or other Windows compatible pointing device Windows compatible printers are supported 11 CAPR 1 WAGE OSAL
193. rovements to the graphical user interface introduced in S PLus 4 0 and many new statistical features S PLus Version 4 5 offers you unparalleled power and flexibility to create innovative cutting edge analyses In S PLUS data can beimported from virtually any source and can be viewed and edited in the D ata window Point and click control over the details of your graphics makes it easy to produce stunning publication quality output Whether your task is simple or complex S PLUS can lead you to more insightful analysis and new discoveries S PLus is the premier solution for exploratory data analysis and statistical data mining At the core of S PLUS is the S language developed at Lucent Technologies It isthe only language created specifically for data visualization and exploration statistical modeling and programming with data S provides arich object oriented environment designed for interactive data discovery As the exclusive licensee of the S language M athSoft has molded the S technology into the most powerful data analysis product available today T he S PLUS object oriented environment delivers benefits that traditional language analysis programs simply cant match With S PLUS every data set function or analysis model is treated as an object which makes it easy to examine and visually explore data run functions one step at a time and visually compare models for fit S PLUS gives you immediate feedback because it runs function
194. rses designed to quickly make you efficient and effective at analyzing data with S PLUS T he courses 13 CAPIR1 WAGE OSAL S Press Technical Support Books on Data Analysis Using S PLus 14 are taught by professional statisticians and leaders in statistical fields Courses feature a hands on approach to learning dividing class time between lecture and online exercises All participants receive the educational materials used in the course including lecture notes supplementary materials and exercise data on diskette S Press is a free quarterly newsletter about S PLUS mailed to primary users of S PLUS S Press features stories by S PLUS users in industry and academia a technical support column and provides new product announcements and other information from M athSoft In North America to contact technical support call 206 283 8802 ext 235 or fax to 206 283 6310 or send e mail to support statsci com In Europe Asia Australia Africa and South America call 44 1276 452299 or fax to 44 1276 451224 or email to shelp mathsoft co uk General Becker R A Chambers J M and Wilks A R 1988 The New S Language Wadsworth amp Brooks Cole Pacific Grove CA Spector P 1994 An Introduction to S and S PLUS Duxbury Press Belmont CA Data Analysis Bruce A and Gao H Y 1996 Applied Wavde Analyss with S PLUS Springer Verlag N ew York Chambers J M and Hastie T J 19
195. rts This plot is provided primarily for distribution assessment It s quite clear from figure 13 4 that anon logged distribution does not fit the data well Exactly which logged distribution fits best is not so clear For more information on this plot function see the help filefor probpl ot6 censorReg As mentioned above the three plotting functions probpl ot censorReg stressplot censorReg and probpl ot6 censorReg are called by the plot method for a censorReg object T hese functions however were designed to be called directly and provide more capabilities than are available through the general plot method One primary example of this is the method argument to each of these plotting functions which allows the ATTING MOS THE AA MEIH DAR GENRE plotted points to be computed based upon some alternative model This S5 weibull wr extreme 74 a ad exe x ee 4 x patt Ik eo eset 3 RX a 4 peret 34 tH ge E ee i tae a Bow Does a eK wee a Log ag A a i m3 3 OE Seer di ae 4 sate i oa EO pra SA Ta s bo 4 e ii 0005 4 pone 0002 3 00005 4 T 5 10 50 160 6 50 160 150 200 250 360 Failure Time Failure Time 999 lognormal normal 995 98 Pe as x 2 _ aa 3 we xx x mma B Fz x aoe 4 FF ee ae 55 i se 83 Boe nett patt pete xa wom a ath ee aa od as X eet m areal a a Byer ee ee 0s 7T f 00005 pat T 5 10 50 100 6 50 160 180 260 250 360 Failure Time Failure Tim
196. s alpha Pr reject N ull hypothesis if true power Pr reject N ull hypothesis if false You can select multiple values using the CTRL key or you can type in values separated by commas If computing power or minimum difference samples sizes are input here For two sample tests any two of N1 N2 N2 N1 will designate the third In most cases it is natural to think in terms of N 1 and N 2 N 1 For a onesample test the proportion is required with a default value of 0 50 For a two sample test Group1 Proportion is asked for For aonesample test the alternative proportion is needed for a two sample test Group2 Proportion is requested Test Type If the alternative hypothesis is one of inequality the test type is two sided O ther choices are greater and less Save As To save the resulting table as an S PLUS object type the name for the object here Print Results If this box is checked the output will be printed to the Report window The Options page is shown below 135 CAPRI POWRRANDSMAE SE Binomial Power and Sample Size Of x Model Options Printout l Recompute Power T Exact N After rounding N recompute power Don t round up sample size IV Interactive M Expand Input Write results back to dialog window Produces cross product of input M Continuity Correction T Cancel Apply current Figure 11 5 TheBinomial Power and Sample Size dialog O ptions page
197. s from the main menu T he dialog shown below appears Partitioning Around Medoids Model Results Plot Data Options Data Frame z Number of Clusters 2 IT Data is Dissimilarities I Use Large Data Algorithm m Dissimilarity Measure Number of Samplesf5 Metric euclidean IREO I Standardize Variables Result Save As flast cluster MV Save Data IV Save Dissimilarities Cancel Apply d current Help Data Frame Specify a data frame ora dissimilarity object To use a subset of rows or columns use standard S PLU S subscripting of the data frame Note that all columns of the data frame must be numeric If non numeric columns eg factors are present use the Dissimilarities dialog to produce a dissimilarity object and then use this object in clustering The Dissimilarities dialog provides special options for handling factors PARITIONNS AROUND MDOLLA Dissimilarity Measure Options Save Model Object Data is Dissimilarities Check this if Data Framenamesadissi mil arity object Metric Select the metric to be used for calculating dissimilarities between objects The available options are euclidean and manhattan Euclidean distances are root sum of squares of differences and manhattan distances are the sum of absolute differences If Data Frame is already a dissimilarity matrix then this argument will be ignored Standardize Vari
198. s 25 ExecuteStringResult 251 Extract Panel 21 Extract Panel Redraw Graph 21 F Factorial Design dialog 60 Design Structure 60 Names 61 Randomization 61 Results 61 fanny 97 formula 236 Fuzzy Partitioning 94 Fuzzy Partitioning dialog M odel Page 94 Plot Page 97 Results Page 96 294 G G etP arameterC lasses 252 GetSAPIO bject 252 Graph O ptions dialog 20 Graph T ools Palette 20 Graphs dialog Interactive page 24 guiExecuteBuiltIn function 241 guiG etAxisL abelsN ame function 242 guiG etAxisN ame function 242 guiG etAxisT itleN ame function 242 guiG etG raphN ame function 242 guiG etG SN ame function 242 guiG etO ption function 237 guiG etPlotC lass function 243 guiG etPropertyO ptions function 241 guiG etRowSelectionExpr function 238 guiG etRowSelections function 238 guiPlot function 240 guiPrintC lass function 239 guiR enoveC ontents function 244 guiSetO ption function 237 guiSetR owSelections function 237 H H eight M ultiplier 24 H elp system On line Demos 12 on linehelp 12 On Line M anuals 12 training courses 13 html table function 112 Include All Points 25 Installation Excel Add In 34 SPSS Add In 44 installing the software 10 INEX J Jackknife Inference dialog 83 M odel page 83 O ptions page 84 Plot page 86 Results page 85 K kmeans 89 K M eans Clustering 88 K M eans Clustering dialog M odel Page 88 Results Page 89 L Label Point 20 Least Squares vs Robust Fitted M
199. s baked from dough mixed from each of nine Fat and Surfactant treatment combinations is measured The experimenters blocked on four flour types Ten loaves had to be removed from the experiment but at least one loaf existed for each Fat x Surfactant combination and all marginal means are estimable so the Type Il hypotheses are testable T he over parameterized mode is Hik UD fj 5 S x gt 115 CAPIR 10 TE III SMO SUARSANDADLSED MAB ANOVA Tables 116 for i 1 4 j 1 2 3 and k 1 2 3 Because the data are unbalanced the Type ILI sum of squares for Flour Fat and Surfactant test a more useful hypothesis than the Type Specifically the Type III hypotheses are that the marginal means are equal H Flour H1 H2 M3 U4 H pa Ua H H H surfactant Hy Hi M3 gt where i p DI 3 3 i k Mik 4 3 D Hn ai 4 Jj H k T he hypotheses tested by the Type sum of squares are not easily interpreted since they are dependent on the order each term is specified the formula and involve the cell replications which can be viewed as random variables when there are random drop outs M oreover the hypothesis tested by the blocking term Flour involves parameters of the Fat Flour and Fat x Flour terms The ANOVA tables for both Type and Type III sum of squares are given below for comparison Using the Type III sum of squares we see that the block effect Flour is significant as
200. s box to omit from the analysis any rows in the data frame that contain missing values for any of the variables in the modal If this box is not checked S PLUS will report an error and halt the routine if any row is found to have a missing value in any of the terms in the modal Formula Enter a formula specifying the desired model PARAVEIRCS ANA Model Truncation Save Model Object Examples censor days event voltage Create Formula Click this to open a formula builder dialog used to construct a formula specifying the desired model See the chapter on Building Formulas for more information Distribution Select the assumed distribution for the transformed response variable Type of Censoring Specify the type of censoring right left counting interval Formula Enter a formula specifying the truncation model Examples censor days event Create Formula Click this to open a formula builder dialog used to construct a formula specifying the truncation model See the chapter on Building Formulas for more information Save As Enter thename for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten This must be a valid S PLUS object name any combination of alphanumeric characters that starts with an alpha character is allowed T he only non alphanumeric character allowed is the period Names are case sensitive so X a
201. s one at atime With S PLUS you ve got control over every step of your analysis Visually CAPIR1 WAGE OSAL Installation compare different models for fit reexplore your data for outliers or other factors that might influence a result and document every analysis function Because S PLUS puts you in control you ll have complete confidence in the quality of your results Now even more standard analysis functions are conveniently available through menus toolbars and dialogs putting powerful S PLUs techniques at your fingertips With point and click ease you can import your data select your statistical functions and display your results As always when your analysis requires a new method or approach you can modify existing methods or develop new ones with the programming language By tapping into the power flexibility and extensibility of S PLUS you can take your analysis to a new level To install the software 1 Insert the CD ROM into yourCD ROM drive 2 If your operating system supports AutoPlay eg Windows 95 or NT 4 0 installation will proceed automatically If not run setup exe in the root directory of the CD ROM Use the default settings for installation It is a good idea to turn off other applications in particular virus checkers while installing S PLUS because of known problems with the installation software InstallShield If you are running a 16 bit operating system such as Windows 3 1 or Windows for Workg
202. s section 1 AFX_ODL_PROP CMyOCXCtrl AFX_ODL_PROP Add the following lines at the end of this section define SPLUSOCX_PROPERTIES include SPlusOCX idl undef SPLUSOCX_PROPERTIES The section should now appear as follows dispinterface DMyOCX properties NOTE ClassWizard will maintain property information here _ Use extreme caution when editing this section AFX_ODL_PROP CMyOCXCtrl AFX_ODL_PROP define SPLUSOCX_PROPERTIES include SPlusOCX idl undef SPLUSOCX_PROPERTIES 275 CFPIR 16 DACGCNIROSINSALS 45 276 methods NOTE ClassWizard will maintain method information here _ Use extreme caution when editing this section AFX_ODL_METHOD CMyOCXCtrl AFX_ODL_METHOD id DISPID_ABOUTBOX void AboutBox j Now add the following lines at the end of the methods section just below the properties section you just modified define SPLUSOCX_METHODS include SPlusOCX idl undef SPLUSOCX_METHODS This whole section should now appear as follows dispinterface _DMyOCX properties NOTE ClassWizard will maintain property information here Use extreme caution when editing this section IH AFX_ODL_PROP CMyOCXCtrl 1 AFX_ODL_PROP define SPLUSOCX_PROPERTIES include SPlusOCX idl undef SPLUSOCX_PROPERTIES methods NOTE ClassWizard will maintain method information here Use extreme caution when editing this section
203. s type and computed in this special way as an M M estimate a term introduced by Yohai 1987 S PLUS also provides for an automatic choice between the initial and final estimates based on evaluating the potential bias of the final estimate You will compute a robust regression fit using the mRobMM function The resulting robustly fitted model object is almost identical in structure to a least squares fitted model object returned by I m i e you will get most of the same fitted model components such as coefficient standard errors and t statistics etc 1 The theory for this new robust method is based on Rousseeuw and Yohai 1984 Yohai Stahel and Zamar 1991 and Yohai and Zamar 1998 The code is based on the ROBETH library of Alfio Marazzi with addi tional work by R Douglas Martin Douglas B Clarkson and Jeffrey Wang of MathSoft partially supported by an SBIR Phase I grant entitled Usable Robust Methods funded by the National Institutes of Health ORBENO TH RRS REGRESSION MHD Comparison of Least Squares and Robust Fits Robust Model Selection In order to facilitate comparison of least squares and robust fits of a linear regression model you use a special function to create an object with the relevant information from the least squares and robust fits e g t statistics residuals etc You then use this object as arguments to the usual S PLUS printing summarizing and plotting functions to get tabular and g
204. sdl 10 mean null sdl mean alt delta alpha power nl 1 100 10 105 5 0 05 0 6087795 20 2 100 10 105 5 0 05 0 8853791 40 3 100 10 105 5 0 05 0 9721272 60 4 100 10 105 5 0 05 0 9940005 80 5 100 10 105 5 0 05 0 9988173 100 142 NORMALLY DSRBUIED DSA Comparing Means From Two Samples lower tail test minimum detectable difference gt summary normal sample size mean 100 sd1 10 nl 1 5 20 power 9 alt I mean alt delta power nl 1 93 45636 6 543641 0 9 20 2 95 37295 4 627053 0 9 40 3 96 22203 3 777973 0 9 60 4 96 72818 3 271821 0 9 80 5 97 07359 2 926405 0 9 100 See the online help files for normal sample size and summary power table for more details Extending this formula to two sampled tests is relatively easy Given two independent samples from normal distributions X i N M o i 1 0 X i N M 93 j Lee My where n kn we ll construct a two sided test of equality of means Ay Wy Wy H Wy FU which is more conveniently written H u4 0 H Uo u 0 143 CAPRI POWRRANDSMAE SE T he difference of the sample means is normally distributed X1 N Sig 2 X2 X1 Cad 2 1 07 outer E which leads to the test statistic X2 X 2 2 Koj 07 1 2 ny Ny Derivation of the two sample formulas proceed along the same lines as the one sample case producing the following formulas Z 2 z2 ONZ _ a2 ZPower MO Og ae e ee H2 H
205. similarity Measure Options Result Data is Dissimilarities Check thisif Data Framenamesadi ssi mil arity object Metric Select the metric to be used for calculating dissimilarities between objects The available options are euclidean and manhattan Euclidean distances are root sum of squares of differences and manhattan distances are the sum of absolute differences If Data Frame is already a dissimilarity matrix then this argument will be ignored Standardize Variables Check this to standardize each data column by subtracting the variable s mean value and dividing by the variable s mean absolute deviation If D ata Frame is already a dissimilarity matrix then this argument will be ignored Linkage Type Specify the linkage type The three methods implemented are average complete single ward and weighted linkage Save As Enter thename for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten Save Data Check this box to store a copy of the datain the model object Save Dissimilarities Check this box to store a copy of the dissimilarities in the model object 99 CAPIR8 CLBIERNGINSRLS Agglomerative Hierarchical Clustering Of x Model Results Plot r Printed Results Saved Results Output Type None Save In sz Short I Cluster Membership Number of Clusters 2 Cancel Apply i
206. soring fright Subset Rows with o Truncation IV Omit Rows with Missing Values Formula Threshold Parameter _Eteate Formula Methods Value mi Save Model Object Value fo Save As flast censoneg Formula Formula Create Formula Cancel Apply d current Figure 13 6 The Parametric Survival dialog M odd page 227 CAPIRR 13 PARAMEIRC REGRESSION FOR END DIA Model Page Data Data Frame Select a data frame PTip Formula 228 You can type into the D ata Frame edit box any expression which evaluates to a data frame Weights Enter the column that specifies weights to be applied to all observations used in the regression To weight all rows equally leave this blank Subset Rows with Enter an S PLUS expression which identifies the rows to use in the analysis To use all the rows in the data frame leave this field blank The expression must evaluate to a vector of logical values TRUE values are used FALSE values are dropped or a vector of indices identifying the numbers of the rows to use Examples species Bear only Bears are used voltage 20 all voltages are used except 20 1 20 only the first 20 rows of the data are used Age gt 13 amp Age lt 20 only teenagers are used For more information on constructing logical expressions see the S PLUS Programme s Guide Omit Rows with Missing Values Check thi
207. sponse explained by model 0 05261 Test for Bias Statistics P value M estimate 2 16 0 3398475 LS estimate 22 39 0 0000138 Correlation of Coefficients Intercept Market 0 8169 The seed parameter is 1313 First note the standard errors the t values and the p values of the coefficients The standard errors are computed from the robust covariance matrix of the estimates For technical details about the computation of robust covariance matrix refer to Yohai Stahel and Zamar 1991 Second the summar y method provides another piece of useful information the Proportion of variation in response explained by model usually known as R2 S PLUS calculates a robust version of R2 The details of how the robust R2 is calculated can be found in the section Theoretical D etails of the Robust Regression M ethod Finally there is a Test for Bias section in the summary This section provides the test statistics of the bias of the final M estimates and the LS estimates against the initial S estimates In this case the test for bias of the final M estimates yields a p value of 0 33 which suggests that the bias of the final M estimates relative to the initial S estimates is not significant at the usual level T hat is why the Final M estimates is reported in the first line of its summary output instead of the initial S estimates T he test for bias of the VAIZNG AND S MMARANGS THE RBS AT LS estimates relative to t
208. t Robust Wald Test Robust FPE RFPE For an M estimate the deviance is defined as the optimal value of the objective function on the o scale that is 40 Initial S Estimator B a2 40 a0 2 D s B s al Final M Esimator B 2 iy p 2 6 Sof 2 S See chapter 7 of H ampel Ronchetti Rousseeuw and Stahel 1986 where this test is referred to as the tau test See chapter 7 of H ampel Ronchetti Rousseeuw and Stahel 1986 Ronchetti 1985 proposed to generalize the Akaike Information Criterion AIC to robust model selection H owever the results therein are subject to certain restrictions such as they only apply to M estimates with zero breakdown point and the density of the errors has to be in a certain form Yohai 1997 proposed the following RFPE criterion which is not subject to the restrictions that apply to Ronchetti s robust version of AIC E A where 2 A a ev av 2 Since the first term in equation 12 4 can be approximated by 183 CPRD ROA LUNAR AGEN nto 5 PEOR P55 al where r y xb the expression 12 4 can be estimated by n Tah n X RFPE Deo pa 125 S B 1 m with ae a Ti ee fi i ay 5 p PF rag SE a The approximation on the right hand side of 12 5 is used as our RFPE Appendix The function gen data used in the section Robust M ode Sdection is as follows gt gen data lt function coeff n 100 eps 0 1 sig
209. t is generally useful to turn on bookmarks under the View entry of the menu bar rather than rely on the contents at the start of the guides Bookmarks are always visible and can be expanded to include section headings or collapsed to show just chapter titles Online Demo TheS PLus Online D emos help users of all levels familiarize themselves with the new features of S PLUS Take a look at the user interface learn more about common S PLUS tasks or show a colleague the various capabilities of S PLUS Guided Tours of The S PLUS Usa s Guide contains a tutorial and many chapters have SPLus examples of using S PLUS T hese examples extend the techniques illustrated in the online demos 12 HAP SUPPORT ANDLEAANNG EARE Add On Modules StatLib S News Training Courses Add on modules that offer analytical functionality beyond that of the base S PLUS product include S D OX helps in designing and analyzing industrial experiments especially fractional factorial experiments response surface experiments and robust design experiments S GARCH provides an essential suite of tools designed for univariate and multivariateG ARCH modeling of financial time series data S SPATIALSTATS provides a comprehensive set of tools for statistical analysis of spatial data including tools for hexagonal binning variogram estimation and kriging autoregressive and moving average modeling and testing for spatial randomness S WAVELETS o
210. t to Conditioned and the Subset Rows expressions for all plots will be set to ALL Alternatively choose Show All Panels from the graph Sheet Format menu m No Conditioning Use this button to set the Panel Type for a graph to None All plots will be within a single plot area 4 Panel Conditioning Use this button to set the Panel Type for a graph to Conditioned and to set the number of panels used for continuous data to 4 If no conditioning data has been specified no panels will be drawn 9 Panel Conditioning Use this button to set the Panel Type for a graph to Conditioned and to set the number of panels used for continuous data to 9 If no conditioning data has been specified no panels will be drawn Plots in Separate Panels If you are plotting more than one set of data series on a graph use this button to have each plot drawn in a separate panel T he Panel Type for the graph will be set to By Plot T he axes scaling for the X and Y axes will be the same for each panel Separate Panels with Varying Y Axes If you are plotting more than one set of data series on a graph use this button to have each plot drawn in a separate panel T he Panel Type for the graph will be set to By Plot The axes scaling for the X axis will be the same for each panel but the Y axis ranges will vary according to the data in each panel The Number of Columns for the panels is set to Auto which defaults to 1 so that the panels will appear o
211. t variable you must give both the time of failure or censoring and except in exact failure or complete data the censoring code The S PLUS function censor is used to specify the dependent variable For the data in the Table above you must tell the censor function the data type Here the correct specification is gt censor failure upper censor codes 1 7 4 5 9 3 L 2 7e 12 8 4 11 W hen three arguments are specified to censor the default censoring type is interval To show the generality of the censor function an alternate way of specifying the censor codes is by using the Censor column and stating explicitly what the codes are for each of right left event and interval gt cens lt censor failure upper Censor event exact right right left left interval interval 1 7 4 5 9 3 E 2 Ol 7 12 8 4 11 W hile thisis more lengthy in this case it is far more general allowing the user to specify a vector of codes for each of the four censoring types event right left and interval It is always a good idea to display the output from thecensor function to verify that you are correctly specifying the censoring information This is especially important because it is common practice to reverse the censoring codes for failure and right censoring and these values must be correctly specified if the analysis results are to be meaningful An additional check you can do is to examine
212. te Highlighting selected data points Excluding or Including Only Selected Points in Your Plot Color Scale Legends U sage Properties Chapter 3 S PLus Excel Add In Installing the S PLU S Excel Add In Installation during S PLU S setup M anual installation Removing the S PLUS Excel Add in Using the S PLUS Excel Add In Selecting data for S PLUS graphs Chapter 4 S PLus SPSS Add In Installing the S PLUS SPSS Add In Installation during S PLU S setup M anual installation Removing the S PLUS SPSS Add in Using the S PLUS SPSS Add In Selecting data for S PLU S graphs Selecting data for conditioning S PLUS graphs H andling errors during graph creation CNENS Chapter 5 File Improvements New Input O utput Features Loading Libraries Loading M odules Chapter 6 Manipulating Data Select D ata Factorial Design Orthogonal Array Design Recode Split D ata By Group Stack Columns Subset Transform Transpose Set D imensions Chapter 7 Resampling Methods Bootstrap Inference M odel Page Options Page Results Page Plot Page Jackknife After Bootstrap J ack After Boot Page Jackknife Inference M odel Page Options Page Results Page Plot Page Chapter 8 Clustering In S PLus K M eans Clustering M odel Page Results Page Partitioning Around M edoids M odel Page Results Page Plot Page Fuzzy Partitioning M odel Page Results Page Plot Page Agglomerative H ierarchical Clustering M odel Page Results Page Plot Page Divisi
213. that support S PLus As mentioned earlier examples of ActiveX controls which implement support for S PLUS are provided on disk in the SAMPLES OCX directory beneath the pro gram directory One of the examples in this directory is called MyOCX and it is a C project in Microsoft Visual C 4 1 using MFC There is also an example S PLUS script in MyOCX which shows how to use this ActiveX control in an S PLUS dialog This example will be used here to show how to implement ActiveX controls for S PLUS If you would rather skip this section and simply study the changes in the source files for MyOCX all changes are marked in the source files with the step number as listed below that the change corresponds to Just search for the string S PLUS Dialog change STEP in all the files of the MyOCX project to find these modifications Version 4 0 or higher of Microsoft Visual C is used to demonstrate ActiveX control creation Higher versions can also be used to create controls for S PLUS but the dialogs and screens shown may be different 1 Create the basic control The first step to designing an ActiveX control in MFC should be to use the OLE ControlWizard that is part of the Developer Studio Select New from the File menu in Developer Studio and then choose Project Workspace to start a new project OK Project Workspace Cancel Resource Script Resource Template Help Binary File Bitmap File Icon File Cursor Fi
214. the dialog control type to OCX String from the Dialog Control drop down list W hen this is done the C ontrol Progld and C ontrolServerPathN ame fields become enabled allowing to you enter the PROGID of the Activex control and its location on disk respectively The C ontrolServerPathN ame value is used to autoregister the control if necessary before using the control If you are editing or creating a property using the object browser the ACINEX CHIROSIN SRLS DAGS Where can the PROGID for the control be found Property object dialog for the property you are editing allows you to set the dialog control type to OCX String from the Dialog Control drop down list When this is done the Control Progld field becomes enabled allowing to you enter the PRO GID of the ActiveX control W hen you add an ActiveX control to an S PLUS dialog you need to specify its PROGID as mentioned above The PROGID isa string which uniquely identifies this control on your systen If you create controls using the ControlW izard in D eveloper Studio as part of M icrosoft Visual C 4 0 or higher a default value for the PROGID is created by the ControlW izard during control creation that is based on the name of the project you use For example if your ControlWizard project name is MyOCX then the PROGID that is generated is MYOCX MyOCXCtrl 1 The pattern here is Project name C ontrol class name witho
215. the censor codes map as follows gt censorCodesMap cens event exact gt 1 right right gt 2 left left gt 3 interval interval gt 4 203 CAPIRR 13 PARAMETRC REGRESSION FOR END DA Computing Kaplan Meier Estimates 204 Theinternal codes 1 2 3 and 4 are used by the estimation routine O ne other specification to censor allows you to useit with other routines that require internal codes of 1 event 0 right 2 left and 3 interval i e coxph survreg andsurvfit Setting theoutCodes argument to 0 3 results in the internal codes those routines require gt cens lt censor failure upper left left event exact outCodes 0 3 gt censorCodesMap cens Censor right right interval interval event exact gt 1 right right gt 0 left left gt 2 interval interval gt 3 The kapl anMei er function is used to compute Kaplan Meier estimates and Turnbull s generalization of the Kaplan Meier estimates For the data in the Table above the S PLUS statements are gt kaplanMeier censor failure data int data upper censor codes 1 This results in output Number Observed 9 Number Censored 6 Confidence Type identity Survival Std Err 95 LCL 95 UCL Inf 2 1 000 0 000 1 000 1 000 3 4 0 861 0 127 0 646 1 000 4 5 0 583 0 173 0 386 0 781 5 7 0 444 0 166 0 300 0 589 9 H 0 444 0 166 0 300 0 589 12 Inf 0 000 0 000 0 000 0
216. the desired number of rows If this value is less than the current number of rows in the data frame it will be ignored Columns Specify the desired number of columns If this value is less than the current number of columns in the data frame it will be ignored Related programming language functions dim ST DMOS RESAMPLING METHODS Bootstrap Inference Model Page Options Page Results Page Plot Page Jackknife After Bootstrap Jack After Boot Page Jackknife Inference Model Page Options Page Results Page Plot Page 76 76 78 79 80 81 83 83 84 85 86 75 CAPIRR7 BMN MHIS BOOTSTRAP INFERENCE This dialog performs bootstrap inference for a specified statistic and data frame See chapter 30 in the Guide to Statistics for details To perform bootstrap inference Choose Statistics Resample Bootstrap from the main menu The dialog shown below will appear Model Options Results Plot Jack After Boot Data Save Model Object Data Frame SDF1 Ee Save s flastbootstrap l Save Resampling Indices Statistic to Estimate Expression Cancel Apply current Figure 7 1 T he Bootstrap Inference dialog M oda page Model Page Data Data Frame Specify the data to bootstrap T his may bea vector matrix or data frame 76 BOIR INANE Statistic to Estimate Save Model Object Expression Specify the expression describing the statistic to be b
217. the mean is required with a default value of 0 For a two sample test M ean1 is asked for For aone sample test the alternative mean is needed for a two sample test M ean is requested Test Type If the alternative hypothesis is one of inequality the test type is two sided O ther choices are greater and less Save As To save the resulting table as an S PLUS object type the name for the object here 129 CPR POWERRAXIDSMAE SE Print Results If this box is checked the output will be printed to the Report window Options Page The Options page is shown below Normal Power and Sample Size Figure 11 2 TheNormal Powe and Sample Size dialog O ptions page 130 NAML POWER AND SMAE SE Recompute Power Exact N Interactive Expand Input Printout Page By default sample sizes are rounded up to the next integer value Checking this option causes the power to be recomputed for the rounded sample size value Checking this results in the exact value of N being returned with no rounding With this option checked the results of the computations are written back to the dialog T his causes the input to be expanded into a table where all combinations of input are used For example if you input two different powers and three alternative means the resulting table will have six rows If this option is unchecked the above example will produce a table with three rows
218. them very much 169 CAPIR 22 RAS UGRESS ROBUST MODEL SELECTION Robust F and Wald Tests 170 Another important part of statistical inference is hypothesis testing S PLUS provides two robust tests for testing whether or not some of the regression coefficients are zero the robust Wald test and the robust F test For technical details on how these tests are computed see the Theoretical D etails of the Robust Regression M ethod below Before proceeding you will first create the data frames i mu dat gt simu dat lt gen data 1 3 where the function gen data is provided in the appendix This function generates a data frame with five columns y x1 x2 x3 and x4 The variable y is generated according to the following equation y b xl b x2 b x3 u where b ba b3 is given by 1 3 in the above S PLU S command and u is sampled from a N 0 3 family with 10 contamination The term x4 is independent of y x1 x2 and x3 First you fit a model with x1 x2 x3 and x4 as the predictor variables gt simu mm4 lt mRobMM y x1 x2 x3 x4 1 data si mu dat To test the hypothesis that the coefficient of x4 is actually zero you can fit another model with only x1 x2 and x3 as the predictor variables then use anova to test the significance of the coefficient of x4 gt simu mm3 lt update si mu mm4 x4 gt anova si mu mm4 si mu mm3 Response y Terms Df Wald P gt Wal d 1 xl x2 x3 x
219. tions for Fat can be obtained using the contrasts generated by contr hel mert gt contr hel mert 3 1 2 1 1 1 2 1 1 3 0 2 We will use this set of orthogonal contrasts to test Ha H2 and Ha H2 243 which is equivalent to H fat gt Litypelll lt L contr hel mert 3 gt L typelll pad fy 2d Intercept Flourl Flour2 Flour3 Fatl Fat2 Surfactant Surfactant2 FatlSurfactantl Fat2Surfactantl FatlSurfactant2 Fat2Surfactant2 SoC O GOOLE OCC o Sooo COCO OWWPerPeo 124 Finally the Type lll sum of squares is computed for Fat gt h m lt t contr hel mert 3 mn gt t h m solve t L typelll Baking sum cov unscal ed Li typelll h m 1 dy 10 11785 Since we used the sigma constrained model and the data is complete we can also usedr op1 to obtain the Typell sum of squares gt dropl Baking aov Single term deletions Model Specific Vol Flour Fat Surfactant Df Sum of Sq RSS F Value Pr F lt none gt 2 31586 Flour 3 8 69081 11 00667 17 51280 0 00005181 Fat 2 10 11785 12 43371 30 58263 0 00000778 Surfactant 2 0 99721 3 31307 3 01421 0 08153989 Fat Surfactant 4 5 63876 7 95462 8 52198 0 00105692 For the sigma constrained model the hypotheses H fa and H surfactant Can also be expressed as H rat fi fy 0 x H Surfactant S1 S2 Z S3 0 The row for Fat in the drop1 ANOVA table is the reduction in sum of squar
220. ts Save As f last transpose I Show in Data Window Cancel Apply f current Hep Figure 6 9 The Transpose dialog Data Results Data Frame Specify the data frame to transpose Generally this will be a completely numeric data frame Transposing a data frame containing factors will produce a data frame in which all columns are factors with each unique value in each new column being a factor level Save As Enter the name for the new data frame If an object with this name already exists its contents will be overwritten Show in Data Window Check this box to display the new data frame in a D ata Window Related programming language functions t 73 CAPIR6 MNPUAINGDYA SET DIMENSIONS This dialog sets the number of rows or columns in a data frame matrix or vector Empty cells will be filled with missing values N A s Specifying the extent of the data object before entering data will speed data entry in a Data Window To set the dimensions of a data object Choose Data Set Dimensions from the main menu The dialog shown below appears Set Dimensions Of x Data Data Frame catalyst X Dimensions Rows 8 Columns 4 Cancel Apply d current Help Figure 6 10 The Se Dimensons dialog Data Data Frame Di 74 Specify the data frame T he dimensions of this data frame will be extended to the specified extents mensions Rows Specify
221. ture UseQuote T NAVDAGS CNIROSIN SRLs 45 Define group property for dialog guiCreate Property name PictureGroup type WideGroup DialogPrompt Select Picture PropertyList c GraphToShowEdit Picturel Function info for the function guiCreate Functionlnfo Function PictureFn DialogHeader Picture Control Test PropertyList c ReturnValue PictureGroup ArgumentList c 0 ReturnValue 1 GraphToShowEdit Call backFunction call backPictureFn Display Yes Callback function for this dialog call backPictureFn lt function df if IslnitDialogMessage df AmI called to initialize the properties Set the Picture control to display the Windows metafile referred to by the GraphToShowEdit property sPicturel lt cbhGetCurrValue df GraphToShowEdit df lt cbhSetCurrValue df Picturel sPicturel else if chlsOkMessage df Am I called when the Ok button is pushed else if chlsCancel Message df Am I called when the Cancel button is pushed else if cbhlsAppl yMessage df Am I called when the Apply button is pushed 285 C PIR 16 DACGGCNIROSINSALS 45 286 else Am I called when a property value is updated If the GraphToShowEdit property has been changed then update the Picturel picture control to display this metafile if cbhGetActiveProp df GraphToShowEdit
222. ula specifying the desired model The formula specifies which regression model is to be fit In its simplest form a formula consists of the response variable a tilde and a list of predictor variables separated by s An intercept is automatically included by default For example Fuel Weight Disp fits a regression model with Fuel as the response and Weight and D isp as predictors For more information on formulas see the chapter on Building Formulas Create Formula Click this to open a formula builder dialog used to construct a formula specifying the desired model See the chapter Building Formulas for more information Save As Enter thename for the object in which to save the results of the analysis If an object with this name already exists its contents will be overwritten This must be a valid S PLUS object name any combination of alphanumeric characters that starts with an alpha character is allowed T he only non alphanumeric character allowed is the period Names are case sensitive so X and x are different names T he default is last robust RBA MREGESON The saved object will have class I mRobMM See the on line help for mRobMM obj ect for more information about the saved object Model Options Results Plot Predict m Estimation Method r Resampling Estimator Test Based Algorithm Random C Initial Robust Exhaustive Final Robust C Genetic m Loss Functions Rand
223. unction In this subsection you will learn how to change the default settings of some control parameters for the M M estimator so as to obtain particular estimates that fit your purpose M ost of the default settings can be changed through the functions I m robust control andim genetic control Only the commonly used control parameters are introduced in this section For the default settings of other parameters and how to change them see the online help filefori m robust control and Im genetic control If the final M estimates are accepted they have a default asymptotic efficiency of 85 compared with the LS estimates when the errors are normally distributed Sometimes an asymptotic efficiency of 85 may not be what you exactly want To change the efficiency of the final M estimates the mRobMM optional argument robust control should be generated from mRobMM robust control with desired efficiency gt oil tmp lt mRobMM Oil Market dataz oil df robust control mRobMM robust control efficiency 0 95 gt coef oil tmp Intercept Market 0 07398806 0 8491126 As mentioned in the introduction the final M estimates are based on the initial S estimates of regression coefficients and scale parameter For both the initial S estimate and the final M estimate S PLUS uses a loss function for the estimation Two different loss functions are available in S PLU S Tukey s bisquare function and the optimal loss fu
224. usDialogHorizontalSize void virtual BOOL SPlusOnInitializeControl const VARIANT FAR amp vInitial Value NAWVDACG CNIROSINSRI5 45 NEW DIALOG CONTROLS IN S PLus 4 5 S PLUS has a variety of dialog controls that can be used to represent the properties of an object such as a user defined function in a dialog There are now several new control types in S PLU S 4 5 that can be used in dialogs you create for user defined functions Picture A small rectangle taking up one dialog column which can contain a Windows metafile picture either Aldus placable or enhanced The picture to draw in this control is specified as a string containing either the pathname to the WMF file on disk or a pathname to a Windows 32 bit DLL followed by the resource name of the metafile picture in thisDLL W ide Picture Same as Picture except that this control takes up two dialog columns Picture List Box A scrolling list box control taking up one dialog column which can contain several Windows metafile pictures either Aldus placable or enhanced The list of pictures to draw in this control is specified as a string option list with each element in this option list containing either the pathname to the WMF file on disk or a pathname to a W indows 32 bit D LL followed by the resource name of the metafile picture in this DLL W ide Picture List Box Same as Picture List Box except that this control takes up two dialog columns For both t
225. ust Formula Formula ozone radiation temperature wind Create Formula OK Cancel Apply dof tort fomc robmm1 bmp Model Page Data Data Frame Select a data frame Ny Tip You can type into the D ata Frame edit box any expression which evaluates to a data frame 187 CAPIR 22 RAS URES Formula Save Model Object 188 Weights Enter the column that specifies weights to be applied to all observations used in the linear regression To weigh all rows equally leave this blank Subset Rows with Enter an S PLUS expression which identifies the rows to use in the analysis To use all the rows in the data frame leave this field blank The expression must evaluate to a vector of logical values TRUE values are used FALSE values are dropped or a vector of indices identifying the numbers of the rows to use Examples Species bear only bears are used 1 20 only the first 20 rows of the data are used Age gt 13 amp Age lt 20 only teenagers are used For more information on constructing logical expressions see the S PLUS Programmer s Guide Omit Rows with Missing Values Check this box to omit from the analysis any rows in the data frame that contain missing values for any of the variables in the modal If this box is not checked S PLUS will report an error and halt the routine if any row is found to have a missing value in any of the terms in the modal Formula Enter a form
226. ut the leading C 1 You can also find the PROGID used in an MFC ControlWizard project in the implementation CPP file of the control class Search for the MPLEMENT_OLECREATE_EX macro in this file The second parameter in this macro isthe PROGID string you are looking for If you are using the O LE ControlW izard as part of M icrosoft Visual C 4 0 or higher to develop your control you can change the PROGID string for your control before it gets created by editing the names used for the control project During the ControlWizard steps you will see a dialog with the 265 CFPIR 16 DACGCNIROSINSALS 45 button Edit N ames on it OLE Controfwizard Step 2 of 2 Ed Select the control whose options you wish to browse or edit You may edit its class and file names if you wish Blip Which features would you like this control to have E MuProject SEE File Edit View Contents Search For Help on How to use Help About MyControl lV Activates when visible T Invisible at runtime P Available in Insert Object dialog MV Has an About box T Acts as a simple frame control Which window class if any should this control subclass none lt Back Hert Finish Cancel Help Click on this button and you will get another dialog allowing you to change the names used for classes in this project Every control projectin M FC hasa class f
227. v IV Save Data I Standardize Variables M Save Dissimilarities Cancel Apply i current Help Figure 8 1 T he Fuzzy Partitioning dialog M odel page Model Page Data Data Frame Specify a data frame ora dissimilarity object To use a subset of rows or columns use standard S PLU S subscripting of the data frame Note that all columns of the data frame must be numeric If non numeric columns e g factors are present use the Dissimilarities dialog to produce adissimilarity object and then use this object in clustering The Dissimilarities dialog provides special options for handling factors 94 PUY PARITIONNGS Dissimilarity Measure Options Result Data is Dissimilarities Check thisif Data Framenamesadi ssi mil arity object Metric Select the metric to be used for calculating dissimilarities between objects The available options are euclidean and manhattan Euclidean distances are root sum of squares of differences and manhattan distances are the sum of absolute differences If Data Frame is already a dissimilarity matrix then this argument will be ignored Standardize Variables Check this to standardize each data column by subtracting the variable s mean value and dividing by the variable s mean absolute deviation If Data Frame is already a dissimilarity matrix then this argument will be ignored Number of Clusters Specify the number of clusters to form Save As Enter thena
228. ve H ierarchical Clustering M odel Page Results Page Plot Page M onothetic Clustering M odel Page Results Page Plot Page Compute D issimilarities Chapter 9 Creating HTML Output Tables Text Graphs Chapter 10 Type III Sum of Squares and Adjusted Means ANOVA Tables Adjusted M eans M ultiple Comparisons Estimable Functions Sigma Constrained Parameterization References Chapter 11 Power and Sample Size Normal Power And Sample Size M odel Page Options Page Binomial Power And Sample Size M odel Page Options Page Printout Page 126 127 128 129 130 134 135 135 137 CNENS Power and Sample Size Theory Normally D istributed D ata OneSampleT est of G aussian M ean Comparing M eans From T wo Samples Binomial D ata References Chapter 12 Robust Linear Regression OVERVIEW OF THE ROBUST REGRESSION METHOD K ey Robustness F eatures of the M ethod T he Essence of the M ethod a Special M Estimate Using theImRobM M Function to O btain a Robust Fit Comparison of Least Squares and Robust Fits Robust M ode Selection COMPUTING LEAST SQUARES AND ROBUST FITS Computing a Least Squares Fit Computing a Robust Fit Least Squares vs Robust Fitted M ode O bjects VISUALIZING AND SUMMARIZING THE ROBUST FIT Visualizing the Fit with the p ot Function Statistical Inference with thes ummary Function COMPARING LEAST SQUARESAND ROBUST FITS Creating a Comparison O bject for LS and Robust Fits Visualizing LS vs Robust Fits Statistical Infe
229. wn to be asymptotically equivalent to the robust version of AIC proposed by Ronchetti 1985 T he section Theoretical D etails of the Robust Regression M ethod provides a sketch of technical details supporting the use of RFPE The RFPE criterion is used as the robust method invoked by use of the generic functions of drop1 and addi For example use of drop1 on the robustly fitted model si mu mm4 in the previous section gives gt dropi si mu mm4 Significant test at level 10 for x3 171 CAPIR 22 RAS LUNAR AGEN 172 Single term deletions Model y kl x2 x3 x4 1 Df RFPE lt none gt 24 24174 xl 1 24 46596 x2 1 52 19800 x3 1 64 32633 x4 1 23 95825 The output indicates that dropping x4 gives a better model You can also use add to explore the relevance of other variables For example if you fit si mu mm3 first you can use the following command to investigate if x4 helps predict y gt addl si mu mm3 x4 Single term additions Model y kl x2 x3 1 Df RFPE lt none gt 24 10184 x4 1 24 38769 Since addition of x4 causes RFPE to increase addition of x4 results in a poor model Caveat If the test for bias of final M estimates is significant for any of the models considered by dropl and addi you should not trust the corresponding RFPE very much CONFOLINS OOS RR RBA RRESON CONTROLLING OPTIONS FOR ROBUST REGRESSION Efficiency at Gaussian Model Alternative Loss F
230. y d current Figure 13 10 The Parametric Survival dialog Predict page Predict Page New Data Enter the name of a data frame to use for computing predictions It must contain the same names as the terms in the right side of the formula for the model If omitted the original data are used for computing predictions Predict Probabilities Check this to predict probability of failure 235 CAPIRR 13 PARAMEIRC REGRESSION FOR END DIA Predict Probabilities Predict Response Save 236 Predict Response Check this to predict the response based upon the fitted probability distribution At Response Values A vector of response values used to predict probabilities Enabled only while Predict Probabilities is checked Confidence Level Type confidence level used for confidence intervals of predicted probabilities At Probabilities A vector of probabilities used to predict the response Enabled only while Predict Response is checked Confidence Level Type confidence level used for confidence intervals of predicted response values Save In Enter the name of an S PLUS list in which predictions and standard errors are to be saved Print Results Check this to print out the result of prediction Related S PLUS language functions for Parametric Survival censorReg print censorReg plot censorReg summary censorReg residuals censorReg censorReg control censorReg fit censorReg distributions
231. y You may receive warnings OCXutils cpp 125 warning C4237 nonstandard extension used bool keyword is reserved for future use OCXutils cpp 216 warning C4237 nonstandard extension used bool keyword is reserved for future use These warnings are normal and can be ignored Several overrides of CSPlusOCX virtual methods still remain to be added to your ActiveX control class but compiling and linking now gives you a chance to review the changes made and ensure that everything builds properly at this stage 6 Add overrides of virtual methods to your control class To support S PLUS dialog layout and setting the initial value of the control from an S PLUS property value you need to override and implement several methods in your control class To do this edit the header for your control class In this ex ample edit the MyOCXCtl h file In the declaration of the CMyOCXCtrl class add the following method declarations in the public section virtual long GetSPlusDialog VerticalSize void virtual long GetSPlusDialogHorizontalSize void virtual BOOL SPlusOnlnitializeControl const VARIANT FAR amp vInitialValue Next open the implementation file for your control class In this example edit the file MyOCXCtl cpp Add the following methods to the class long CMyOCXCtrl GetSPlusDialogVerticalSize return 3 takes up 3 lines in dialog long CMyOCXCtrl GetS PlusDialogHorizontalSize
232. ys event 1 weights weights data capacitor2 gt fitl lt censorReg censor days event voltage weights weights data capacitor2 gt fit2 lt censorReg censor days event factor voltage weights weights data capacitor2 gt fit3 lt censorReg censor days event strata voltage weights weights data capacitor2 The models are then compared using theanova function as follows gt anova fit0 fitl fit2 fit3 test Chisq which yields the display Likelihood Ratio Test s Response censor days event Terms N Params 2 LogLik Test Df LRT Pr Chi 1 1 2 745 53 2 voltage 3 632 92 voltage 1 112 615 0 0000 3 factor voltage 5 632 37 2 vs 3 2 0 547 0 7605 4 strata voltage 6 630 40 3 vs 4 1 1 973 0 1601 T he evidence is now quite strong that we cant do any better than the model which relates the location parameter of the distribution to a linear regression single parameter model in voltage We can verify this by looking at graphics 219 CAPIRR 13 PARAMETRC REGRESSION FOR END DA FITTING MODELS THE PLOT METHOD FOR CENSORREG 220 The plot method for objects of class censorReg generates 4 to 6 plots depending on the type of fit You can generate all possible plots for a censorReg fit object by simply using the plot function as follows gt plot fit1 The first three plots resulting from the above call are equivalent to those produced for fit objects of class 1 m or
Download Pdf Manuals
Related Search
Related Contents
WM-FX195 Plan d`assurance qualité - Projet DMD Service Manual - Foster web spares MANUEL D`UTILISATION MARINE CHRONOGRAPHE Thermostat de l`échantillonneur automatique Agilent série 1200 マツダDTC Copyright © All rights reserved.
Failed to retrieve file