% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/download_data_wrds_compustat.R
\name{download_data_wrds_compustat}
\alias{download_data_wrds_compustat}
\title{Download Data from WRDS Compustat}
\usage{
download_data_wrds_compustat(
  dataset = NULL,
  start_date = NULL,
  end_date = NULL,
  type = deprecated(),
  additional_columns = NULL,
  only_us = FALSE
)
}
\arguments{
\item{dataset}{The dataset to download ("compustat_annual" or
"compustat_quarterly").}

\item{start_date}{Optional. A character string or Date object in
"YYYY-MM-DD" format specifying the start date for the data. If not
provided, a subset of the dataset is returned.}

\item{end_date}{Optional. A character string or Date object in "YYYY-MM-DD"
format specifying the end date for the data. If not provided, a subset of
the dataset is returned.}

\item{type}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{dataset} instead.}

\item{additional_columns}{Additional columns from the Compustat table as a
character vector.}

\item{only_us}{A logical indicating whether only US firms should be returned.}
}
\value{
A data frame with financial data for the specified period,
including variables for book equity (be), operating profitability (op),
investment (inv), and others.
}
\description{
Downloads financial data from the WRDS Compustat database for a given
dataset, start date, and end date. It filters the data according to industry
format, data format, and consolidation level, and returns the most current
data for each reporting period. Additionally, the annual data also includes
the calculated book equity (be), operating profitability (op), and
investment (inv) for each company following Fama & French (1993, 2015), as
well as income before extraordinary items (ib).
}
\examples{
\dontrun{
download_data_wrds_compustat("compustat_annual", "2020-01-01", "2020-12-31")
download_data_wrds_compustat(
  "compustat_quarterly",
  "2020-01-01",
  "2020-12-31"
)

  # Add additional columns
download_data_wrds_compustat(
  "compustat_annual",
  additional_columns = c("aodo", "aldo")
)
}
}
\references{
Fama, E. F., & French, K. R. (1993). Common risk factors in the returns on
stocks and bonds. \emph{Journal of Financial Economics}, 33(1), 3-56.
\doi{10.1016/0304-405X(93)90023-5}

Fama, E. F., & French, K. R. (2015). A five-factor asset pricing model.
\emph{Journal of Financial Economics}, 116(1), 1-22.
\doi{10.1016/j.jfineco.2014.10.010}
}
\seealso{
Other WRDS functions: 
\code{\link{create_wrds_dummy_database}()},
\code{\link{disconnect_connection}()},
\code{\link{download_data_wrds}()},
\code{\link{download_data_wrds_ccm_links}()},
\code{\link{download_data_wrds_crsp}()},
\code{\link{download_data_wrds_fisd}()},
\code{\link{download_data_wrds_trace_enhanced}()},
\code{\link{get_wrds_connection}()},
\code{\link{set_wrds_credentials}()}
}
\concept{WRDS functions}
