% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/download_data_wrds_crsp.R
\name{download_data_wrds_crsp}
\alias{download_data_wrds_crsp}
\title{Download Data from WRDS CRSP}
\usage{
download_data_wrds_crsp(
  dataset = NULL,
  start_date = NULL,
  end_date = NULL,
  type = deprecated(),
  batch_size = 500,
  version = "v2",
  additional_columns = NULL,
  add_ccm_links = FALSE,
  adjust_volume = FALSE
)
}
\arguments{
\item{dataset}{A string specifying the CRSP dataset to download:
"crsp_monthly" or "crsp_daily".}

\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{batch_size}{An optional integer specifying the batch size for
processing daily data, with a default of 500.}

\item{version}{An optional character specifying which CRSP version to
use. "v2" (the default) uses the updated second version of CRSP, and
"v1" downloads the legacy version of CRSP.}

\item{additional_columns}{Additional columns from the CRSP monthly or
daily data as a character vector.}

\item{add_ccm_links}{A logical indicating whether CRSP-Compustat links
should be added automatically using \code{\link[=download_data_wrds_ccm_links]{download_data_wrds_ccm_links()}}.}

\item{adjust_volume}{A logical indicating whether daily CRSP trading
volume data should be adjusted according to Gao & Ritter (2010).}
}
\value{
A data frame containing CRSP stock returns, adjusted for
delistings, along with calculated market capitalization and excess returns
over the risk-free rate. The structure of the returned data frame depends
on the selected dataset.
}
\description{
Downloads and processes stock return data from the CRSP database for a
specified period. Users can choose between monthly and daily datasets.
The function also adjusts returns for delisting and calculates market
capitalization and excess returns over the risk-free rate.
}
\examples{
\dontrun{
crsp_monthly <- download_data_wrds_crsp(
  "crsp_monthly",
  "2020-11-01",
  "2020-12-31"
)
crsp_daily <- download_data_wrds_crsp(
  "crsp_daily",
  "2020-12-01",
  "2020-12-31"
)

# Add additional columns
download_data_wrds_crsp(
  "crsp_monthly",
  "2020-11-01",
  "2020-12-31",
  additional_columns = c("mthvol", "mthvolflg")
)
}
}
\references{
Gao, X., & Ritter, J. R. (2010). The marketing of seasoned equity
offerings. \emph{Journal of Financial Economics}, 97(1), 33-52.
\doi{10.1016/j.jfineco.2010.03.007}
}
\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_compustat}()},
\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}
