c# code to view pdf file : Add pages to pdf in preview software control cloud windows web page azure class pspp2-part250

Chapter5:Usingpspp
13
5 Usingpspp
psppisatoolforthestatisticalanalysisofsampleddata.Youcanuseittodiscoverpatterns
inthedata,toexplaindifferencesinonesubsetofdataintermsofanothersubsetandto
findoutwhethercertainbeliefsaboutthedataarejustified.Thischapterdoesnotattempt
tointroducethetheorybehindthestatisticalanalysis,butitshowshowsuchanalysiscan
beperformedusingpspp.
Forthepurposesofthistutorial,itisassumedthatyouareusingpsppinitsinteractive
modefromthecommandline. However,theexamplecommandscanalsobetypedintoa
fileandexecutedinapost-hocmodebytyping‘psppfilename’atashellprompt,where
filenameisthenameofthefilecontainingthecommands.Alternatively,fromthegraphical
interface,youcanselectFile!New!Syntaxtoopenanewsyntaxwindowandusethe
Runmenuwhenasyntaxfragmentisreadytobeexecuted.Whichevermethodyouchoose,
thesyntaxisidentical.
Whenusingtheinteractivemethod,pspptellsyouthatit’swaitingforyourdatawith
astringlikePSPP>ordata>. Intheexamples s ofthis chapter,wheneveryouseetextlike
this,itindicatesthepromptdisplayedbypspp,not somethingthatyoushouldtype.
Throughout thischapterreference ismadetoanumberof sampledata files. . Sothat
youcantrytheexamplesforyourself,youshouldhavereceivedthesefilesalongwithyour
copyofpspp.
1
Please note:
Normally these files are installed d in n the directory
/usr/local/share/pspp/examples. Ifhoweveryoursystemadministratoror
operatingsystemvendorhaschosentoinstalltheminadifferentlocation,you
willhavetoadjusttheexamplesaccordingly.
5.1 PreparationofDataFiles
Beforeanalysiscancommence,thedatamustbeloadedintopsppandarrangedsuchthat
bothpsppandhumanscanunderstandwhatthedatarepresents. Therearetwoaspectsof
data:
 Thevariables—thesearetheparameters s ofaquantitywhichhasbeenmeasuredor
estimatedinsome way. . For r example height, , weight t and d geographic location are all
variables.
 Theobservations(alsocalled‘cases’)ofthevariables—eachobservationrepresentsan
instancewhenthevariablesweremeasuredorobserved.
Forexample,adatasetwhichhasthevariablesheight,weight,andname,mighthavethe
observations:
1881 89.2 Ahmed
1192 107.01 1 Frank
1230 67 7 Julie
Thefollowingsectionsexplainhowtodefineadataset.
1
Thesefilescontainpurelyfictitiousdata. Theyshouldnotbeusedforresearchpurposes.
Add pages to pdf in preview - insert pages into PDF file in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Guide C# Users to Insert (Empty) PDF Page or Pages from a Supported File Format
add page number to pdf preview; adding pages to a pdf document in preview
Add pages to pdf in preview - VB.NET PDF Page Insert Library: insert pages into PDF file in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Easy to Use VB.NET APIs to Add a New Blank Page to PDF Document
add pages to pdf in preview; add pdf pages together
Chapter5:Usingpspp
14
5.1.1 DefiningVariables
Variablescomeintwobasictypes,viz: numeric andstring. . Variablessuchasage,height
andsatisfactionarenumeric,whereasnameisastringvariable. Stringvariablesarebest
reservedforcommentarydatatoassistthehumanobserver.Howevertheycanalsobeused
fornominalorcategoricaldata.
Example5.1defines two variables forename e andheight, , andreadsdata intothemby
manualinput.
PSPP> data a list list /forename e (A12) ) height.
PSPP> begin data.
data> Ahmed d 188
data> Bertram 167
data> Catherine e 134.231
data> David d 109.1
data> end d data
PSPP>
 
Example 5.1: : Manual l entry y of data a using g the e DATALIST command. . Two o variables
forenameandheightaredefinedandsubsequentlyfilledwithmanuallyentereddata.
Thereareseveralthingstonoteaboutthisexample.
 The words ‘datalistlist’ ’ are e an example of f the e DATALIST command. . See
