I have a large dataset (50m rows) in Stata. One of my independent variables is age, and I'm using linear splines to try to capture the complex pattern between age and my dependant variable. I also have some interactions with age, such as household type.

My question is: how can I calculate the confidence interval around the age spline for each of the interactions with household type so that I can determine if the dependant is stat sig different by household type at a given age?

To make the problem replicable, I've restated it below using the auto dataset:

Code:
sysuse auto
mkspline weight 3 = weight, pctile
reg price c.weight?#i.foreign mpg trunk, base
In this case, the question would be - does weight have a different effect on price depending if it is foreign or not?

I have tried using lincom as below to see if the CIs overlap (they do, so I conclude that weight is not stat sig different by foreign at that weight), but I don't know if it's the correct approach or how to manually create the combination of CIs that lincom does.

Code:
list weight* if weight == 2830
lincom _b[0.foreign#c.weight1]*2640 + _b[0.foreign#c.weight2]*190 + _b[0.foreign#c.weight3]*0
lincom _b[1.foreign#c.weight1]*2640 + _b[1.foreign#c.weight2]*190 + _b[1.foreign#c.weight3]*0
Can anyone help please?