The 2nd model may not be appropriate because it specifies random slopes for sector which is a level 2 variable, but if you have reason to think that it should vary by school, then it could be OK.
The first model may be appropriate if you have reason to believe the cross level interaction should vary by school, AND it is supported by the data. The problem with this model is that it corresponds somewhat to a model with a (fixed) interaction term but omitting the main effects, and that rarely make sense.
Edit:
I just want to expand on my remark above about fitting random slopes for a variable that does not vary within the grouping factor. Statistically speaking, we might have a dataset where such a model converges without warning. What I am trying to say is that I'm not sure whether I can make sense of such a model. I mean, maybe there are some edge cases, or pathological examples where it does make sense, but I would like to think that in real world situations it would not make sense to specify a model with random slopes for a variable that is constant within groups. One way to help think about this is to plot the data with the outcome on the $y$ axis, the variable in question on the $x$ axis and then to plot a seperate line for each group. This will be impossible since each group's data points will occupy the same value for the $x$ variable and the slope will be undefined.
I should probably admit at this point, to utilising way too much sarcasm in some of my answers on this topic. My justification for doing so is to encourage analysts to think about what their models mean.
ses:sector. The legitimacy of the models depends on 1) whether there is theoretical (from domain knowledge) justification AND 2) whether they are supported by the data. – Robert Long Oct 07 '20 at 18:34ses:sector) can only be found when we consider the relationship betweenmath ~ sesas being random (varying across schools) and then consider how this relation differs betweensector==0andsector==1(as depicted in this visual), the answer becomes a cross-level interaction. Now, I have difficulty understanding how such a cross-level interaction can AGAINvary by schooland hence the use ofses:sector? (My question is about understanding the syntax only) – rnorouzian Oct 07 '20 at 20:13hsb10 <- subset(hsb, sch.id %in% unique(sch.id)[1:10]); ggplot(hsb10) + aes(x=size, y = math) + geom_path()+ facet_wrap(~sch.id)– rnorouzian Oct 07 '20 at 21:50