*----------------------------------------------------------* * EUROPAN FEMALE PATENTING IN THE NINETEENTH CENTURY: A COUNTRY-TIME COMPARISSON* * CARLOS LAMELA FERRÍN* * MEDEG 2026 * *----------------------------------------------------------* *Lets do some cleaning first clear all cd "C:\Users\Carlos\OneDrive - Universidad Carlos III de Madrid\Escritorio\25-26 Course\TFM\Data\Patenting\Stata" capture log close log using TFM.log, replace **# IMPORT FRENCH DATA import excel "C:\Users\Carlos\OneDrive - Universidad Carlos III de Madrid\Escritorio\25-26 Course\TFM\Data\Patenting\Excel\french_patents_gender_1791_1899.xlsx", sheet("Sheet1") firstrow // We have imported the French data, time to clean it label variable year "Year of patent" label variable decade "Deacade of the year of patent" label variable patent_title "Patent title (in French)" label variable patent_duration_type "Type of patent, based on its duration" // We can create a categorical variable from this one * Lets recode the patent duration variable into a dummy gen patent_duration=0 if patent_duration_type=="Brevet d'invention de 5 ans" replace patent_duration=1 if patent_duration==. label variable patent_duration "Patent duration dummy" label variable n_inventors "Number of inventors" label variable n_male "Number of male inventors" label variable n_female "Number of female inventors" drop n_unknown // Its literally a 0 for all observations label variable has_female_inventor "Female inventor dummy" rename has_female_inventor female_dummy label variable female_share "Share of women participating in patent" drop gender_fully_resolved // Its literally a 1 for all observations label variable has_married_woman "Married woman dummy" rename has_married_woman married_dummy label variable has_widow "Widowed woman dummy" rename has_widow widow_dummy label variable has_spinster "Never married woman dummy (at least one of the patentees)" rename has_spinster spinster_dummy replace spinster_dummy=1 if widow_dummy==0 & married_dummy==0 & female_dummy==1 label variable inventor_countries "Countries of the inventors adress found in the patent" label variable country_origin "Country of origin of the patent (the patent could be filled in abother country, not France, and Frace recognices it)" label variable gender_inv_1 "Gender of the first person mentioned in the patent" label variable occupation_inv_1 "Occupation of the first person mentioned in the patent" label variable country_inv_1 "Country of origin of the first person mentioned in the patent" label variable marital_stat_inv_1 "Marital status of the first person mentioned in the patent" label variable gender_inv_2 "Gender of the second person mentioned in the patent" label variable occupation_inv_2 "Occupation of the second person mentioned in the patent" label variable country_inv_2 "Country of origin of the second person mentioned in the patent" label variable marital_stat_inv_2 "Marital status of the second person mentioned in the patent" label variable gender_inv_3 "Gender of the third person mentioned in the patent" label variable occupation_inv_3 "Occupation of the third person mentioned in the patent" label variable country_inv_3 "Country of origin of the third person mentioned in the patent" label variable marital_stat_inv_3 "Marital status of the third person mentioned in the patent" label variable gender_inv_4 "Gender of the fourth person mentioned in the patent" label variable occupation_inv_4 "Occupation of the fourth person mentioned in the patent" label variable country_inv_4 "Country of origin of the fourth person mentioned in the patent" label variable marital_stat_inv_4 "Marital status of the fourth person mentioned in the patent" label variable gender_inv_5 "Gender of the fifth person mentioned in the patent" label variable occupation_inv_5 "Occupation of the fifth person mentioned in the patent" label variable country_inv_5 "Country of origin of the fifth person mentioned in the patent" label variable marital_stat_inv_5 "Marital status of the fifth person mentioned in the patent" label variable gender_inv_6 "Gender of the sixth person mentioned in the patent" label variable occupation_inv_6 "Occupation of the sixth person mentioned in the patent" label variable country_inv_6 "Country of origin of the sixth person mentioned in the patent" label variable marital_stat_inv_6 "Marital status of the sixth person mentioned in the patent" label variable gender_inv_7 "Gender of the seventh person mentioned in the patent" label variable occupation_inv_7 "Occupation of the seventh person mentioned in the patent" label variable country_inv_7 "Country of origin of the seventh person mentioned in the patent" label variable marital_stat_inv_7 "Marital status of the seventh person mentioned in the patent" label variable gender_inv_8 "Gender of the eighth person mentioned in the patent" label variable occupation_inv_8 "Occupation of the eighth person mentioned in the patent" label variable country_inv_8 "Country of origin of the eighth person mentioned in the patent" label variable marital_stat_inv_8 "Marital status of the eighth person mentioned in the patent" label variable gender_inv_9 "Gender of the ninth person mentioned in the patent" label variable occupation_inv_9 "Occupation of the ninth person mentioned in the patent" label variable country_inv_9 "Country of origin of the ninth person mentioned in the patent" label variable marital_stat_inv_9 "Marital status of the ninth person mentioned in the patent" label variable gender_inv_10 "Gender of the tenth person mentioned in the patent" label variable occupation_inv_10 "Occupation of the tenth person mentioned in the patent" label variable country_inv_10 "Country of origin of the tenth person mentioned in the patent" label variable marital_stat_inv_10 "Marital status of the tenth person mentioned in the patent" label variable gender_inv_11 "Gender of the eleventh person mentioned in the patent" label variable occupation_inv_11 "Occupation of the eleventh person mentioned in the patent" label variable country_inv_11 "Country of origin of the eleventh person mentioned in the patent" label variable marital_stat_inv_11 "Marital status of the eleventh person mentioned in the patent" label variable gender_inv_12 "Gender of the twelfth person mentioned in the patent" label variable occupation_inv_12 "Occupation of the twelfth person mentioned in the patent" label variable country_inv_12 "Country of origin of the twelfth person mentioned in the patent" label variable marital_stat_inv_12 "Marital status of the twelfth person mentioned in the patent" * We just cleaned all the data, lets save the French data on its own data file save French_data.dta, replace **# IMPORT ENGLISH DATA clear all import excel "C:\Users\Carlos\OneDrive - Universidad Carlos III de Madrid\Escritorio\25-26 Course\TFM\Data\Patenting\Excel\british_patents_gender_1617_1899.xlsx", sheet("Sheet1") firstrow // We have imported the Englsih data, time to clean it label variable year "Year of patent" label variable decade "Decade of the year patent" label variable patent_title "Patent title (in French)" label variable n_inventors "Number of inventors" label variable n_male "Number of male inventors" label variable n_female "Number of female inventors" label variable n_unknown "Number of inventors of unknown gender" label variable has_female_inventor "Female inventor dummy" rename has_female_inventor female_dummy label variable female_share "Share of female inventors in patent" label variable gender_fully_resolved "Status of gender assignment task (1 if not fully resolved)" label variable has_married_woman "Married woman dummy" rename has_married_woman married_dummy label variable has_widow "Widowed woman dummy" rename has_widow widow_dummy label variable has_spinster "Never married woman dummy (at least one of the patentees)" replace has_spinster=1 if widow_dummy==0 & married_dummy==0 & female_dummy==1 label variable inventor_countries "Countries of the inventors adress found in the patent" rename inventor_countries country label variable name_inv_1 "Name of the first person mentioned in the patent" label variable gender_inv_1 "Gender of the first person mentioned in the patent" label variable occupation_inv_1 "Occupation of the first person mentioned in the patent" label variable address_inv_1 "Address of the first person mentioned in the patent" label variable country_inv_1 "Country of origin of the first person mentioned in the patent" label variable marital_stat_inv_1 "Marital status of the first person mentioned in the patent" label variable name_inv_2 "Name of the second person mentioned in the patent" label variable gender_inv_2 "Gender of the second person mentioned in the patent" label variable occupation_inv_2 "Occupation of the second person mentioned in the patent" label variable address_inv_2 "Address of the second person mentioned in the patent" label variable country_inv_2 "Country of origin of the second person mentioned in the patent" label variable marital_stat_inv_2 "Marital status of the second person mentioned in the patent" label variable name_inv_3 "Name of the third person mentioned in the patent" label variable gender_inv_3 "Gender of the third person mentioned in the patent" label variable occupation_inv_3 "Occupation of the third person mentioned in the patent" label variable address_inv_3 "Address of the third person mentioned in the patent" label variable country_inv_3 "Country of origin of the third person mentioned in the patent" label variable marital_stat_inv_3 "Marital status of the third person mentioned in the patent" label variable name_inv_4 "Name of the fourth person mentioned in the patent" label variable gender_inv_4 "Gender of the fourth person mentioned in the patent" label variable occupation_inv_4 "Occupation of the fourth person mentioned in the patent" label variable address_inv_4 "Address of the fourth person mentioned in the patent" label variable country_inv_4 "Country of origin of the fourth person mentioned in the patent" label variable marital_stat_inv_4 "Marital status of the fourth person mentioned in the patent" label variable name_inv_5 "Name of the fifth person mentioned in the patent" label variable gender_inv_5 "Gender of the fifth person mentioned in the patent" label variable occupation_inv_5 "Occupation of the fifth person mentioned in the patent" label variable address_inv_5 "Address of the fifth person mentioned in the patent" label variable country_inv_5 "Country of origin of the fifth person mentioned in the patent" label variable marital_stat_inv_5 "Marital status of the fifth person mentioned in the patent" label variable name_inv_6 "Name of the sixth person mentioned in the patent" label variable gender_inv_6 "Gender of the sixth person mentioned in the patent" label variable occupation_inv_6 "Occupation of the sixth person mentioned in the patent" label variable address_inv_6 "Address of the sixth person mentioned in the patent" label variable country_inv_6 "Country of origin of the sixth person mentioned in the patent" label variable marital_stat_inv_6 "Marital status of the sixth person mentioned in the patent" label variable name_inv_7 "Name of the seventh person mentioned in the patent" label variable gender_inv_7 "Gender of the seventh person mentioned in the patent" label variable occupation_inv_7 "Occupation of the seventh person mentioned in the patent" label variable address_inv_7 "Address of the seventh person mentioned in the patent" label variable country_inv_7 "Country of origin of the seventh person mentioned in the patent" label variable marital_stat_inv_7 "Marital status of the seventh person mentioned in the patent" label variable name_inv_8 "Name of the eigth person mentioned in the patent" label variable gender_inv_8 "Gender of the eighth person mentioned in the patent" label variable occupation_inv_8 "Occupation of the eighth person mentioned in the patent" label variable address_inv_8 "Address of the eigth person mentioned in the patent" label variable country_inv_8 "Country of origin of the eighth person mentioned in the patent" label variable marital_stat_inv_8 "Marital status of the eighth person mentioned in the patent" label variable name_inv_9 "Name of the ninth person mentioned in the patent" label variable gender_inv_9 "Gender of the ninth person mentioned in the patent" label variable occupation_inv_9 "Occupation of the ninth person mentioned in the patent" label variable address_inv_9 "Address of the ninth person mentioned in the patent" label variable country_inv_9 "Country of origin of the ninth person mentioned in the patent" label variable marital_stat_inv_9 "Marital status of the ninth person mentioned in the patent" label variable name_inv_10 "Name of the tenth person mentioned in the patent" label variable gender_inv_10 "Gender of the tenth person mentioned in the patent" label variable occupation_inv_10 "Occupation of the tenth person mentioned in the patent" label variable address_inv_10 "Address of the tenth person mentioned in the patent" label variable country_inv_10 "Country of origin of the tenth person mentioned in the patent" label variable marital_stat_inv_10 "Marital status of the tenth person mentioned in the patent" label variable name_inv_11 "Name of the eleventh person mentioned in the patent" label variable gender_inv_11 "Gender of the eleventh person mentioned in the patent" label variable occupation_inv_11 "Occupation of the eleventh person mentioned in the patent" label variable address_inv_11 "Address of the eleventh person mentioned in the patent" label variable country_inv_11 "Country of origin of the eleventh person mentioned in the patent" label variable marital_stat_inv_11 "Marital status of the eleventh person mentioned in the patent" label variable name_inv_12 "Name of the twelfth person mentioned in the patent" label variable gender_inv_12 "Gender of the twelfth person mentioned in the patent" label variable occupation_inv_12 "Occupation of the twelfth person mentioned in the patent" label variable address_inv_12 "Address of the twelfth person mentioned in the patent" label variable country_inv_12 "Country of origin of the twelfth person mentioned in the patent" label variable marital_stat_inv_12 "Marital status of the twelfth person mentioned in the patent" label variable name_inv_13 "Name of the thirteenth person mentioned in the patent" label variable gender_inv_13 "Gender of the thirteenth person mentioned in the patent" label variable occupation_inv_13 "Occupation of the thirteenth person mentioned in the patent" label variable address_inv_13 "Address of the thirteenth person mentioned in the patent" label variable country_inv_13 "Country of origin of the thirteenth person mentioned in the patent" label variable marital_stat_inv_13 "Marital status of the thirteenth person mentioned in the patent" label variable name_inv_14 "Name of the fourteenth person mentioned in the patent" label variable gender_inv_14 "Gender of the fourteenth person mentioned in the patent" label variable occupation_inv_14 "Occupation of the fourteenth person mentioned in the patent" label variable address_inv_14 "Address of the fourteenth person mentioned in the patent" label variable country_inv_14 "Country of origin of the fourteenth person mentioned in the patent" label variable marital_stat_inv_14 "Marital status of the fourteenth person mentioned in the patent" label variable name_inv_15 "Name of the fifteenth person mentioned in the patent" label variable gender_inv_15 "Gender of the fifteenth person mentioned in the patent" label variable occupation_inv_15 "Occupation of the fifteenth person mentioned in the patent" label variable address_inv_15 "Address of the fifteenth person mentioned in the patent" label variable country_inv_15 "Country of origin of the fifteenth person mentioned in the patent" label variable marital_stat_inv_15 "Marital status of the fifteenth person mentioned in the patent" * Before saving the data, we can extend the categorical variable of patent duration to the minimal length of extension with the initial payment granted by the government, and see if it could have any effect. generate patent_duration=1 if year<1852 replace patent_duration=0 if patent_duration==. label variable patent_duration "Patent duration dummy" * We just cleaned all the data, lets save the English data on its own data file save English_data.dta, replace * Now, we keep the English patents in the same range of years as the French ones (1791-1899) keep if inrange(year,1791,1899) save English_data.dta, replace * There is one entry in the English patent database whose patent_id does not follow the same coding as the rest of the entries. In order to avoid conflict with the French data when merging, I will change that patent ID and create a new entry for the correspondent year. Since the patent we are talking about (patent_id=="103") is from 1875, it gets entry GB187504562 replace patent_id="GB187504562" if patent_id=="103" save English_data.dta, replace **# COMBINING DATASETS generate English=1 label variable English "The patent comes from the English data" save English_data.dta, replace rename has_spinster spinster_dummy clear all use French_data.dta generate French=1 label variable French "The patent comes from the French data" tostring patent_id, replace append using English_data.dta, force replace French=0 if French==. replace English=0 if English==. generate F_reform=1 if French==1 & year>=1844 replace F_reform=0 if F_reform==. label variable F_reform "The entries from the French data come from after the reform of 1844" generate UK_reform=1 if French==0 & year>=1883 replace UK_reform=0 if UK_reform==. label variable UK_reform "The entries from the UK data come from after the reform of 1883" * Now, we have a combined dataset of all patents in both England and France in the XIX century, lets save it save TFM.dta, replace **#DESCRIPTIVE ANALYSIS: COUNTS AND GROWTH * The idea is to create the graph with the counting the number of patent with women for both countries, showing the reform years (1844 and 1883) * First, lets collapse to year-country level collapse (sum) female_patentes=female_dummy (count) total_patents=female_dummy, by (year French) * Lets calculate the percentages generate female_pct=(female_patentes/total_patents)*100 label define country_label 0 "United Kingdom" 1 "France" label values French country_label * Now, lets save the dataset save counts.dta, replace * Lets proceed with the graphs, first the count twoway /// (line female_patentes year if French==1, lcolor(navy) lwidth(medthin)) /// (line female_patentes year if French==0, lcolor(cranberry) lwidth(medthin) lpattern(dash)) /// , xline(1844, lcolor(navy) lpattern(shortdash) lwidth(thin)) /// xline(1883, lcolor(cranberry) lpattern(shortdash) lwidth(thin)) /// legend(order(1 "France" 2 "United Kingdom") position(11) ring(0)) /// xtitle("Year") ytitle("Number of patents with female inventors") /// title("Female Patenting Activity, 1800–1899") /// subtitle("Absolute count of patents with at least one female inventor") /// note("Dashed vertical lines indicate major patent reforms: France (1844, navy) and United Kingdom (1883, red).") /// scheme(s2mono) graphregion(color(white)) graph export "gender_count.pdf", replace * Finally lets go back to the main database save counts.dta, replace clear all use TFM.dta, replace **#DESCRIPTIVE ANALYSIS: PIE CHART * The best graphical way to showcase the share of female patenting overall in both countries through the whole period can is with a pie chart. use French_data.dta, replace count if female_dummy == 1 local female_fr = r(N) count if female_dummy == 0 local male_fr = r(N) preserve use English_data.dta, replace count if female_dummy == 1 local female_uk = r(N) count if female_dummy == 0 local male_uk = r(N) restore graph pie, over(female_dummy) /// plabel(_all percent, format(%4.1f) size(medium) color(white)) /// pie(1, color(navy)) /// pie(2, color(ltblue)) /// legend(order(1 "No female participation" 2 "With female participation") position(6) size(small)) /// title("France") /// scheme(s2mono) graphregion(color(white)) /// name(pie_france, replace) * Switch to UK data use English_data.dta, replace graph pie, over(female_dummy) /// plabel(_all percent, format(%4.1f) size(medium) color(white)) /// pie(1, color(cranberry)) /// pie(2, color(pink)) /// legend(order(1 "No female participation" 2 "With female participation") position(6) size(small)) /// title("United Kingdom") /// scheme(s2mono) graphregion(color(white)) /// name(pie_uk, replace) * Combine both pies graph combine pie_france pie_uk, /// title("Share of Patents with Female Inventors, 1791–1899") /// scheme(s2mono) graphregion(color(white)) /// iscale(0.8) ysize(5) xsize(9) graph export "graph_pie_female.pdf", replace * Lets go back to the main dataset save English_data.dta, replace clear all use TFM.dta, replace **#DESCRIPTIVE ANALYSIS: GROWTH RATES * Lets try and see the growth rates for both countries trhough the whole period. collapse (sum) female_patents=female_dummy, by(year French) sort French year by French: gen growth_rate=((female_patents-female_patents[_n-1])/female_patents[_n-1])*100 twoway /// (line growth_rate year if French==1, lcolor(navy) lwidth(medthin)) /// (line growth_rate year if French==0, lcolor(cranberry) lwidth(medthin)) /// , xline(1844, lcolor(navy) lpattern(shortdash) lwidth(thin)) /// xline(1883, lcolor(cranberry) lpattern(shortdash) lwidth(thin)) /// yline(0, lcolor(black) lwidth(thin)) /// legend(order(1 "France" 2 "United Kingdom") position(11) ring(0)) /// xtitle("Year") ytitle("Year-on-year growth rate (%)") /// title("Growth Rate of Female Patenting, 1800–1899") /// subtitle("Annual percentage change in patents with at least one female inventor") /// note("Vertical lines: French reform (1844) and UK reform (1883).") /// scheme(s2mono) graphregion(color(white)) graph export "growth_rate.pdf", replace * Lets seave the resulting dataset save "growth_rates.dta", replace clear all use TFM.dta, replace **#DESCRIPTIVE ANALYSIS: GENDER GAP * The strategy is to collapse the dataset into a file with a gender gap ratio per year per country, and from them create the graph with cutoff years in 1844 (France) and 1883 (UK). * First thing, lets collapse the dataset collapse (sum) female_patents=female_dummy (count) total_patents=female_dummy, by(year French) * Now, we calculate the gender gap of each year in each country gen gender_gap=(female_patents/total_patents)*100 * Lets reshape the dataset so it is more clear drop female_patents total_patents reshape wide gender_gap, i(year) j(French) rename gender_gap0 gender_gap_UK rename gender_gap1 gender_gap_France * Now we can save the resulting dataset save Gender_gap.dta, replace * We can now make a graph for the thesis twoway (line gender_gap_UK year, lcolor(cranberry)) /// (line gender_gap_France year, lcolor(navy)), /// xline(1844 1883, lpattern(dash) lcolor(black)) /// legend(label(1 "UK") label(2 "France")) /// title("Gender Gap in Patents: France vs UK (XIX Century)") /// xtitle("Year") ytitle("Gender Gap (%)") scheme(s2mono)graphregion(color(white)) graph export "gender_gap.pdf", replace * Now that we have the desired graph, lets close this file and open the main data file save Gender_gap.dta, replace clear all use TFM.dta, replace **# DESCRIPTIVE ANALYSIS: SHARE OF WOMEN * The strategy is similar, lets get a database with an entry per country per year with the share of women in all mixed gender patenting teams, and then get a graph with the same cutoff years (1844 and 1883). * First we need to collapse the dataset collapse (sum) total_inventors=n_inventors (sum) total_female=n_female, by(year French) * Now, we can calculate the shares gen female_share=(total_female/total_inventors)*100 * And we reshpe it drop total_female total_inventors reshape wide female_share, i(year) j(French) rename female_share0 UK_female_share rename female_share1 France_female_share * Lets save this dataset save Female_share.dta, replace * And finally, we can make the graph twoway (line UK_female_share year, lcolor(blue)) /// (line France_female_share year, lcolor(red)), /// xline(1844 1883, lpattern(dash) lcolor(black)) /// legend(label(1 "UK") label(2 "France")) /// title("Share of women parenting: France vs UK (XIX Century)") /// xtitle("Year") /// ytitle("Female Share (%)") graph export "female_share.pdf", replace * Finally, lets just go back to the main file save Female_share.dta, replace clear all use TFM.dta, replace **# DESCRIPTIVE ANALYSIS: MARITAL STATUS * So, here we have three different graphs to make, one for the share of women patenting that are married, that are widowed,a nd that have never married. In all graphs, same cutoffs. * First things first, we need to collapse collapse (sum) married=married_dummy (sum) widows=widow_dummy (sum) spinsters=has_spinster (sum) total=female_dummy, by(year French) * Now we calculate the shares gen married_share=(married/total)*100 replace married_share=0 if married_share==. gen widow_share=(widows/total)*100 replace widow_share=0 if widow_share==. gen spinster_share=(spinsters/total)*100 replace spinster_share=0 if spinster_share==. * Lets reshape the dataset drop married widows spinsters total reshape wide married_share widow_share spinster_share, i(year) j(French) rename married_share0 UK_married_share rename widow_share0 UK_widow_share rename spinster_share0 UK_spinster_share rename married_share1 France_married_share rename widow_share1 France_widow_share rename spinster_share1 France_spinster_share * Now we save this dataset save Marital_status.dta, replace * Time to make graphs twoway (line UK_married_share year, lcolor(cranberry)) /// (line France_married_share year, lcolor(navy)), /// xline(1844 1883, lpattern(dash) lcolor(black)) /// legend(label(1 "UK") label(2 "France")) /// title("Share of patents with married women, out of all patents with women involved: 1791-1899",size(small)) /// xtitle("Year") /// ytitle("Married Share (%)") scheme(s2mono)graphregion(color(white)) graph export "married_share.pdf", replace twoway (line UK_widow_share year, lcolor(cranberry)) /// (line France_widow_share year, lcolor(navy)), /// xline(1844 1883, lpattern(dash) lcolor(black)) /// legend(label(1 "UK") label(2 "France")) /// title("Share of patents with widowed women, out of all patents with women involved: 1791-1899",size(small)) /// xtitle("Year") /// ytitle("Widow Share (%)") scheme(s2mono)graphregion(color(white)) graph export "widow_share.pdf", replace twoway (line UK_spinster_share year, lcolor(cranberry)) /// (line France_spinster_share year, lcolor(navy)), /// xline(1844 1883, lpattern(dash) lcolor(black)) /// legend(label(1 "UK") label(2 "France")) /// title("Share of patents with spinster women, out of all patents with women involved: 1791-1899",size(small)) /// xtitle("Year") /// ytitle("Spinster Share (%)") scheme(s2mono)graphregion(color(white)) graph export "spinster_share.pdf", replace * We are donw, lets go back to the main dataset save Marital_status.dta, replace clear all use TFM.dta, replace **# DESCRIPTIVE STATISTICS: OCCUPATION * The idea here is to make a bar chart seeing the frequency of the different occupations that women patenting had. * Firstl, we keep the variables we need keep patent_id year French occupation_inv_1 occupation_inv_2 occupation_inv_3 occupation_inv_4 occupation_inv_5 occupation_inv_6 occupation_inv_7 occupation_inv_8 occupation_inv_9 occupation_inv_10 occupation_inv_11 occupation_inv_12 occupation_inv_13 occupation_inv_14 occupation_inv_15 gender_inv_1 gender_inv_2 gender_inv_3 gender_inv_4 gender_inv_5 gender_inv_6 gender_inv_7 gender_inv_8 gender_inv_9 gender_inv_10 gender_inv_11 gender_inv_12 gender_inv_13 gender_inv_14 gender_inv_15 * Now, we reshape from inventor to year forvalues i = 10/15 { rename occupation_inv_`i' occupationinv`i' rename gender_inv_`i' genderinv`i' } forvalues i = 1/9 { rename occupation_inv_0`i' occupationinv0`i' rename gender_inv_0`i' genderinv0`i' } reshape long occupationinv genderinv, i(patent_id) j(inventor_n) string keep if genderinv=="female" drop if occupationinv=="" * Lets save the dataset save occupation.dta, replace * Now, we plot the bar graphs * UK GRAPH preserve keep if French == 0 graph bar (count), over(occupation, sort(1) descending /// label(angle(45))) /// title("Occupations of Female Patentees: UK (XIX Century)") /// ytitle("Number of Patents") /// blabel(bar) /// bar(1, fcolor(blue%70)) graph export "occupations_UK.pdf", replace restore * FRANCE GRAPH preserve keep if French == 1 graph bar (count), over(occupation, sort(1) descending /// label(angle(45))) /// title("Occupations of Female Patentees: France (XIX Century)") /// ytitle("Number of Patents") /// blabel(bar) /// bar(1, fcolor(red%70)) graph export "occupations_France.pdf", replace restore *This graphs are a mess, I need to group the occupations into broader categories *Lets go back to the main dataset save occupation.dta, replace clear all use TFM.dta, replace **# DESCRIPTIVE STATISTICS: PATENT DURATION * We are making a line graph that shows the share of long-term patents (10 to 15 years) for each year in both France and the UK * First, we collapse the data collapse (mean) share_long=patent_duration, by(year French female_dummy) * Now, we separate the series into two variables gen long_FR_female = share_long if French==1 & female_dummy==1 gen long_FR_male = share_long if French==1 & female_dummy==0 gen long_UK_female = share_long if French==0 & female_dummy==1 gen long_UK_male = share_long if French==0 & female_dummy==0 * And, we collapse again collapse (firstnm) long_FR_female long_FR_male long_UK_female long_UK_male, by(year) * Now, we can make the graph twoway /// (line long_FR_female year, lcolor(navy) lwidth(medthick) lpattern(solid)) /// (line long_FR_male year, lcolor(navy) lwidth(medthick) lpattern(dash)) /// (line long_UK_female year, lcolor(cranberry) lwidth(medthick) lpattern(solid)) /// (line long_UK_male year, lcolor(cranberry) lwidth(medthick) lpattern(dash)) /// , /// xline(1844, lcolor(navy) lpattern(shortdash) lwidth(thin)) /// xline(1883, lcolor(cranberry) lpattern(shortdash) lwidth(thin)) /// legend(order(1 "France – Female patents" 2 "France – Male patents" /// 3 "UK – Female patents" 4 "UK – Male patents") /// position(6) rows(2) size(small)) /// xtitle("Year") /// ytitle("Share of long-duration patents") /// title("Evolution of Patent Duration, 1800–1900") /// subtitle("By country and presence of female inventor") /// xlabel(1800(20)1900) /// ylabel(0(0.2)1, format(%3.1f)) /// graphregion(color(white)) plotregion(color(white)) /// note("Long duration = patents lasting 10–15 years. Solid = female patents, dashed = male patents." /// "Vertical lines: FR reform (1844) and UK reform (1883).", size(vsmall)) graph export "Patent_duration.pdf", replace * Lets save the dataset and go back to the main one save patent_duration.dta, replace clear all use TFM.dta, replace **# DESCRIPTIVE ANALYSIS: NUMBER OF PATENTEES * Lets make a graph to see the relation beyween the number of people in a patent, the country of patent, and the presence of females * Lets first get the year country gender dataset collapse (mean) avg_inventors=n_inventors, by(year French female_dummy) gen group=. replace group = 1 if French == 1 & female_dummy == 0 replace group = 2 if French == 1 & female_dummy == 1 replace group = 3 if French == 0 & female_dummy == 0 replace group = 4 if French == 0 & female_dummy == 1 label define group_lbl /// 1 "France – No female inventor" /// 2 "France – Female inventor" /// 3 "UK – No female inventor" /// 4 "UK – Female inventor" label values group group_lbl * And now, the graph twoway /// (line avg_inventors year if group == 1, lcolor(navy) lpattern(solid)) /// (line avg_inventors year if group == 2, lcolor(navy) lpattern(dash)) /// (line avg_inventors year if group == 3, lcolor(cranberry) lpattern(solid)) /// (line avg_inventors year if group == 4, lcolor(cranberry) lpattern(dash)), /// legend(order( /// 1 "France – No female inventor" /// 2 "France – Female inventor" /// 3 "UK – No female inventor" /// 4 "UK – Female inventor") /// pos(6) rows(2) size(small)) /// title("Average team size (1791-1899)") /// xtitle("Year") ytitle("Average", margin(r=3)) /// xlabel(1800(20)1900) xline(1844, lcolor(navy) lpattern(dot)) /// xline(1883, lcolor(cranberry) lpattern(dot)) /// note("Dotted vertical lines: French reform (1844) and UK reform (1883).") /// graphregion(color(white)) bgcolor(white) graph export "avg_inventors.pdf", replace * Lets save and go back to the main database save "n_participants.dta", replace clear all use TFM.dta, replace **# DESCRIPTIVE ANALYSIS: PROBIT MODEL * We will build the model step by step, so we have one big final table with all of them * MODEL 0 probit female_dummy i.French, vce(robust) estadd local yearFE "No" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m0 * MODEL 1 probit female_dummy i.French ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m1 testparm ib1791.year // test whether year FE are jointly significant (they are P>Chi=0) * MODEL 2 probit female_dummy i.French n_inventors i.patent_duration ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m2 *MODEL 3 probit female_dummy i.French n_inventors i.patent_duration i.F_reform i.UK_reform ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m3 * MODEL 4 probit female_dummy i.French i.patent_duration i.F_reform i.UK_reform c.n_inventors#i.French ib1791.year, vce(robust) // Without civil status controls (not that many observations in the UK) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m4 * MODEL 5 probit female_dummy i.French i.patent_duration i.widow_dummy i.F_reform i.UK_reform c.n_inventors#i.French ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m5 * MODEL 6 probit female_dummy i.French i.patent_duration i.married_dummy i.widow_dummy i.F_reform i.UK_reform c.n_inventors#i.French ib1791.year, vce(robust) // Ommitted years is because of lack of observations estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m6 **# DESCRIPTIVE STATISTICS: PROBIT MODEL (UK DUMMY) * MODEL 0 UK probit female_dummy English, vce(robust) estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m0_UK * MODEL 1 UK probit female_dummy English ib1791.year, vce(robust) estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m1_UK testparm ib1791.year * MODEL 2 UK probit female_dummy English n_inventors patent_duration ib1791.year, vce(robust) estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m2_UK * MODEL 3 UK probit female_dummy i.English n_inventors i.patent_duration i.F_reform i.UK_reform ib1791.year, vce(robust) estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m3_UK * MODEL 4 UK probit female_dummy English patent_duration i.F_reform i.UK_reform c.n_inventors#i.English ib1791.year, vce(robust) estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m4_UK * MODEL 5 UK probit female_dummy English patent_duration i.widow_dummy i.F_reform i.UK_reform c.n_inventors#i.English ib1791.year, vce(robust) estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m5_UK * MODEL 6 UK probit female_dummy English patent_duration married_dummy widow_dummy i.F_reform i.UK_reform c.n_inventors#i.English ib1791.year, vce(robust) // Ommitted years is because of lack of observations estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m6_UK **# DESCRIPTIVE STATISTICS: PROBIT OUTCOME TABLES * Pooled (France) esttab m0 m1 m2 m3 m4 m5 m6 using "models.tex", /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(yearFE N pseudo_r2 wald_chi2, labels("Year FE" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) replace * Pooled (UK) esttab m0_UK m1_UK m2_UK m3_UK m4 m5_UK m6_UK using "models_UK.tex", /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(yearFE N pseudo_r2 wald_chi2, labels("Year FE" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) replace **# DESCRIPTIVE STATISTICS: PROBIT AVERAGE MARGINAL EFFECTS (AME) * MODEL 0 estimates restore m0 margins, dydx(i.French) post estimates store m0_AME * MODEL 1 estimates restore m1 margins, dydx(i.French) post estimates store m1_AME * MODEL 2 estimates restore m2 margins, dydx(i.French n_inventors i.patent_duration) post estimates store m2_AME * MODEL 3 estimates restore m3 margins, dydx(i.French i.patent_duration i.F_reform i.UK_reform n_inventors) post estimates store m3_AME * MODEL 4 estimates restore m4 margins, dydx(i.French i.patent_duration i.F_reform i.UK_reform n_inventors) post estimates store m4_AME * MODEL 5 estimates restore m5 margins, dydx(i.French i.patent_duration i.widow_dummy i.F_reform i.UK_reform n_inventors) post estimates store m5_AME * MODEL 5 estimates restore m6 margins, dydx(i.French i.patent_duration i.married_dummy i.widow_dummy i.F_reform i.UK_reform n_inventors) post estimates store m6_AME * AME OUTPUT esttab m0_AME m1_AME m2_AME m3_AME m4_AME m5_AME m6_AME using "AME.tex", replace /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(yearFE N, labels("Year FE" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) **# DESCRIPTIVE STATISTICS: FRANCE ONLY use French_data.dta, replace * MODEL 1 probit female_dummy ib1791.year, vce(robust) estadd local Country "France" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m1_F * MODEL 2 probit female_dummy n_inventors patent_duration ib1791.year, vce(robust) estadd local Country "France" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m2_F * MODEL 3 probit female_dummy n_inventors patent_duration reform ib1791.year, vce(robust) estadd local Country "France" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m3_F * MODEL 5 (4 is with the iteraction, does not make sense here) probit female_dummy n_inventors patent_duration reform widow_dummy ib1791.year, vce(robust) estadd local Country "France" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m5_F * MODEL 6 (4 is with the iteraction, does not make sense here) probit female_dummy n_inventors patent_duration reform married_dummy widow_dummy ib1791.year, vce(robust) estadd local Country "France" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m6_F * OUTPUT esttab m1_F m2_F m3_F m5_F m6_F using "Output_F.tex", replace /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(Country pseudo_r2 wald_chi2 N, labels("Country" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) * Lets save the data save French_data.dta, replace **# DESCRIPTIVE STATISTICS: AME FRANCE ONLY * MODEL 2 estimates restore m2_F margins, dydx(n_inventors patent_duration) post estadd local Year Fixed Effects "Yes" estimates store m2_AME_F * MODEL 3 estimates restore m3_F margins, dydx(n_inventors patent_duration reform) post estadd local Year Fixed Effects "Yes" estimates store m3_AME_F * MODEL 5 estimates restore m5_F margins,dydx(n_inventors patent_duration reform widow_dummy) post estadd local Year Fixed Effects "Yes" estimates store m5_AME_F * MODEL 6 estimates restore m6_F margins, dydx(n_inventors patent_duration reform widow_dummy married_dummy) post estadd local Year Fixed Effects "Yes" estimates store m6_AME_F * OUTPUT esttab m2_AME_F m3_AME_F m5_AME_F m6_AME_F using "Output_AME_F.tex", replace /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(Year Fixed Effects, label("Year Fixed Effects")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) * Save data save French_data.dta, replace **# DESCRIPTIVE STATISTICS: UK ONLY use English_data.dta, replace * MODEL 1 probit female_dummy ib1791.year, vce(robust) estadd local Country "UK" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m1_E * MODEL 2 probit female_dummy n_inventors patent_duration ib1791.year, vce(robust) estadd local Country "UK" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m2_E * MODEL 3 probit female_dummy n_inventors patent_duration reform ib1791.year, vce(robust) estadd local Country "UK" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m3_E * MODEL 5 (4 is with the iteraction, does not make sense here) probit female_dummy n_inventors patent_duration reform widow_dummy ib1791.year, vce(robust) estadd local Country "UK" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m5_E * MODEL 6 (4 is with the iteraction, does not make sense here) probit female_dummy n_inventors patent_duration i.reform married_dummy widow_dummy ib1791.year, vce(robust) estadd local Country "UK" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m6_E * OUTPUT esttab m1_E m2_E m3_E m5_E m6_E using "Output_E.tex", replace /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(Country N pseudo_r2 wald_chi2, labels("Country" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) * Lets save the data save English_data.dta, replace **# DESCRIPTIVE STATISTICS: COMBINED OUTPUT esttab m1_F m1_E m2_F m2_E m3_F m3_E m5_F m5_E m6_F m6_E using "Output_comb.tex", replace /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(Country N, labels("Country" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) **# DESCRIPTIVE STATISTICS: FEMALE ONLY * Now that we have the results for the rest, lets see it from another lense, with only data of women participating keep if female_dummy==1 drop female_dummy save Female.dta, replace * MODEL 0 probit French, vce(robust) estadd local yearFE "No" estadd scalar pseudo_r2=e(r2_p) estadd scalar wald_chi2=e(chi2) estimates store m0_O * MODEL 1 probit French ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2=e(r2_p) estadd scalar wald_chi2=e(chi2) estimates store m1_O * MODEL 2 probit French n_inventors patent_duration ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2=e(r2_p) estadd scalar wald_chi2=e(chi2) estimates store m2_O * MODEL 3 probit French n_inventors patent_duration widow_dummy ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2=e(r2_p) estadd scalar wald_chi2=e(chi2) estimates store m3_O * MODEL 4 probit French n_inventors patent_duration married_dummy ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2=e(r2_p) estadd scalar wald_chi2=e(chi2) estimates store m4_O * MODEL 5 probit French n_inventors patent_duration widow_dummy married_dummy ib1791.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2=e(r2_p) estadd scalar wald_chi2=e(chi2) estimates store m5_O * OUTPUT esttab m0_O m1_O m2_O m3_O m4_O m5_O using "Output_female.tex", replace /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(yearFE N pseudo_r2 wald_chi2, labels("Year Fixed Effects" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) * Saving and back to main database save Female.dta, replace clear all use TFM.dta, replace **# ROBUSTNESS CHECK: IMPORT ITALIAN DATA clear all import excel "C:\Users\Carlos\OneDrive - Universidad Carlos III de Madrid\Escritorio\25-26 Course\TFM\Data\Patentin > g\Excel\italian_patents_gender_1861_1939.xlsx", sheet("Sheet1") firstrow save Italian_data.dta, replace * Now we can clean it * First we clean it from duplicates keep if disambiguated_duplicateonly == 0 * Safety check: Unique_ID should now be unique duplicates report Unique_ID * If duplicates remain, inspect: duplicates list Unique_ID bysort Unique_ID (female_TRUE): keep if _n == _N * Number of inventors gen n_inventors = 0 forvalues i = 1/4 { replace n_inventors = n_inventors + 1 /// if strtrim(Patentee_`i'_Corretto) != "" } replace n_inventors = 1 /// if n_inventors == 0 & strtrim(Patentee_1_final) != "" * Show any remaining zero-participant rows so you can inspect them list Unique_ID Year Patentee_1_final Patentee_1_Corretto if n_inventors == 0 * Drop them drop if n_inventors==0 * Female patenting gen n_female = min(female_ALL, n_inventors) label variable n_female "Number of female patentees (capped at n_participants)" * Female dummy gen female_dummy = (female_TRUE == 1) label variable female_dummy "At least one female patentee" * Marital status dummies gen married_dummy = (married == 1) gen widow_dummy = (widow == 1) gen spinster_dummy = (female_dummy == 1 & married != 1 & widow != 1) replace spinster_dummy = 0 if female_dummy == 0 label variable married_dummy "Dummy: married woman involved" label variable widow_dummy "Dummy: widowed woman involved" label variable spinster_dummy "Dummy: unmarried/spinster woman involved" * We keep necessary variables keep Unique_ID Year Duration female_dummy n_inventors n_female /// married_dummy widow_dummy spinster_dummy label variable Unique_ID "Unique invention identifier" label variable Year "Year of patent grant" label variable Duration "Patent duration (years)" label variable n_inventors "Number of inventors participating in the patent" order Unique_ID Year Duration female_dummy n_inventors n_female /// married_dummy widow_dummy spinster_dummy sort Unique_ID * Add a control variable for 1924 generate It_reform=(Year==1924) label variable It_reform "Control for the year of 1924" * And we save the data save Italian_data.dta, replace **# ROBUSTNESS CHECK: PIE CHART * Lets make a graph to visualize the current data count if female_dummy == 1 local female_it = r(N) count if female_dummy == 0 local male_it = r(N) * Graph graph pie, over(female_dummy) /// plabel(_all sum, format(%4.1f) size(medium) color(white)) /// pie(1, color(green)) /// pie(2, color(green*0.5)) /// legend(order(1 "No female inventor" 2 "At least one female inventor") position(6)) /// title("Italy") /// scheme(s2mono) graphregion(color(white)) /// name(pie_france, replace) graph export "Italy_pie.pdf", replace **# ROBUSTNESS CHECK: COUNTS AND GROWTH * First, we collapse collapse (sum) female_patentes=female_dummy (count) total_patents=female_dummy, by (Year) generate female_pct=(female_patentes/total_patents)*100 * Then, we save save Itl_count.dta, replace * Now, the graphs twoway /// (line female_patentes Year, lcolor(olive) lwidth(medthin)) /// , legend(order(1 "Italy") position(11) ring(0)) /// xtitle("Year") ytitle("Number of patents with female inventors") /// title("Female Patenting Activity, 1861-1939") /// subtitle("Absolute count of patents with at least one female inventor") /// scheme(s2mono) graphregion(color(white)) graph export "It_gender_count.pdf", replace * And back to the database save Itl_count.dta, replace use Italian_data, replace **# ROBUSTNESS CHECK: GROWTH * First, collapse collapse (sum) female_patents=female_dummy, by(Year) sort Year gen growth_rate=((female_patents-female_patents[_n-1])/female_patents[_n-1])*100 *Then, save save Itl_growth.dta, replace * Then, graph twoway /// (line growth_rate Year, lcolor(olive) lwidth(medthin)) /// , yline(0, lcolor(black) lwidth(thin)) /// legend(order(1 "Italy") position(11) ring(0)) /// xtitle("Year") ytitle("Year-on-year growth rate (%)") /// title("Growth Rate of Female Patenting, 1861-1939") /// subtitle("Annual percentage change in patents with at least one female inventor") /// scheme(s2mono) graphregion(color(white)) graph export "It_growth_rate.pdf", replace * Finally, close save Itl_growth.dta, replace use Italian_data.dta, replace **# ROBUSTNESS CHECK: GENDER GAP * First collapse collapse (sum) female_patents=female_dummy (count) total_patents=female_dummy, by(Year) gen gender_gap=(female_patents/total_patents)*100 drop female_patents total_patents * Second, save save Itl_gender_gap.dta, replace * Then, graph twoway (line gender_gap Year, lcolor(olive)), /// legend(label(1 "Italy")) /// title("Gender Gap in Patents: Italy (1861-1939)") /// xtitle("Year") ytitle("Gender Gap (%)") scheme(s2mono)graphregion(color(white)) graph export "It_gender_gap.pdf", replace * Finally, close save Itl_gender_gap.dta, replace use Italian_data.dta, replace **# ROBUSTNESS CHECK: MARITAL STATUS * First collapse collapse (sum) married=married_dummy (sum) widows=widow_dummy (sum) spinsters=spinster_dummy (sum) total=female_dummy, by(Year) gen married_share=(married/total)*100 replace married_share=0 if married_share==. gen widow_share=(widows/total)*100 replace widow_share=0 if widow_share==. gen spinster_share=(spinsters/total)*100 replace spinster_share=0 if spinster_share==. * Second, save save Itl_marital_status.dta, replace * Then, graph twoway (line married_share Year, lcolor(cranberry)) /// (line widow_share Year, lcolor(navy)) /// (line spinster_share Year, lcolor(olive)), /// legend(label(1 "Married") label(2 "Widow") label(3 "Spinster")) /// title("Share of married, widowed or spinster women in all patents with women in Italy (1861-1939)", size(small)) /// xtitle("Year") /// ytitle("Share (%)") scheme(s2mono)graphregion(color(white)) graph export "It_marital_status.pdf", replace * Finally, close save Itl_marital_status.dta, replace use Italian_data.dta, replace **# ROBUSTNESS CHECK: PATENT DURATION * First, collapse collapse patent_duration_avg=Duration, by(Year female_dummy) drop if patent_duration_avg==. reshape wide patent_duration, i(Year) j(female_dummy) * Second, save save Itl_duration.dta, replace * Then, graph twoway (line patent_duration_avg1 Year, lcolor(green)) /// (line patent_duration_avg0 Year, lcolor(green*0.5)) /// , legend(label(1 "With women") label(2 "Only men")) /// title("Average patent duration in Italy by year (1861-1939)") /// xtitle("Year") /// ytitle("Average number of years") /// scheme(s2mono) graphregion(color(white)) graph export "It_patent_duration.pdf", replace * Finally, close save Itl_duration.dta, replace use Italian_data.dta, replace **# ROBUSTNESS CHECK: NUMBER OF PATENTEES * First, collapse collapse (mean) avg_inventors=n_inventors, by(Year female_dummy) drop if avg_inventors==. reshape wide avg_inventors, i(Year) j(female_dummy) * Second, save save Itl_ninventors.dta, replace * Then, graph twoway (line avg_inventors1 Year, lcolor(green)) /// (line avg_inventors0 Year, lcolor(green*0.5)) /// , legend(label(1 "With women") label(2 "Only men")) /// title("Average number of participants in Italy by year (1861-1939)", size(medsmall)) /// xtitle("Year") /// ytitle("Average number of participants") /// scheme(s2mono) graphregion(color(white)) graph export "It_ninventors.pdf", replace * Finally, save save Itl_ninventors.dta, replace use Italian_data.dta, replace **# ROBUSTNESS CHECK: PROBIT * First, we need the patent duration dummy generate patent_duration=(Duration>=10) * MODEL 0 probit female_dummy, vce(robust) estadd local Country "Itlay" estadd local pseudo_r2=e(r2_p) estadd local wald_chi2=e(chi2) estimates store m0_I * MODEL 1 probit female_dummy ib1861.Year, vce(robust) estadd local Country "Itlay" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m1_I * MODEL 2 probit female_dummy n_inventors patent_duration ib1861.Year, vce(robust) estadd local Country "Italy" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m2_I * MODEL 3 probit female_dummy It_reform n_inventors patent_duration ib1861.Year, vce(robust) estadd local Country "Italy" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m3_I * MODEL 5 (4 is with the iteraction, does not make sense here.) probit female_dummy It_reform n_inventors patent_duration widow_dummy ib1861.Year, vce(robust) estadd local Country "Italy" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m5_I * MODEL 6 probit female_dummy It_reform n_inventors patent_duration married_dummy ib1861.Year, vce(robust) estadd local Country "Italy" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m6_I * MODEL 7 probit female_dummy It_reform n_inventors patent_duration spinster_dummy ib1861.Year, vce(robust) estadd local Country "Italy" estadd scalar pseudo_r2=e(r2_p) estadd scalar wald_chi2=e(chi2) estimates store m7_I * OUTPUT esttab m0_I m1_I m2_I m3_I m5_I m6_I m7_I using "Output_I.tex", replace /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*Year, relax) /// stats(Country pseudo_r2 wald_chi2 N, labels("Country" "Pseudo R2" "Wald Chi2" "Observations")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) * Lets save the Italian data and go back to the main one rename Year year replace Unique_ID=Unique_ID+3700000 rename Unique_ID patent_id generate Italian=1 save Italian_data.dta, replace * ROBUSTNESS CHECK: POOLED PROBIT * First, we need to append the Italian data to the main database append using TFM.dta keep if inrange(year,1861,1899) replace UK_reform=0 if UK_reform==. replace spinster_dummy=1 if female_dummy==1 & widow_dummy==0 & married_dummy==0 replace spinster_dummy=0 if spinster_dummy==. save TFM_robustness.dta, replace * MODEL 0 probit female_dummy i.French i.Italian, vce(robust) estadd local yearFE "No" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m0_R * MODEL 1 probit female_dummy i.French i.Italian ib1861.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m1_R testparm ib1791.year // test whether year FE are jointly significant (they are P>Chi=0) * MODEL 2 probit female_dummy i.French i.Italian n_inventors i.patent_duration ib1861.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m2_R *MODEL 3 probit female_dummy i.French i.Italian n_inventors i.patent_duration i.UK_reform ib1861.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m3_R * MODEL 4 probit female_dummy i.French i.Italian i.patent_duration i.UK_reform c.n_inventors#i.French ib1861.year, vce(robust) // Without civil status controls (not that many observations in the UK) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m4_R * MODEL 5 probit female_dummy i.French i.Italian i.patent_duration i.widow_dummy i.UK_reform c.n_inventors#i.French ib1861.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m5_R * MODEL 6 probit female_dummy i.French i.Italian i.patent_duration i.married_dummy i.widow_dummy i.UK_reform c.n_inventors#i.French ib1861.year, vce(robust) // Ommitted years is because of lack of observations estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates store m6_R * OUTPUT esttab m0_R m1_R m2_R m3_R m4_R m5_R m6_R using "models_robustness.tex", /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(yearFE N pseudo_r2 wald_chi2, labels("Year FE" "Observations" "Pseudo R2" "Wald Chi2")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) replace * Finally, we can save save TFM_robustness.dta, replace **# ROBUSTNESS CHECK: FORECASTING * What if we do an out of sample forecast for the Italian data during the years in common? use TFM.dta, replace keep if inrange(year,1861,1899) * Lets estimate then the forecasting model probit female_dummy n_inventors i.patent_duration ib1861.year, vce(robust) estadd local yearFE "Yes" estadd scalar pseudo_r2 = e(r2_p) estadd scalar wald_chi2 = e(chi2) estimates save "forecast_FRUK", replace estimates store forecast_FRUK esttab forecast_FRUK using "forecast_FRUK.tex", /// se label booktabs /// alignment(D{.}{.}{-1}) /// drop(*year, relax) /// stats(yearFE N pseudo_r2 wald_chi2, labels("Year FE" "Observations" "Pseudo R2" "Wald Chi2")) /// star(* 0.10 ** 0.05 *** 0.01) /// b(3) se(3) replace * Now, we load the Italian data save TFM_forecast.dta, replace use Italian_data.dta, replace keep if inrange(year,1861,1899) * We set the country variables to 0 (this is not UK nor France) generate French = 0 generate English = 0 generate F_reform = 0 generate UK_reform = 0 * Now we can apply the model and predict estimates use "forecast_FRUK" predict p_female_it, pr label variable p_female_it "predicted female patenting activity in Italy (1861-1899)" * We can do now comparisons summarize p_female_it female_dummy * One issue is that out current prediction is not binary, but we can make it happen gen prediction_female_dummy=(p_female_it>=0.5) estpost tabulate prediction_female_dummy female_dummy esttab using "comparison_forecast.tex", /// replace booktabs /// cells("b(label(Count)) rowpct(fmt(1) label(Row %)) colpct(fmt(1) label(Col %))") /// title("Predicted vs Actual Female Inventor -- Italy 1861--1900") /// nonumber nomtitle * Now, we can visualize the data in a histogram twoway /// (histogram p_female_it if female_dummy==1, color(navy%50) frequency) /// (histogram p_female_it if female_dummy==0, color(cranberry%50) frequency) /// , legend(label(1 "Actually with female") label(2 "Actually only male")) /// title("Predicted P(female inventor) – Italy 1861–1900") /// xtitle("Predicted probability") /// scheme(s2mono) graphregion(color(white)) graph export "forecast_histogram.pdf", replace save Italy_forecast.dta, replace * Another interesting way to vizualize it is with a timeline, but firts, we need to collapse collapse (mean) actual=female_dummy predicted=p_female_it, by(year) * Then, graph twoway /// (line actual year, lcolor(navy) lwidth(medthin)) /// (line predicted year, lcolor(cranberry) lwidth(medthin) lpattern(dash)) /// , legend(label(1 "Actual share (Italy)") label(2 "Predicted probability (FR+UK model)")) /// title("Actual vs Predicted Female Patenting – Italy 1861–1900") /// xtitle("Year") ytitle("Share / Predicted probability") /// scheme(s2mono) graphregion(color(white)) graph export "forecast_timeline.pdf", replace * Then save, and return save forecast_timeline.dta, replace use TFM.dta, replace **# SUMMARY TABLES * Lets make summary tables of all main variables used in this project local descriptive female_dummy French n_inventors patent_duration F_reform UK_reform widow_dummy married_dummy spinster_dummy estpost summarize `descriptive', detail esttab . using "descriptive stats.tex", replace booktabs label nomtitle nonumber noobs /// cells("count(fmt(%9.0f) label(N)) mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) p50(fmt(%9.3f) label(Median)) max(fmt(%9.3f) label(Max))") /// title("Descriptive Statistics") * Lets now do the same but for the Italian data save TFM.dta, replace use Italian_data.dta, replace local descriptive female_dummy n_inventors patent_duration It_reform widow_dummy married_dummy spinster_dummy estpost summarize `descriptive', detail esttab . using "it descriptive stats.tex", replace booktabs label nomtitle nonumber noobs /// cells("count(fmt(%9.0f) label(N)) mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) p50(fmt(%9.3f) label(Median)) max(fmt(%9.3f) label(Max))") /// title("Descriptive Statistics") save Italian_data.dta, replace use TFM.dta, replace * Now, for the French data use French_data.dta, replace generate F_reform=(year>1844) local descriptive female_dummy n_inventors patent_duration F_reform widow_dummy married_dummy spinster_dummy estpost summarize `descriptive', detail esttab . using "fr descriptive stats.tex", replace booktabs label nomtitle nonumber noobs /// cells("count(fmt(%9.0f) label(N)) mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) p50(fmt(%9.3f) label(Median)) max(fmt(%9.3f) label(Max))") /// title("Descriptive Statistics") save French_data.dta, replace use TFM.dta, replace * Finally, the British data use English_data.dta, replace generate UK_reform=(year>1883) local descriptive female_dummy n_inventors patent_duration UK_reform widow_dummy married_dummy spinster_dummy estpost summarize `descriptive', detail esttab . using "uk descriptive stats.tex", replace booktabs label nomtitle nonumber noobs /// cells("count(fmt(%9.0f) label(N)) mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) p50(fmt(%9.3f) label(Median)) max(fmt(%9.3f) label(Max))") /// title("Descriptive Statistics") save English_data.dta, replace use TFM.dta, replace **# SAVING FINAL RESULTS save TFM.dta, replace log close