Autor da secção: Laiton Hedley

⚡ List of Functions

Below is a list of functions available in jamovi. These functions can be used in the formula editor to create new variables, filter data, and perform a variety of transformations on existing data.

Table 11 Functions available in jamovi

Function

Description

MATH FUNCTIONS

ABS(var)

Absolute value: Returns the absolute value in a column of data.

More info

EXP(var)

Exponential: raises e to the power of each value in a column of data.

More info

LN(var)

Natural logarithm (base e): the natural logarithm (base e) of each value in a column of data.

More info

LOG10(var)

Log base 10: the logarithm (base 10) of each value in a column of data.

More info

SQRT(var)

Square root: the square root of each value in a column of data.

More info

STATISTICAL FUNCTIONS

ABSIQR(var)

Absolute deviation from the median: measures the average absolute deviation of values from the median. Convenience short-hand for ABS(IQR(var)).

More info

ABSZ(var)

Absolute z-score: Convenience short-hand for ABS(Z(var))

More info

BOXCOX(var)

Box Cox: Returns a Box Cox transformation of the variable.

More info

CEILING(var)

Ceiling: returns the smallest integer that is greater than or equal to each value in a column of numbers, effectively rounding up to the nearest whole number.

More info

FLOOR(var)

Floor: returns the greatest integer that is less than each value in a column of numbers, effectively rounding down to the nearest whole number.

More info

IQR(var)

Interquartile Range: Returns values of 0 to indicate a number is within the box of a boxplot and values larger than 1.5 to indicate the number is outside the whiskers.

More info

MAX(var)
MAX(var_1, var_2, ...)
VMAX(var)
VMAX(var, group_by = other_var)

Maximum: identifies the highest value in a row or column of data.

More info

MAXABSIQR(var)

Maximum Absolute Interquartile Range: Convenience short-hand for MAX(ABSIQR( variable 1, variable 2, )).

More info

MAXABSZ(var)

Maximum Absolute Z-Score: Convenience short-hand for MAX(ABSZ( variable 1, variable 2, )).

More info

MEAN(var)
MEAN(var_1, var_2, ...)
VMEAN(var)
VMEAN(var, group_by = other_var)

Mean: Calculate the mean score across a row or column of data.

More info

MIN(var)
MIN(var_1, var_2, ...)
VMIN(var)
VMIN(var, group_by = other_var)

Minimum: identifies the lowest value in a row or column of data.

More info

RANK(var)

Ranking: assigns an ordinal rank to each value in a column of data.

More info

ROUND(var, n)

Rounding: adjusts each value in a column of data to a specified number of decimal places or to the nearest whole number.

More info

SCALE(var)

Scale: Returns the normalized values of a set of numbers - synonym for Z(var).

More info

STDEV(var)
STDEV(var_1, var_2, ...)
VSTDEV(var)
VSTDEV(var, group_by = other_var)

Standard deviation: measures the amount of standard deviation in a row or column of data.

More info

SUM(var)
SUM(var_1, var_2, ...)
VSUM(var)
VSUM(var, group_by = other_var)

Summation: Returns the sum of a row or column of data.

More info

VMAD(var)
VMAD(var, group_by = other_var)

Median Absolute Deviation: Returns the median absolute deviation of a variable.

More info

VMADR(var)
VMADR(var, group_by = other_var)

Robust Median Absolute Deviation: Returns the robust median absolute deviation of a variable.

More info

VMED(var)
VMED(var, group_by = other_var)

Median: Returns the median of a variable.

More info

VMODE(var)
VMODE(var, group_by = other_var)

Mode: Returns the most common value, or mode, in a variable.

More info

VN(var)
VN(var, group_by = other_var)

Sample Size (or n): Returns the number of cases in a variable.

More info

VSE(var)
VSE(var, group_by = other_var)

Standard Error: Returns the standard error of a variable.

More info

VAR(var)
VVAR(var)
VVAR(var, group_by = other_var)

