Fulton
Fulton

Reputation: 43

Error in round(mf) : non-numeric argument to mathematical function

I want to figure out the poLCA::poLCA() function, but the system gives me warning like:

Error in round(mf) : non-numeric argument to mathematical function

Codes are shown below:

#Latent class models with one (loglinear independence) to three classes
f=cbind("I_like_to_drink","I_drink_hard_liquor","I_have_drank_in_the_morning","I_have_drank_in_the_work","I_drink_to_get_drunk","I_like_the_taste_of_the_alcohol","I_drink_help_me_sleep","Drinking_interferes_with_my_relationships","I_frequently_visit_bars")~1
    nes1 = poLCA(f,lca1,nclass=1) # log-likelihood: 
    nes2 = poLCA(f,lca1,nclass=2) # log-likelihood: 
    nes3 = poLCA(f,lca1,nclass=3) # log-likelihood: 
    nes4 = poLCA(f,lca1,nclass=4) # log-likelihood: 

Upvotes: 1

Views: 3062

Answers (1)

Carlos Moya
Carlos Moya

Reputation: 21

This is an old post, but I'm replying for future cases (I just ran into this same issue)

It should be as simple as defining your formula without quotation marks:

f=cbind(I_like_to_drink,I_drink_hard_liquor,I_have_drank_in_the_morning,I_have_drank_in_the_work,I_drink_to_get_drunk,I_like_the_taste_of_the_alcohol,I_drink_help_me_sleep,Drinking_interferes_with_my_relationships,I_frequently_visit_bars)~1

Upvotes: 2

Related Questions