Public railroad stocks can be especially attractive in a growth economy. Few industries are as closely tied to economic growth as those involved in moving goods and commodities. Railroad stocks have seen some volatility over the past few years, due in part to the falling fortune of coal, which accounts for nearly 40% of America's railroad tonnage. Declining oil and gas production, as well as the increasing use of pipelines over railways, also hurt the industry. (See also: A Primer on the Railroad Industry.)

However, depressed prices may provide an opportunity for value investors to enter this space, taking their cues from Warren Buffett and even Bill Gates, both of whom are heavily invested in railroads. Buffett's Berkshire Hathaway acquired Burlington Northern Santa Fe in 2009, and Gates holds a significant stake in Canadian National Railway Company.

Railroads transport the vast majority of major industrial and consumer goods, so railroad companies are very sensitive to movements in the economy. A growing economy could point to growth in public railroad stocks. If you are looking for exposure to this sector, here are the four largest North American railroad stocks for 2018.

Note: All figures are as of Feb. 9, 2018.

Union Pacific Corporation (UNP)

This is the granddaddy of American railways. Established in 1862, it now has a market cap of $96 billion. It is the supply chain link for much of the western United States, connecting approximately two-thirds of the country – and some 20 states – by rail. It operates roughly 9,000 locomotives and connects the Canadian rail lines with the Gulf of Mexico. Its rail network covers around 32,000 miles.

Union Pacific has reported revenue of $21.2 billion for the 12 months ended Dec. 31, 2017, and has trailing 12-month earnings per share of $13.36. It currently trades at $121.94, down 9.5% in 2018. Target prices for the stock range up to $165, and it has a 52-week range of $101.06 and $143.05.

Canadian National Railway Company (CNI)

Canadian National has a market cap of $54.05 billion. Although it is technically a Canadian railway, it operates 20,000 miles of track across the United States and Canada, connecting the Atlantic and Pacific Oceans and the Gulf of Mexico. It moves freight for several major commodities groups – including oil, liquid natural gas and chemicals – and it has access to all the NAFTA countries.

The company has trailing 12-month revenue of $10.05 billion and earnings per share of $5.79. It currently trades at $74.25, with a 52-week range of $69.73 to $85.73. The high estimate for the stock is $93.63. In 2017, it gained 16.21%. (See also: This Is What Bill Gates' Portfolio Looks Like.)

CSX Corporation (CSX)

CSX has a market cap of $43.66 billion and operating income of $3.9 billion over the 12 months ended Dec. 31, 2017. The Florida-based company operates mainly on the East Coast and is the third largest Class I railroad. The company operates in three main areas – merchandise, intermodal and coal – and it handles domestic coal shipments to power plants, as well as exports to deep-water port facilities. Its merchandise line transports food, agricultural, automotive and forest products, among other goods.

CSX currently trades at $48.76, with a 52-week trading range of $45.41 to $60.04. The high price target for the stock is $72. It has lost 2% over the past year.

Norfolk Southern (NSC)

Norfolk Southern has a market cap of $37.64 billion. Revenue for the 12 months ended Dec. 31, 2017, was $10.55 billion. Norfolk Southern is a railroad transportation business incorporated in August 2009. It has its headquarters in Norfolk, Va. The company operates approximately 19,500 miles of railroad in the United States, with services primarily in the Southeast, East and Midwest. Its industrial railways connect with ports, manufacturing plants, electric generating facilities, mines and other distribution centers in the United States. It transports a range of goods including lumber, livestock, commodities, chemicals, consumer products, metals and automotive vehicles.

NSC currently trades at $135.48, with a 52-week trading range of $109.27 to $157.15. Price target for the stock varies considerably by analyst, ranging from $100 to $165. In 2017, it gained 29.77%.