title: How to create a new variable in a specific table from multiple conditions in another table
body: <p>I have 2 different tables from 2 different samples, TABLE 1 and TABLE 2(with different number of rows or individuals).  The 2 tables contain the same variables :  AGE (quantitative),  PROVINCE (qualitative with 11 choices), PLACE (urban or rural), AGE AT MARRIAGE, PARITY or number of children (quantitative).<br />
  From TABLE 1, I want to create a new variable (PAR_REF) in  TABLE 2 defined as  the average PARITY achieved by an individual from the same PROVINCE , the same PLACE, with the same AGE and with the same AGE AT MARRIAGE as a woman in TABLE 1. I mean, the values for the new variable I want to create(PAR_RF)in TABLE 2 must be the average PARITY for all individuals having the same characteristics (for the variables AGE, PROVINCE, PLACE, AGE AT MARRIAGE)  in TABLE 1.
  This is what I want to do</p>
  <p><img src="https://i.stack.imgur.com/fxl5E.png" alt="enter image description here" /></p>
  <p>What is the process?</p>