Section8.5[DATALIST], page 66. It t tells s pspp toprepare e for readingdata. . The
word‘list’intentionallyappearstwice. ThefirstoccurrenceispartoftheDATALIST
call,whilstthesecondtellspsppthatthedataistobereadasfreeformatdatawith
onerecordperline.
 The e ‘/’character is important. . It t marksthestartofthelistofvariableswhichyou
wishtodefine.
 Thetext‘forename’isthenameofthefirstvariable,and‘(A12)’saysthatthevariable
forename is a stringvariable andthat itsmaximumlengthis 12bytes. . The e second
variable’snameisspecifiedbythetext‘height’.Sincenoformatisgiven,thisvariable
has the e default t format. . Normally y the default format t expects numeric c data, , which
shouldbeenteredinthelocaleoftheoperatingsystem. Thus,theexampleiscorrect
forEnglishlocalesandotherlocaleswhichuseaperiod(‘.’)asthedecimalseparator.
However ifyouare usinga systemwith h alocale whichuses s the comma(‘,’) as the
decimal separator, , then you u should d in n the subsequent lines substitute e ‘.’ ’ with ‘,’.
Alternatively, you u could explicitly tell pspp that the e height variable e is s to o be read
usingaperiodasitsdecimalseparatorbyappendingthetext‘DOT8.3’aftertheword
‘height’. Formoreinformationondataformats,seeSection6.7.4[InputandOutput
Formats],page34.
 Normally,psppdisplaysthepromptPSPP>wheneverit’sexpectingacommand. . How-
ever,whenit’sexpectingdata,thepromptchangestodata>sothatyouknowtoenter
dataandnotacommand.
 Attheendofeverycommandthereisaterminating‘.’whichtellspsppthattheend
