No, unlike in the U.S., you do not need to collect your baggage for Canadian custom and excise inspection and re-check-in. You will be able to through-check your baggage to your final destination PEK. Just an abbreviated passport check at the CBSA connection counter. You will still need to fill out the arrival declaration form which will be given to you inflight prior to landing. You will then proceed to the departure area to wait for your next flight after the passport check.
Please read additional information here:
http://www.aircanada.com/en/travelin...r_us_intl.html
For your return trip from PEK to EWR:
http://www.aircanada.com/en/travelin...r_intl_us.html
Similar arrangements except you will clear US CBP formalities at YVR instead of on arrival at EWR.