Variance: Returns the variance of a row or column of data.

More info

Z(var)

Z-score: Returns the normalized values of a set of numbers.

More info

LOGICAL FUNCTIONS

IF(var, value, else)

If the expression resolves true, use the value, otherwise the else.

More info

IFMISSING(var, value, else)

When the variable contains a missing value, use the value, otherwise the else.

More info

NOT(var)

Inverts a boolean value: true (1) becomes false (0), false (0) becomes true (1).

More info

TEXT FUNCTIONS

CONTAINS('needle', haystack)

Determines if specificied string of text (i.e. “needle”) appears in the variable (i.e. haystack) and can be expanded to look for multiple strings across one or more variables: CONTAINS('text_1', 'text_2', var_1, var_2).

More info

SPLIT(var, 'by', position)

Splits a string of text in a variable by a specified character (or string of text) and returns only the text at the specified position. For example, the string ParticipantbyP01 using SPLIT(var, 'by', 3) would return P01.

More info

TEXT(var)

Converts values to text format (numbers to strings of text).

More info

VALUE(var)

Converts text (strings) to values (if possible).

More info

DATE/TIME FUNCTIONS

DATEVALUE(var)

Takes a date in text format (i.e. 2000-12-20) and converts to the number of days since the 1st of January, 1970.

More info

DATE(var)

Takes a number representing the number of days since the 1st of January 1970, and produces a formatted date.

More info

REFERENCE FUNCTIONS

HLOOKUP(index, var_1, var_2, ...)

Returns the values in the rows, specified by index, from the provided variables.

More info

MATCH(var, value_1, value_2, ...)

Returns the row index of the variable of interest that matches the value provided.

More info

MISC. FUNCTIONS

COUNT(var)

Counts the number of non-missing values.

More info

FILTER(var, filter expression)

Filters a variable using a filter expression. For example, FILTER(var_1, var_2 == "Group_A") returns only rows in var_1 where var_2 is matched with the label «Group A».

More info

INT(var)

Converts a number to an integer (a positive or negative number without a fractional component).

More info

OFFSET(var, n)

Offsets a column of data up or down by +/- n rows

More info

ROW()

Returns a column with each row indicating the row number.

SAMPLE(var, n)

Draws a random sample of n values from a variable.

More info

VROWS(var)

Returns the number of rows of a variable.

SIMULATION FUNCTIONS

BETA()

Draws samples from a Beta distribution, using the parameters alpha (proportional successes) and beta (proportional failures).

More info

GAMMA()

Draws samples from a Gamma distribution, using the parameters shape (skewness) and scale (spread of data).

More info

NORM()

Draws samples from a Normal (Gaussian) distribution, using the mean (center of the distribution) and standard deviation (spread of the distribution).

More info

UNIF()

Draws samples from a Uniform distribution, providing a minimum value and a maximum value.

More info

Understanding Formulas

In jamovi formulas are constructed using a combination of numbers, variables, values, operators and functions.

Numbers are simply numbers (i.e. 1, 2.5, -3), adding two numbers together performs arithmetic (i.e. 2 + 2 = 4). Variables are referred to by their name (i.e. variable_name) and can be referred to with backticks as well (i.e. `variable name`) - when the variable name contains spaces it is a requirement to use backticks otherwise jamovi will not be able to interpret the formula correctly.

Often we use strings of text in our rows of data to indicate categories or conditions. In jamovi, adding two text values together performs concatenation or rather joins them together (i.e. hello + world = helloworld). Adding numbers and strings of text together, again performs concatenation where by the number is converted to text alogside the string of text (i.e. 2 + apples = 2apples). Values surrounded by ticks are strings of text (i.e. '10').

When using formulas often we may wish to use and and or when performing are logical operations (i.e. IF(var_1 > 5 and var_2 < 10, 'Yes', 'No') and IF(var_1 == 'A' or var_2 == 'B', 'Match', 'No Match')).