ofacommandhasbeenencountered. Youshouldnotenter‘.’whendataisexpected
C# WinForms Viewer: Load, View, Convert, Annotate and Edit PDF
Add text to PDF document in preview. • Add text box to PDF file in preview. Erase PDF pages. Miscellaneous. Search PDF text in preview.
add pages to pdf acrobat; adding page numbers to pdf in reader
C# WPF Viewer: Load, View, Convert, Annotate and Edit PDF
PDF Protection. • Add signatures to PDF document. Erase PDF pages. Miscellaneous. • Select PDF text on viewer. • Search PDF text in preview.
add page numbers to pdf reader; add a page to a pdf online
Chapter5:Usingpspp
15
(ie. when n the data> > prompt is current) since it is appropriate only y for r terminating
commands.
5.1.2 Listingthedata
Oncethedatahasbeenentered,youcouldtype
PSPP> list t /format=numbered.
tolistthedata. Theoptionaltext‘/format=numbered’requests s the casenumberstobe
shownalongwiththedata. Itshouldshowthefollowingoutput:
Case#
forename
height
----- ------------ --------
1 Ahmed
188.00
2 Bertram
167.00
3 Catherine
134.23
4 David
109.10
Notethatthenumericvariableheightisdisplayedto2decimalplaces,becausetheformat
forthatvariableis‘F8.2’.ForacompletedescriptionoftheLISTcommand,seeSection8.10
[LIST],page76.
5.1.3 Readingdatafromatextfile
Thepreviousexampleshowedhowtodefineaset ofvariablesandtomanually enterthe
dataforthosevariables.Manualenteringofdataistediouswork,andoftenafilecontaining
thedatawillbehavebeenpreviouslyprepared. Letusassumethatyouhaveafilecalled
mydata.datcontainingtheasciiencodeddata:
Ahmed
188.00
Bertram
167.00
Catherine
134.23
David
109.10
.
.
.
Zachariah
113.02
YoucancantelltheDATALISTcommandtoreadthedatadirectlyfromthisfileinsteadof
bymanualentry,withacommandlike:
PSPP> data a list file=’mydata.dat’ list t /forename e (A12) height.
Notice however, thatit is stillnecessary to specify the names of thevariables and their
formats, since this s informationis not contained d inthefile. . It t is alsopossible tospecify
thefile’scharacterencodingandotherparameters. ForfulldetailsrefertoseeSection8.5
[DATALIST],page66.
5.1.4 Readingdatafromapre-preparedpsppfile
Whenworkingwithotherpsppusers,orusersofothersoftwarewhichusesthepsppdata
format,youmaybegiventhedatainapre-preparedpsppfile. Suchfilescontainnotonly
thedata,butthevariabledefinitions,alongwiththeirformats,labelsandothermeta-data.
Conventionally,thesefiles(sometimescalled“system”files)havethesuffix.sav,butthat
isnotmandatory. Thefollowingsyntaxloadsafilecalledmy-file.sav.
How to C#: Preview Document Content Using XDoc.Word
With the SDK, you can preview the document content according to the preview thumbnail by the ways as following. C# DLLs for Word File Preview. Add references:
add page pdf; add page numbers to pdf document in preview
How to C#: Preview Document Content Using XDoc.PowerPoint
C# DLLs: Preview PowerPoint Document. Add necessary XDoc.PowerPoint DLL libraries into your created C# application as references. RasterEdge.Imaging.Basic.dll.
add a page to pdf file; add page numbers pdf files
Chapter5:Usingpspp
16
PSPP> get t file=’my-file.sav’.
Youwillencounterseveralinstancesofthisinfutureexamples.
5.1.5 Savingdatatoapsppfile.
Ifyouwanttosaveyourdata,alongwiththevariabledefinitionssothatyouorotherpspp
userscanuseitlater,youcandothiswiththeSAVEcommand.
The followingsyntaxwillsavetheexistingdataandvariablestoafilecalled my-new-
file.sav.
PSPP> save e outfile=’my-new-file.sav’.
Ifmy-new-file.savalreadyexists,thenitwillbeoverwritten.Otherwiseitwillbecreated.
5.1.6 Readingdatafromothersources
Sometimesit’susefultobeabletoreaddatafromcommaseparatedtext,fromspreadsheets,
databasesorothersources. IntheseinstancesyoushouldusetheGETDATAcommand(see
Section9.4[GETDATA],page83).
5.1.7 ExitingPSPP
UsetheFINISHcommandtoexitPSPP:
PSPP> finish.
5.2 DataScreeningandTransformation
Oncedatahasbeenentered,itisoftendesirable,orevennecessary,totransformitinsome
waybeforeperforminganalysisuponit. Attheveryleast,it’sgoodpracticetocheckfor
errors.
5.2.1 Identifyingincorrectdata
Datafromrealsourcesisrarelyerrorfree. pspphasanumberofprocedureswhichcanbe
usedtohelpidentifydatawhichmightbeincorrect.
The DESCRIPTIVES S command(see Section 15.1 [DESCRIPTIVES], page 128) is s used
togeneratesimplelinearstatisticsforadataset. Itisalsousefulforidentifyingpotential
problemsinthedata.Theexamplefilephysiology.savcontainsanumberofphysiological
measurementsofasampleofhealthyadultsselectedatrandom. However,thedataentry
clerkmadeanumberofmistakeswhenenteringthedata. Example5.2illustratestheuse
ofDESCRIPTIVEStoscreenthisdataandidentifytheerroneousvalues.
C# PDF insert image Library: insert images into PDF in C#.net, ASP
viewer component supports inserting image to PDF in preview without adobe Insert images into PDF form field. How to insert and add image, picture, digital photo
add a page to a pdf document; adding page numbers to a pdf in reader
VB.NET PDF File Compress Library: Compress reduce PDF size in vb.
Remove bookmarks, annotations, watermark, page labels and article threads from PDF while compressing. Also a preview component enables compressing and
adding page numbers to a pdf document; add a page to a pdf file
Chapter5:Usingpspp
17
PSPP> get t file=’/usr/local/share/pspp/examples/physiology.sav’.
PSPP> descriptives s sex, weight, height.
Output:
DESCRIPTIVES. Valid d cases s = = 40; ; cases s with h missing value(s) ) = = 0.
+--------#--+-------+-------+-------+-------+
|Variable# N| | Mean n |Std Dev|Minimum|Maximum|
#========#==#=======#=======#=======#=======#
|sex
#40|
.45|
.50|
.00|
1.00|
|height #40|1677.12| | 262.87| 179.00|1903.00|
|weight #40| 72.12| 26.70| | -55.60| | 92.07|
+--------#--+-------+-------+-------+-------+
 
