Dummy Variable Problems in Latent Class Analysis with R

I am a beginner in R.
Conjoint analysis and Latent Class Analysis (LCA) are being conducted simultaneously.
The conjoint analysis went well.

There was a problem with the LCA analysis.
When running poLCA, the following warning message appears

'ALERT : some manifest variables contain values ​​that are not positive integers. For poLCA to run, please recode categorical outcome variables to increment from 1 to the maximum number of outcome categories for each variable'

So, after thinking about it, I changed all the dummy variables of the coding data from 0 to 1 // and 1 to 2.
In addition, all categorical variables such as marital status and gender were changed from 0 to 1 and 1 to 2.
After that, the result came out without error.

Usually, dummy variable coding is known as '0 or 1' // '-1 or +1'.

Is it possible to code dummy variables as 1 or 2 in R(poLCA)?
Or did I do something wrong? I do not know.

It's my first time in LCA or R, so I'm unfamiliar with it.
Advice from experienced experts please.
thank you.

I am not familiar with 'reprex' function, so I described my coding as below.

install.packages("LCA")

#> Installing package into 'C:/MyRproject/library'

#> (as 'lib' is unspecified)

#> package 'LCA' successfully unpacked and MD5 sums checked

#> The downloaded binary packages are in

#> C:\Users\Chae Gi Young\AppData\Local\Temp\Rtmpm4TgaA\downloaded_packages

install.packages("vcd")

#> Installing package into 'C:/MyRproject/library'

#> (as 'lib' is unspecified)

#> package 'vcd' successfully unpacked and MD5 sums checked

#> The downloaded binary packages are in

#> C:\Users\Chae Gi Young\AppData\Local\Temp\Rtmpm4TgaA\downloaded_packages

library(poLCA)

#> Loading required package: scatterplot3d

#> Loading required package: MASS

library(vcd)

#> Loading required package: grid

setwd('C:/Conjoint/graduation thesis/6 trial')

lca_data <-read.csv("conjoint coding_220328.csv")

lca_formula <- cbind(Pro, Pro1, Acc, Stay, Stay1, Fac, Fac1, Privacy, Price)~1

set.seed(123)

lca <- poLCA(lca_formula, lca_data, nclass=2, graphs=F, tol=1e-10, na.rm=F)

#>

#> ALERT: some manifest variables contain values that are not

#> positive integers. For poLCA to run, please recode categorical

#> outcome variables to increment from 1 to the maximum number of

#> outcome categories for each variable.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.