Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8952429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:52:17+00:00 2026-06-15T13:52:17+00:00

I am trying to use TraMineR’s (version 1.8.4) seqdef-funciton to define a sequence object,

  • 0

I am trying to use TraMineR’s (version 1.8.4) seqdef-funciton to define a sequence object, but I always get this error message which makes no sense to me:
Error in row.names<-.data.frame(*tmp*, value = value) :
invalid ‘row.names’ length

My code input is:

sample.sts <- seqdef(sample, var=c("jan2005", "feb2005", "mar2005", "apr2005", "may2005", 
"jun2005", "jul2005", "aug2005", "sep2005", "oct2005", "nov2005", "dec2005"),  
alphabet=c("Employee (full-time)", "Employee (part-time)", 
"Self-employed (full-time)", "Self-employed (part-time)", "unemployed", "Retired", 
"Student", "Other inactive", "Compulsory military service"), 
states=c("EF", "EP", "SF", "SP", "UE", "RE", "ST", "IA", "MS"), id="pidc")

The data frame “sample” looks like this:

    pidc           jan2005   feb2005    ...    dec2005   sex   edufirst   age05   
--------------------------------------------------------------------------    
1.  150163920001         .         .    ...         .    1          5      62   
2.  211518110003         .         .    ...         .    2          2      17   
3.  170295160002         .         .    ...         .    2          1      47   
4.  240386550002         2         2    ...         2    2          2      50   
5.  320099920001         .         .    ...         .    1          3      38   
--------------------------------------------------------------------------    
6.  200167850001         .         .    ...         .    1          5      39  
7.  340401190002         6         6    ...         6    1          3      61  
8.  180501260002         .         .    ...         .    1          3      29  
9.  230083560001         .         .    ...         .    1          3      61  
10. 240335270002         3         3    ...         3    2          3      30  

The whole output says:

[!] found ‘-‘ character in states codes, not recommended
[>] found missing values (‘NA’) in sequence data
[>] preparing 3266 sequences
[>] coding void elements with ‘%’ and missing values with ‘*’
[!] sequence with index: 1,2,3,…
[>] state coding:
[alphabet] [label] [long label]
1 Employee (full-time) EF EF
2 Employee (part-time) EP EP
3 Self-employed (full-time) SF SF
4 Self-employed (part-time) SP SP
5 unemployed UE UE
6 Retired RE RE
7 Student ST ST
8 Other inactive IA IA
9 Compulsory military service MS MS
[>] 3266 sequences in the data set
[>] min/max sequence length: 12/12
Fehler in row.names<-.data.frame(*tmp*, value = value) :
invalid ‘row.names’ length

I retried it after re-labelling the states without “-“, which does not affect the error. Maybe, someone can help me out and knows what causes this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:52:18+00:00Added an answer on June 15, 2026 at 1:52 pm

    The “id” argument of seqdef should be a vector containing one entry per sequences (ie. The length of id vector should equal the number of sequences). Try using id=as.character(sample$pid). You can also try id=sample$pid (without as.character)

    sample.sts <- seqdef(sample, var=c("jan2005", "feb2005", "mar2005", "apr2005", "may2005", "jun2005", "jul2005", "aug2005", "sep2005", "oct2005", "nov2005", "dec2005", "jan2006", "feb2006", "mar2006", "apr2006", "may2006",  "jun2006", "jul2006", "aug2006", "sep2006", "oct2006", "nov2006", "dec2006",  "jan2007", "feb2007", "mar2007", "apr2007", "may2007",  "jun2007", "jul2007", "aug2007", "sep2007", "oct2007", "nov2007", "dec2007", "jan2008", "feb2008", "mar2008", "apr2008", "may2008", "jun2008", "jul2008", "aug2008", "sep2008", "oct2008", "nov2008", "dec2008"),  alphabet=c("Employee (full-time)", "Employee (part-time)", "Self-employed (full-time)", "Self-employed (part-time)", "unemployed", "Retired", "Student", "Other inactive", "Compulsory military service"), states=c("EF", "EP", "SF", "SP", "UE", "RE", "ST", "IA", "MS"), d=as.character(sample$pid))
    

    There are some mismatch between the states in the data and the alphabet argument since “-” was replaced by “.”. You should probably change the alphabet argument (try using seqstatl function to find out, which states labels are present in your data).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use Net::SFTP, version 2.05 (appears to be the latest). But it fails
I'm trying use this code to get image resolution from file bool GetImageSizeEx(const char
I am need paint my image. I'm trying use JQuery in here this link:
I am trying use filehelpers class builder but I am kinda confused on what
I am trying to do sequence analysis using time-diary data (American Time Use Survey)
I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
I was trying use svn to find a checkin using svn log, but it
I am trying use std::copy to copy from two different iterator. But during course
I'm trying use to selenium with firefox on CentOS from command line like this:
I'm trying use the Sum method in a lambda expression for a comparison, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.