Below might not be the same John but given the names of the children it may be worth researching?
1891 - 8 Cross Buildings, Old Kilpatrick, Clydebank, Dumbartonshire
Occupation: Shipwright
John Anderson 45 Greenock, Renfrewshire
Agnes Anderson 45 Glasgow, Lanarkshire
Elizabeth Anderson 13 ditto
John Anderson 10 ditto
In 1881 Agnes and the two children above are at 261 Stirling Road, St Rollox Glasgow Macleod, Lanarkshire.
Agnes is noted as a carpenters wife. John not present.
Colin