English
Source / code snippets

Skalennormierung for Empirische Sozialforschung: The Z-Transformation

 

p.specht

Sozialforscher try Thesen How "Angehörige bildungsferner Schichten or from Gebieten with less purchasing power go seldom Generaldirektor" statistisch To occupy. so moderne Clusterungs- and Korrelationsverfahren but functions, must first The Umfrageskalen (what means bildungsfern, what kaufkraftarm) together wertmäßig vergleichbar made go. as take action to becomes gladly The Z-Spaltennormierung herangezogen, The I testhalber step for step velvet Probe to that better Understand displayed have.
Windowtitle "Spaltenweise z-Normierung to Skalen-Vergleichbarmachung the [n,m]-Erfassungsmatrix of/ one Umfrage"
'(Copyleft) 2015-04 by P. woodpecker, Wien. without each Gewähr!
Windowstyle 24:font 2
Window 0,0-%maxx,%maxy
' size the desired Testmatrix:
Var n&=5:var m&=5
Declare M![n&-1,m&-1],sum!,s![m&-1],Xm![m&-1],D![n&-1,m&-1],txt$
Declare Q![n&-1,m&-1],qs![m&-1],v![m&-1],sigma![m&-1],i&,j&,Z_sp![n&-1,m&-1]
Declare p![m&-1],pz![m&-1],ps![m&-1]'Probevektoren
txt$="     ["+st$(n&)+","+st$(m&)+"]-Testmatrix M, with Zufallswerten belegt"
Randomize

whileloop 0,n&-1:i&=&Loop

    whileloop 0,m&-1:j&=&Loop

        M![i&,j&]=rnd(10000)'rnd()*10^(rnd(53)-18)

    endwhile

endwhile

Probe2:
print:print txt$;

whileloop 0,n&-1:i&=&Loop

    whileloop 0,m&-1:j&=&Loop

        print tab(j&*27);stature$("%g",M![i&,j&]),

    endwhile

endwhile

print
waitinput
txt$="     Zeilenvektor s[] the Spaltensummen of M[,]"

whileloop 0,m&-1:j&=&Loop

    sum!=0

    whileloop 0,n&-1:i&=&Loop

        sum!=sum!+M![i&,j&]

    endwhile

    s![j&]=sum!

endwhile

print:print txt$;

whileloop 0,m&-1:j&=&Loop

    print tab(j&*27);stature$("%g",s![j&]),

endwhile

print
waitinput
txt$="     Zeilenvektor Xm[] the Spaltenmittelwerte"

whileloop 0,m&-1:j&=&Loop

    xm![j&]=s![j&]/n&

endwhile

print:print txt$;

whileloop 0,m&-1:j&=&Loop

    print tab(j&*27);stature$("%g",xm![j&]),

endwhile

print
waitinput
txt$="     Matrix D[,] the on Spaltenmitten zentrierten Spalten"

whileloop 0,m&-1:j&=&Loop

    whileloop 0,n&-1:i&=&Loop

        D![i&,j&]=M![i&,j&]-xm![j&]

    endwhile

endwhile

print:print txt$;

whileloop 0,n&-1:i&=&Loop

    whileloop 0,m&-1:j&=&Loop

        print tab(j&*27);stature$("%g",D![i&,j&]),

    endwhile

endwhile

print
waitinput
txt$="      Probe: amount the Zentrierten values must almost 0 his!"

whileloop 0,m&-1:j&=&Loop

    sum!=0

    whileloop 0,n&-1:i&=&Loop

        sum!=sum!+D![i&,j&]

    endwhile

    p![j&]=sum!

endwhile

print:print txt$;

whileloop 0,m&-1:j&=&Loop

    print tab(j&*27);stature$("%g",p![j&]),

endwhile

print
waitinput
txt$="     Matrix Q the Squares the (Spaltenmittelwert-zentrierten) values D"

Whileloop 0,m&-1:j&=&Loop

    whileloop 0,n&-1:i&=&Loop

        Q![i&,j&]=sqr(D![i&,j&])

    endwhile

endwhile

print:print txt$;

whileloop 0,n&-1:i&=&Loop

    whileloop 0,m&-1:j&=&Loop

        print tab(j&*27);stature$("%g",Q![i&,j&]),

    endwhile

endwhile

print
waitinput
txt$="     Zeilenvektor qs[] the Spaltensummen of Q[,]"

whileloop 0,m&-1:j&=&Loop

    sum!=0

    whileloop 0,n&-1:i&=&Loop

        sum!=sum!+Q![i&,j&]

    endwhile

    qs![j&]=sum!

endwhile

print:print txt$;

whileloop 0,m&-1:j&=&Loop

    print tab(j&*27);stature$("%g",qs![j&]),

endwhile

print
waitinput
txt$="     Zeilenvektor v[] the Spaltenvarianzen of D[,]"

whileloop 0,m&-1:j&=&Loop

    v![j&]=qs![j&]/n&

endwhile

print:print txt$;

whileloop 0,m&-1:j&=&Loop

    print tab(j&*27);stature$("%g",v![j&]),

endwhile

print
waitinput
txt$="     Zeilenvektor sigma[] the Split-Standardabweichungen of D[,]"

whileloop 0,m&-1:j&=&Loop

    'case sigma![j&]<>0
    sigma![j&]=sqrt(v![j&])

endwhile

print:print txt$;

whileloop 0,m&-1:j&=&Loop

    print tab(j&*27);stature$("%g",sigma![j&]),

endwhile

print
waitinput
txt$="     Ergebnismatrix Z_sp the spaltenweise z-normierten values the Originalmatrix M"

Whileloop 0,m&-1:j&=&Loop

    whileloop 0,n&-1:i&=&Loop

        if sigma![j&]<>0

            Z_sp![i&,j&]=D![i&,j&]/Sigma![j&]
            'else
            '  print "********** Sigma[";str$(j&);"]=0 ignored! ***************":beep:waitinput
            '  Z_sp![i&,j&]=D![i&,j&]

        endif

    endwhile

endwhile

:::::::::::::::::::cls
print:print txt$;

whileloop 0,n&-1:i&=&Loop

    whileloop 0,m&-1:j&=&Loop

        print tab(j&*27);stature$("%g",Z_sp![i&,j&]),

    endwhile

endwhile

print
waitinput
txt$="      Probe 1: amount the Z-normierten Spaltenwerte must near 0 his!"

whileloop 0,m&-1:j&=&Loop

    sum!=0

    whileloop 0,n&-1:i&=&Loop

        sum!=sum!+Z_sp![i&,j&]

    endwhile

    pz![j&]=sum!

endwhile

print:print txt$;

whileloop 0,m&-1:j&=&Loop

    print tab(j&*27);stature$("%g",pz![j&]),

endwhile

print
waitinput
print
print "     Probe 2: The Standardabweichung the Spaltenwerte of Z_sp[,] must 1 yield."
print "     moreover becomes Z_sp in M loaded and the program over again launched!            "
waitinput

whileloop 0,m&-1:j&=&Loop

    whileloop 0,n&-1:i&=&Loop

        M![i&,j&]=Z_sp![i&,j&]

    endwhile

endwhile

txt$="     The ["+st$(n&)+","+st$(m&)+"]-Testmatrix M is now with the Z-normierten Values occupied."
cls
GOTO "Probe2"
END
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/19/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

870 Views

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie