Kezdi.KezdiModule

Kezdi.jl is a Julia package for data manipulation and analysis. It is inspired by Stata, but it is written in Julia, which makes it faster and more flexible. It is designed to be used in the Julia REPL, but it can also be used in Jupyter notebooks or in scripts.

source
Kezdi.DNVMethod
DNV(f(x))

Indicate that the function f should not be vectorized. The name DNV is only used for parsing, do not call it directly.

source
Kezdi.distinctMethod
distinct(x::AbstractVector) = unique(x)

Convenience function to get the distinct values of a vector.

source
Kezdi.getdfMethod
getdf() -> AbstractDataFrame

Return the global data frame.

source
Kezdi.rowcountMethod
rowcount(x::AbstractVector) = length(collect(skipmissing(x)))

Count the number of non-missing values in a vector.

source
Kezdi.setdfMethod
setdf(df::Union{AbstractDataFrame, Nothing})

Set the global data frame.

source
Kezdi.@collapseMacro
@collapse y1 = expr1 y2 = expr2 ... [@if condition], [by(group1, group2, ...)]

Collapse df by evaluating expressions expr1, expr2, etc. If condition is provided, the operation is executed only on rows for which the condition is true. If by is provided, the operation is executed by group.

source
Kezdi.@countMacro
@count if condition]

Count the number of rows for which the condition is true. If condition is not provided, the total number of rows is counted.

source
Kezdi.@dropMacro
@drop y1 y2 ...

or @drop if condition]

Drop the variables y1, y2, etc. from df. If condition is provided, the rows for which the condition is true are dropped.

source
Kezdi.@egenMacro
@egen y1 = expr1 y2 = expr2 ... [@if condition], [by(group1, group2, ...)]

Generate new variables in df by evaluating expressions expr1, expr2, etc. If condition is provided, the operation is executed only on rows for which the condition is true. When the condition is false, the variables will be missing. If by is provided, the operation is executed by group.

source
Kezdi.@generateMacro
@generate y = expr [@if condition]

Create a new variable y in df by evaluating expr. If condition is provided, the operation is executed only on rows for which the condition is true. When the condition is false, the variable will be missing.

source
Kezdi.@headMacro
@head [n]

Display the first n rows of the data frame. By default, n is 5.

source
Kezdi.@keepMacro
@keep y1 y2 ... [@if condition]

Keep only the variables y1, y2, etc. in df. If condition is provided, only the rows for which the condition is true are kept.

source
Kezdi.@orderMacro
@order y1 y2 ... [desc] [last] [after=var] [before=var] [alphabetical]

Reorder the variables y1, y2, etc. in the data frame. By default, the variables are ordered in the order they are listed. If desc is provided, the variables are ordered in descending order. If last is provided, the variables are moved to the end of the data frame. If after is provided, the variables are moved after the variable var. If before is provided, the variables are moved before the variable var. If alphabetical is provided, the variables are ordered alphabetically.

source
Kezdi.@regressMacro
@regress y x1 x2 ... [@if condition], [robust] [cluster(var1, var2, ...)]

Estimate a regression model in df with dependent variable y and independent variables x1, x2, etc. If condition is provided, the operation is executed only on rows for which the condition is true. If robust is provided, robust standard errors are calculated. If cluster is provided, clustered standard errors are calculated.

source
Kezdi.@renameMacro
@rename oldname newname

Rename the variable oldname to newname in the data frame.

source
Kezdi.@replaceMacro
@replace y = expr [@if condition]

Replace the values of y in df with the result of evaluating expr. If condition is provided, the operation is executed only on rows for which the condition is true. When the condition is false, the variable will be left unchanged.

source
Kezdi.@sortMacro
@sort y1 y2 ...

Sort the data frame by the variables y1, y2, etc. in ascending order.

source
Kezdi.@summarizeMacro
@summarize y [@if condition]

Summarize the variable y in df. If condition is provided, the operation is executed only on rows for which the condition is true.

source
Kezdi.@tabulateMacro
@tabulate y1 y2 ... [@if condition]

Create a frequency table for the variables y1, y2, etc. in df. If condition is provided, the operation is executed only on rows for which the condition is true.

source
Kezdi.@tailMacro
@tail [n]

Display the last n rows of the data frame. By default, n is 5.

source
Kezdi.@useMacro
@use "filename.dta"

Read the data from the file filename.dta and set it as the global data frame.

source