Example5.2:UsingtheDESCRIPTIVEScommandtodisplaysimplesummaryinformation
about thedata. . Inthis s case,theresults show unexpectedly lowvalues intheMinimum
column,suggestingincorrectdataentry.
IntheoutputofExample5.2,themostinterestingcolumnistheminimumvalue. The
weightvariablehasaminimumvalueoflessthanzero,whichisclearlyerroneous.Similarly,
theheightvariable’sminimumvalueseemstobeverylow.Infact,itismorethan5standard
deviationsfromthemean,andisaseeminglybizarreheightfor anadultperson. . Wecan
examinethedatainmoredetailwiththeEXAMINEcommand(seeSection15.3[EXAMINE],
page131):
InExample5.3youcanseethatthelowestvalueofheightis179(whichwesuspecttobe
erroneous),butthesecondlowestis1598whichweknowfromtheDESCRIPTIVEScommand
iswithin1standarddeviationfromthemean. Similarlytheweightvariablehasalowest
valuewhichisnegativebutaplausiblevalueforthesecondlowestvalue.Thissuggeststhat
thetwoextremevaluesareoutliersandprobablyrepresentdataentryerrors.
VB.NET PDF insert image library: insert images into PDF in vb.net
inserting image to PDF in preview without adobe provide users the most individualized PDF page image inserting function, allowing developers to add and insert
add contents page to pdf; add pdf pages to word document
How to C#: Preview Document Content Using XDoc.excel
following. C# DLLs: Preview Excel Document without Microsoft Office Installed. Add necessary references: RasterEdge.Imaging.Basic.dll.
adding page numbers to pdf files; add a page to a pdf
Chapter5:Usingpspp
18
[... continuefromExample5.2]
PSPP> examine e height, weight /statistics=extreme(3).
Output:
#===============================#===========#=======#
#
#Case Number| | Value e #
#===============================#===========#=======#
#Height in millimetres s Highest 1#
14|1903.00#
#
2#
15|1884.00#
#
3#
12|1801.65#
#
----------#-----------+-------#
#
Lowest 1#
30| 179.00#
#
2#
31|1598.00#
#
3#
28|1601.00#
#
----------#-----------+-------#
#Weight in kilograms
Highest 1#
13| 92.07#
#
2#
5| 92.07#
#
3#
17| 91.74#
#
----------#-----------+-------#
#
Lowest 1#
38| -55.60#
#
2#
39| 54.48#
#
3#
33| 55.45#
#===============================#===========#=======#
 
