I found another daughter of my ancestor William Ramsay of Barnton mentioned in The Letters and Journals of Robert Baillie, 1637-1662 :
MATTHEW BAILLIE, attained the rank of Lieutenant-General in the army. He was twice married. The contract of marriage with his first wife Agnes Ramsay, second daughter of , Esq. was dated 26th December 1792; but a separation took place sometime before January 1803.