Lavaan SEM Ordinal and Categorical variables In my model I have dichotomous variables (gender, car ownership) and ordinal variables (Income, Employment,...). My question is whether it is possible to construct latent variables using dichotomous and ordered variables? Is that a problem for the analysis? If not, how should I treat them?
I am attaching the part of the model I am trying to make for which I get the warning message: lavaan WARNING: fit measures not available if model did not converge
model <- '

socio =~ x1 + x2 + x3
eco  =~ x4 + x5 + x7

eco ~ social
'
fit <- sem(model, data=dataset2, ordered=c("x2", "x3", "x1", "x4", "x5", "x7"))

Variables x1 - x3 are dichotomous
Variables x4 - x7 are ordinal on a scale 1-5
 A: Yes, there are special ways to handle ordinal and binary variables in Lavaan, you can enter them as numeric variables then when you use the sem() function you specify which are ordinal using the ordered argument.
I wrote up a longer response but then came across this link...
That should give you everything you need to know.
A: As both @Dimitris Rizopoulos and @Jeremy Miles say, it is possible to fit an SEM using categorical data (i.e., which includes your dichotomous and ordinal variables). There are generally two methods used to go about doing this$^1$. The first is the direct method, which treats categorical data as continuous and, as a result, estimates model parameters using the sample correlation/covariance matrix. The second method goes by many names, but here I will refer to the underlying latent response method since it invokes the presence of an underlying latent response/variable through the use of tetrachoric/polychoric correlations to estimate model parameters. Below is some code for fitting your model using each method
## Lavaan Model
# Note model is the same across both methods.
model <- '
socio =~ x1 + x2 + x3
eco  =~ x4 + x5 + x7

eco ~ social
'
## Fitting models 
# Fit using the direct method 
fit1 <- sem(model, data=dataset2)
# Fit using the underlying latent response method
fit2 <- sem(model, data=dataset2, ordered = colnames(dataset2))

So, to answer your first question, yes, SEM models may be fit using dichotomous and/or ordinary data, and there are multiple ways to do so (for more information, see Wirth & Edwards 2007).
Regarding whether the categorical nature of your data is related to your convergence issues, I agree with @Jeremy Miles that we need more information to answer this question. One possible reason for this I can think of from reading your question is that it could be related to your data. Variables such as employment and gender in particular, are seldom used as indicator variables in latent variable models. While such variables likely display meaningful bivariate associations (e.g., I am sure all variables load onto the socio have meaningful bivariate associations), I am not sure whether a measurement model is a correct way to account for dependencies between variables that load onto the same latent construct. Put differently, it may be a better idea to use something like path analysis to test the relationships among x1-x6, instead of using a SEM$^2$.
$^1$Note that within each method, there are still important decisions to make, such as the choice of estimation method. For more information on this, see Wirth & Edwards 2007.
$^2$ Note that path analysis is simply SEM without the measurement model, and therefore can be estimated using most (if not all) SEM software packages such as lavaan and mplus.
References
Wirth, R. J., & Edwards, M. C. (2007). Item factor analysis: current approaches and future directions. Psychological methods, 12(1), 58.
A: Ordinal and binary variables are fine in SEM.
The fact that the model does not converge is (mostly) unrelated. We need more information to diagnose that. 