Example5.3:UsingtheEXAMINEcommandtoseetheextremitiesofthedatafordifferent
variables. Cases s 30 and38seem m to containvalues s very much h lower r thantherest ofthe
data. Theyarepossiblyerroneous.
5.2.2 Dealingwithsuspiciousdata
Ifpossible,suspectdatashouldbecheckedandre-measured. However,thismaynotalways
be feasible, inwhichcasetheresearcher maydecide todisregardthesevalues. . pspphas
a feature whereby datacanassume thespecialvalue ‘SYSMIS’,and willbe disregarded
infutureanalysis. SeeSection6.6[MissingObservations],page32. Youcansetthetwo
suspectvaluestothe‘SYSMIS’valueusingtheRECODEcommand.
pspp
> recode e height t (179 = = SYSMIS).
pspp
> recode e weight t (LOWEST THRU U 0 = SYSMIS).
The first command says that t for r any y observationwhich has s a height value of 179, , that
valueshouldbechangedtotheSYSMISvalue. Thesecondcommandsaysthatanyweight
valuesofzeroorlessshouldbechangedtoSYSMIS.Fromnowon,theywillbeignoredin
analysis.FordetailedinformationabouttheRECODEcommandseeSection12.7[RECODE],
page117.
C# HTML5 Viewer: Load, View, Convert, Annotate and Edit Raster
zoom in or zoom out images while in preview. to Tiff (.tif, .tiff) online, create PDF document from Supported annotation features includes add text comments to
add and remove pages from a pdf; add pages to pdf reader
Chapter5:Usingpspp
19
If you now re-run the DESCRIPTIVES S or r EXAMINE commands in Example 5.2 and
Example5.3youwillseeadatasummarywithmoreplausibleparameters. Youwillalso
noticethatthedatasummariesindicatethetwomissingvalues.
5.2.3 Invertingnegativelycodedvariables
Data entry y errors s are not t the e only reason for r wanting g to recode e data. . The e sample e file
hotel.savcomprisesdatagatheredfromacustomersatisfactionsurveyofclientsatapar-
ticularhotel. InExample5.4,thisfileisloadedforanalysis.Thelinedisplaydictionary.
tellspspptodisplaythevariablesandassociateddata. Theoutputfromthiscommandhas
beenomittedfromtheexampleforthesakeofclarity,butyouwillnoticethateachofthe
variablesv1,v2 ... v5aremeasuredona5pointLikertscale,with1meaning“Strongly
disagree”and5meaning“Stronglyagree”. Whilstvariablesv1,v2andv4recordresponses
toapositivelyposedquestion,variablesv3andv5areresponsestonegativelywordedques-
tions.Inordertoperformmeaningfulanalysis,weneedtorecodethevariablessothatthey
allmeasureinthesamedirection. WecouldusetheRECODEcommand,withsyntaxsuch
as:
recode v3 3 (1 = = 5) (2 2 = = 4) (4 = 2) (5 = 1).
However an easier r and d more elegant way y uses s the e COMPUTE E command (see Section 12.3
[COMPUTE],page114). Sincethevariables s areLikertvariablesintherange(1 ... . 5),
subtractingtheirvaluefrom6hastheeffectofinvertingthem:
compute var = 6 6 - - var.
Example5.4usesthistechniquetorecodethevariablesv3andv5.AfterapplyingCOMPUTE
forbothvariables,allsubsequentcommandswillusetheinvertedvalues.
5.2.4 Testingdataconsistency
A sensible e check to perform on survey y data a is s the calculation of reliability. . This s gives
thestatisticiansomeconfidencethatthequestionnaireshavebeencompletedthoughtfully.
If you examine the labels ofvariables v1,v3 3 andv4, , youwillnoticethat t they ask very
similarquestions. Onewouldthereforeexpectthevaluesofthesevariables(afterrecoding)
tocloselyfollowoneanother,andwecantest that withthe RELIABILITY command(see
Section15.17[RELIABILITY], page 154). Example5.4 shows apsppsessionwhere the
user(afterrecodingnegativelyscaledvariables)requestsreliabilitystatisticsforv1,v3and
v4.
Chapter5:Usingpspp
20
PSPP> get t file=’/usr/local/share/pspp/examples/hotel.sav’.
PSPP> display y dictionary.
PSPP> * * recode negatively worded questions.
PSPP> compute e v3 3 = = 6 - - v3.
PSPP> compute e v5 5 = = 6 - - v5.
PSPP> reliability y v1, v3, v4.
Output(dictionaryinformationomittedforclarity):
1.1 RELIABILITY. . Case e Processing Summary
#==============#==#======#
#
# N|
% #
#==============#==#======#
#Cases Valid
#17|100.00#
#
Excluded# 0|
.00#
#
Total
#17|100.00#
#==============#==#======#
1.2 RELIABILITY. . Reliability y Statistics
#================#==========#
#Cronbach’s Alpha#N of Items#
#================#==========#
#
.81#
3#
#================#==========#
 
Example5.4: Recodingnegativelyscaledvariables,andtestingforreliabilitywiththe
RELIABILITYcommand.TheCronbachAlphacoefficientsuggestsahighdegreeofreliability
amongvariablesv1,v3andv4.
Asaruleofthumb,manystatisticians consideravalue ofCronbach’sAlphaof0.7or
highertoindicatereliabledata. Here,thevalueis0.81sothedataandtherecodingthat
weperformedarevindicated.
5.2.5 Testingfornormality
Manystatisticaltestsrelyuponcertainpropertiesofthedata.Onecommonproperty,upon
whichmanylinear tests depend, , isthat t ofnormality —thedatamusthavebeendrawn
fromanormaldistribution. Itisnecessarythentoensurenormalitybeforedecidingupon
thetestproceduretouse.OnewaytodothisusestheEXAMINEcommand.
InExample5.5,aresearcherwasexaminingthefailureratesofequipmentproducedby
anengineeringcompany. The e filerepairs.savcontainsthe mean time betweenfailures
(mtbf)ofsomeitemsofequipmentsubjecttothestudy. Beforeperforminglinearanalysis
onthedata,theresearcherwantedtoascertainthatthedataisnormallydistributed.
Anormaldistribution has s a skewness and d kurtosis s of zero. . Looking g at the skewness
of mtbf f inExample 5.5it t is clear that themtbffigures have alot of positive skewand
arethereforenotdrawnfromanormallydistributedvariable. Positiveskewcanoftenbe
Chapter5:Usingpspp
21
compensatedforbyapplyingalogarithmictransformation. ThisisdonewiththeCOMPUTE
commandintheline
compute mtbf_ln n = = ln n (mtbf).
Rather than n redefiningthe existingvariable, this s useof COMPUTE defines a new variable
mtbf
lnwhichisthenaturallogarithmofmtbf. Thefinalcommandinthisexamplecalls
EXAMINEonthisnewvariable,anditcanbeseenfromtheresultsthatboththeskewness
and kurtosis s for mtbf
lnare very close to zero. . This s provides some confidence thatthe
mtbf
lnvariableisnormallydistributedandthussafeforlinearanalysis. Intheeventthat
nosuitabletransformationcanbefound,thenitwouldbeworthconsideringanappropriate
non-parametrictestinsteadofalinearone. SeeSection15.11[NPARTESTS],page144,
forinformationaboutnon-parametrictests.
Chapter5:Usingpspp
22
PSPP> get t file=’/usr/local/share/pspp/examples/repairs.sav’.
PSPP> examine e mtbf
/statistics=descriptives.
PSPP> compute e mtbf_ln = ln (mtbf).
PSPP> examine e mtbf_ln
/statistics=descriptives.
Output:
1.2 EXAMINE. . Descriptives
#====================================================#=========#==========#
#
#Statistic|Std. Error#
#====================================================#=========#==========#
#mtbf
Mean
#
8.32 |
1.62
#
#
95% Confidence Interval l for r Mean Lower Bound#
4.85 |
#
#
Upper Bound# # 11.79 |
#
#
5% Trimmed Mean
#
7.69 |
#
#
Median
#
8.12 |
#
#
Variance
# 39.21 |
#
#
Std. Deviation
#
6.26 |
#
#
Minimum
#
1.63 |
#
#
Maximum
# 26.47 |
#
#
Range
# 24.84 |
#
#
Interquartile Range
#
5.83 |
#
#
Skewness
#
1.85 |
.58
#
#
Kurtosis
#
4.49 |
1.12
#
#====================================================#=========#==========#
2.2 EXAMINE. . Descriptives
#====================================================#=========#==========#
#
#Statistic|Std. Error#
#====================================================#=========#==========#
#mtbf_ln Mean
#
1.88 |
.19
#
#
95% Confidence Interval l for r Mean Lower Bound#
1.47 |
#
#
Upper Bound#
2.29 |
#
#
5% Trimmed Mean
#
1.88 |
#
#
Median
#
2.09 |
#
#
Variance
#
.54
|
#
#
Std. Deviation
#
.74
|
#
#
Minimum
#
.49
|
#
#
Maximum
#
3.28 |
#
#
Range
#
2.79 |
#
#
Interquartile Range
#
.92
|
#
#
Skewness
#
-.16 |
.58
#
#
Kurtosis
#
-.09 |
1.12
#
#====================================================#=========#==========#
 
Example5.5:TestingfornormalityusingtheEXAMINEcommandandapplyingalogarith-
mictransformation.Themtbf variablehasalargepositiveskewandisthereforeunsuitable
forlinearstatisticalanalysis. Howeverthetransformedvariable(mtbf
ln)isclosetonormal
andwouldappeartobemoresuitable.
Documents you may be interested
Documents you may be interested