***** Tova kursa po SPSS Den 1 **************************. **** chetene na file s danni ********************. GET FILE='C:\1SPSS\HH2.sav'. DATASET NAME $DataSet WINDOW=FRONT. *** chestoti **********. freq vars=all. DATASET ACTIVATE $DataSet. FREQUENCIES VARIABLES=RB090 /ORDER=ANALYSIS. *** sazdavane na nov file s danni s izbrani promenlivi ***. save outFILE='C:\1SPSS\keep1.sav' /keep= ID OBL RB090 Age. SAVE OUTFILE='C:\1SPSS\keep2.sav' /DROP=DomN Loc Rel PB190 PB200 RB210 PE010 PE040 PE030 Q1 Q7 Q23 P1 P3 P6 P9 P25 P31_1 P31_2 P32 P33 P36 P95 /COMPRESSED. **** chetem novite file-ove ***. GET FILE='C:\1SPSS\keep1.sav'. DATASET NAME $DataSet WINDOW=FRONT. freq vars=all. ********* sazdavane na nov file s 5 promenlivi ********. *** vzemam originalnia file **********************. GET FILE='C:\1SPSS\HH2.sav'. **** zapis na nov file s 5 promenlivi ****. SAVE OUTFILE='C:\1SPSS\domat1.sav' /keep= ID Q1 Q7 P1 P33. ***** otvarjam novia file *****. get FILE='C:\1SPSS\domat1.sav'. freq vars=all. ********** syntax den 3 *****************************. GET FILE='C:\1SPSS\HH2.sav'. freq vars=all. **** etiketi na promenlivi *******. variable label RB090 'Pol'. freq vars=RB090. *** prekodirane na diskretni promenlivi ********. recode RB090 (1=0)(2=1) into Jena. freq vars = RB090 Jena. **** prekodirane na intervalni promenlivi **********. FREQUENCIES VARIABLES=Age /NTILES=3 /ORDER=ANALYSIS. recode age (lo thru 34=1) (35 thru 58=2)(59 thru hi=3) into Age3. freq vars=age3. *** prekodirane na ekstremalni st-ti kato systemno lipsvashti ****. freq vars=P31_1. recode P31_1 (9000 thru hi=sysmis)(else=copy) into RZ. freq vars=rz. desc vars=P31_1 rz. ****** formatirane na stoinosti ****. format jena (F10.0). freq vars=jena. recode sector3 (2=1)(1=0)(3=0) into indust. recode sector3 (2=1)(1,3=0) into indust. ********************************. GET FILE='C:\1SPSS\EN2.sav'. freq vars=all. **** etiketi na promenlivi *******. variable label SoleProp 'Yurid forma'. freq vars=SoleProp. **** etiket na stoinost ********. value label SoleProp 1 'Ednol targovetz' 0 'Ne e ednolichen targovetz'. freq vars=SoleProp. FREQUENCIES VARIABLES=turnover /NTILES=3 /ORDER=ANALYSIS. recode turnover (lo thru 17=1) (17.01 thru 70=2)(70.01 thru hi=3) into turnover3. freq vars=turnover3. freq vars=turnover. recode turnover (5000000 thru hi=sysmis)(else=copy) into oborot. freq vars=oborot. **************************************************. ***** den 4 **********************************. ***** chete na 4 files ot Excel *****. ***** data1 ******************. GET DATA /TYPE=XLS /FILE='C:\1SPSS\Danni99.xls' /SHEET=name 'data1' /CELLRANGE=full /READNAMES=on /ASSUMEDSTRWIDTH=32767. DATASET NAME $DataSet WINDOW=FRONT. SAVE OUTFILE='C:\1SPSS\data1.sav' /COMPRESSED. freq vars=all. ***** data2 ******************. GET DATA /TYPE=XLS /FILE='C:\1SPSS\Danni99.xls' /SHEET=name 'data2' /CELLRANGE=full /READNAMES=on /ASSUMEDSTRWIDTH=32767. DATASET NAME $DataSet WINDOW=FRONT. SAVE OUTFILE='C:\1SPSS\data2.sav' /COMPRESSED. freq vars=all. ***** data3 ******************. GET DATA /TYPE=XLS /FILE='C:\1SPSS\Danni99.xls' /SHEET=name 'data3' /CELLRANGE=full /READNAMES=on /ASSUMEDSTRWIDTH=32767. DATASET NAME $DataSet WINDOW=FRONT. SAVE OUTFILE='C:\1SPSS\data3.sav' /COMPRESSED. freq vars=all. ***** data4 ******************. GET DATA /TYPE=XLS /FILE='C:\1SPSS\Danni99.xls' /SHEET=name 'data4' /CELLRANGE=full /READNAMES=on /ASSUMEDSTRWIDTH=32767. DATASET NAME $DataSet WINDOW=FRONT. SAVE OUTFILE='C:\1SPSS\data4.sav' /COMPRESSED. freq vars=all. **** vertikalno obedinjavane data1 + data3 ****. add files /file='C:\1SPSS\data1.sav' /file='C:\1SPSS\data3.sav'. **** sortirame ****. sort cases by ID. save outfile='C:\1SPSS\data13.sav'. get file='C:\1SPSS\data13.sav'. freq vars=all. **** vertikalno obedinjavane data2 + data4 ****. add files /file='C:\1SPSS\data2.sav' /file='C:\1SPSS\data4.sav'. **** sortirame ****. sort cases by ID. save outfile='C:\1SPSS\data24.sav'. freq vars=all. ***** horizontalno obedinjavane na data13 + data24 ******. match files /file='C:\1SPSS\data13.sav' /file='C:\1SPSS\data24.sav' /by ID. freq vars=all. save outfile='C:\1SPSS\data1234.sav'. freq vars=all. ******** agregirane *************. get file='C:\1SPSS\HH2.sav'. freq vars=all. AGGREGATE /OUTFILE='C:\1SPSS\aggr.sav' /BREAK=OBL /RZTotal=SUM(P31_1) /RZsr=MEAN(P31_1) /Staj3=MEAN(P3) /NLica=N. get FILE='C:\1SPSS\aggr.sav'. freq vars=all. ***** predpriatia *****. get file='C:\1SPSS\EN2.sav'. freq vars=all. AGGREGATE /OUTFILE='C:\1SPSS\aggr2.sav' /BREAK=Region /ZaetiN=SUM(labor) /OborotN=SUM(turnover) /OborotSr=MEAN(turnover) /NPred=N. get FILE='C:\1SPSS\aggr2.sav'. freq vars=all. ****************************************. **** izchisljavane na suma pri lipsvashti stoinosti ****. get file='C:\1SPSS\data1234.sav'. freq vars=all. compute sum1=sum(x6,x7). freq vars=sum1. compute sum2= x6+x7. freq vars=sum2. list vars= id x6 x7 sum1 sum2. *********************************************************. ***** izlachvane na chisto sluchaina izvadka ******. get file='C:\1SPSS\EN2.sav'. freq vars=all. **** izvadka ot 100 sluchaja ****. DATASET COPY izvadka100. DATASET ACTIVATE izvadka100. FILTER OFF. USE ALL. SAMPLE 100 from 14292. EXECUTE. DATASET ACTIVATE . save outfile='C:\1SPSS\izvadka100.sav'. freq vars=all. **** 1% izvadka ******. get file='C:\1SPSS\EN2.sav'. freq vars=all. DATASET ACTIVATE izvadka100. DATASET COPY izvadka1p. DATASET ACTIVATE izvadka1p. FILTER OFF. USE ALL. SAMPLE .01. EXECUTE. DATASET ACTIVATE izvadka100. save outfile='C:\1SPSS\izvadka1p.sav'. freq vars=all. ***************************************************.