OpenBI Docs Buy

PCA.LOADINGS OpenBI

Principal components' loadings: how much each variable weighs in each.

Group: Many variables at once. OpenBI’s own: DAX has no function of this name.

Syntax

PCA.LOADINGS ( <table>, <name1>, <expression1>, <name2>, <expression2> [, <name3>, <expression3>] … )
ParameterTypeDescription
tableTableThe rows to analyse: a table of the model or any table expression.
name1TextThe first variable's name, a text in quotes.
expression1Expression
evaluated for each row
The first variable's number for each row.
name2Text
repeatable
The next variable's name; two or more variables in all.
expression2Expression
repeatable, evaluated for each row
The next variable's number for each row.

Returns

Table. A row a variable: Variable, then PC1, PC2 … with the variable's weight in each component.

Remarks

  • The weights say what a component is made of: a large weight, positive or negative, means the variable counts for much in it. Variables whose weights share a sign move together along it.
  • Each component's weights have squares that add up to 1. Their sign is set so that the largest weight is positive; R's prcomp may show a component with every sign the other way, which is the same component.
  • A weight times the square root of its component's eigenvalue (Std deviation in PCA.COMPONENTS) is the variable's correlation with the component.
  • Every variable is first put on one scale: how many standard deviations each row lies above or below that variable's mean. Liters and kroner then weigh alike, and a change of units changes nothing.
  • A row where any variable is blank is left out. A variable must be a number on every row (text is an error, even text that reads as a number), and one that is the same on every row is an error too.

Compared with DAX

An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.

Examples

What the beers' components are made of

PC1 weighs the three alike: it is "more of everything". PC2 sets bitterness against strength.

EVALUATE
VAR Beers =
    DATATABLE (
        "Beer", STRING, "Strength", DOUBLE, "Bitterness", INTEGER, "Price", INTEGER,
        {
            { "Lettøl", 2.5, 15, 30 }, { "Pils", 4.7, 25, 38 }, { "Lager", 5.0, 22, 40 },
            { "Pale ale", 5.5, 40, 55 }, { "IPA", 6.5, 65, 64 }, { "Stout", 7.0, 45, 70 }
        }
    )
RETURN
    PCA.LOADINGS ( Beers, "Strength", [Strength], "Bitterness", [Bitterness], "Price", [Price] )
VariablePC1PC2PC3
Strength0.57636205031225-0.597797524300152-0.557175831224282
Bitterness0.5656778695828190.783912919769902-0.255908347034775
Price0.589758708985382-0.1676861776010070.789978487692836

Countries

PC1 is size (people and GDP); PC2 is mostly GDP per person.

EVALUATE
PCA.LOADINGS ( Countries, "People", Countries[People], "GDP", Countries[GDP], "GDP per person", [GDP per person] )
VariablePC1PC2PC3
People0.664788883296279-0.364224850356616-0.652223887195483
GDP0.7154355837580260.05918487509397260.696167419557195
GDP per person0.2149596849144010.929428538911309-0.299924865455817

PCA.COMPONENTS, PCA.SCORES, CORREL.

Last updated · OpenBI Studio 0.3.74