HI @Vaibhavdixit02 i tried it
pk_vpc = vpc(R130_FINALMODEL_result_p,1; dv=:DV,idv = :TAD,
# covariates=[:TAD],
# stratify_by = [:EVID],
ensemblealg=EnsembleThreads())
it gave below error
ERROR: ArgumentError: column name :TAD not found in the data frame; existing most similar names are: :id
Stacktrace:
[1] lookupname at C:\Users\julia\.julia\packages\DataFrames\GtZ1l\src\other\index.jl:289 [inlined]
[2] getindex at C:\Users\julia\.julia\packages\DataFrames\GtZ1l\src\other\index.jl:295 [inlined]
[3] getindex(::DataFrame, ::typeof(!), ::Symbol) at C:\Users\julia\.julia\packages\DataFrames\GtZ1l\src\dataframe\dataframe.jl:435
[4] _vpc(::Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},Pumas.ConstantInterpolationStructArray{Array{Float64,1},StructArrays.StructArray{NamedTuple{(:WT, :INITWT, :DFWT, :M, :SCR, :INITBMI, :DFBMI, :INITFFM, :DFFFM, :SCRD, :GA, :PMA, :AGEYRS, :BMI, :FFM, :ALBD, :TAD),Tuple{Float64,Float64,Float64,Int64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64}},1,NamedTuple{(:WT, :INITWT, :DFWT, :M, :SCR, :INITBMI, :DFBMI, :INITFFM, :DFFFM, :SCRD, :GA, :PMA, :AGEYRS, :BMI, :FFM, :ALBD, :TAD),Tuple{Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1}}},Int64},Symbol},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Nothing,Int64},1},Array{Float64,1}},1}, ::QuantileRegressions.IP, ::Pumas.ContinuousVPC; dv::Symbol, idv::Symbol, stratify_by::Nothing, quantiles::Tuple{Float64,Float64,Float64}, bandwidth::Int64, numstrats::Nothing) at C:\Users\julia\.julia\packages\Pumas\iIBBr\src\estimation\vpc.jl:109
[5] vpc(::PumasModel{ParamSet{NamedTuple{(:tvka, :tvk23, :tvvc, :tvvp, :tvQ, :tvCL, :tvbio, :θ, :Ω1, :Ω2, :σ1, :σ2),Tuple{RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},VectorDomain{Array{TransformVariables.Infinity{false},1},Array{TransformVariables.Infinity{true},1},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},PSDDomain{Array{Float64,2}},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64}}}},Serialization.__deserialized_types__.var"#69#99",Serialization.__deserialized_types__.var"#70#100",Serialization.__deserialized_types__.var"#72#102",Pumas.LinearODE,Serialization.__deserialized_types__.var"#73#103",Serialization.__deserialized_types__.var"#86#116"}, ::Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},Pumas.ConstantInterpolationStructArray{Array{Float64,1},StructArrays.StructArray{NamedTuple{(:WT, :INITWT, :DFWT, :M, :SCR, :INITBMI, :DFBMI, :INITFFM, :DFFFM, :SCRD, :GA, :PMA, :AGEYRS, :BMI, :FFM, :ALBD, :TAD),Tuple{Float64,Float64,Float64,Int64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64}},1,NamedTuple{(:WT, :INITWT, :DFWT, :M, :SCR, :INITBMI, :DFBMI, :INITFFM, :DFFFM, :SCRD, :GA, :PMA, :AGEYRS, :BMI, :FFM, :ALBD, :TAD),Tuple{Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1}}},Int64},Symbol},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Nothing,Int64},1},Array{Float64,1}},1}, ::NamedTuple{(:tvka, :tvk23, :tvvc, :tvvp, :tvQ, :tvCL, :tvbio, :θ, :Ω1, :Ω2, :σ1, :σ2),Tuple{Float64,Float64,Float64,Float64,Float64,Float64,Float64,Array{Float64,1},PDMats.PDiagMat{Float64,Array{Float64,1}},PDMats.PDMat{Float64,Array{Float64,2}},Float64,Float64}}, ::Int64, ::QuantileRegressions.IP, ::Pumas.ContinuousVPC; dv::Symbol, stratify_by::Nothing, quantiles::Tuple{Float64,Float64,Float64}, level::Float64, ensemblealg::EnsembleThreads, bandwidth::Int64, numstrats::Nothing, idv::Symbol, count_vals::Array{Float64,1}, sim_idvs::Nothing) at C:\Users\julia\.julia\packages\Pumas\iIBBr\src\estimation\vpc.jl:201
[6] vpc(::Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:tvka, :tvk23, :tvvc, :tvvp, :tvQ, :tvCL, :tvbio, :θ, :Ω1, :Ω2, :σ1, :σ2),Tuple{RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},VectorDomain{Array{TransformVariables.Infinity{false},1},Array{TransformVariables.Infinity{true},1},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},PSDDomain{Array{Float64,2}},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64}}}},Serialization.__deserialized_types__.var"#69#99",Serialization.__deserialized_types__.var"#70#100",Serialization.__deserialized_types__.var"#72#102",Pumas.LinearODE,Serialization.__deserialized_types__.var"#73#103",Serialization.__deserialized_types__.var"#86#116"},Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},Pumas.ConstantInterpolationStructArray{Array{Float64,1},StructArrays.StructArray{NamedTuple{(:WT, :INITWT, :DFWT, :M, :SCR, :INITBMI, :DFBMI, :INITFFM, :DFFFM, :SCRD, :GA, :PMA, :AGEYRS, :BMI, :FFM, :ALBD, :TAD),Tuple{Float64,Float64,Float64,Int64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64}},1,NamedTuple{(:WT, :INITWT, :DFWT, :M, :SCR, :INITBMI, :DFBMI, :INITFFM, :DFFFM, :SCRD, :GA, :PMA, :AGEYRS, :BMI, :FFM, :ALBD, :TAD),Tuple{Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Int64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1},Array{Float64,1}}},Int64},Symbol},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Nothing,Int64},1},Array{Float64,1}},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#339#340"{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat},Float64,Array{Float64,1},Float64,Float64,Array{Optim.OptimizationState{Float64,Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#339#340"{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat}},1},Bool},Pumas.FOCEI,Array{Array{Float64,1},1},NamedTuple{(:optimize_fn, :constantcoef, :omegas, :ensemblealg),Tuple{Pumas.DefaultOptimizeFN{Nothing,NamedTuple{(:show_trace, :store_trace, :extended_trace, :g_tol, :allow_f_increases),Tuple{Bool,Bool,Bool,Float64,Bool}}},NamedTuple{(:tvbio,),Tuple{Float64}},Tuple{},EnsembleThreads}},ParamSet{NamedTuple{(:tvka, :tvk23, :tvvc, :tvvp, :tvQ, :tvCL, :tvbio, :θ, :Ω1, :Ω2, :σ1, :σ2),Tuple{RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64},Pumas.ConstDomain{Float64},VectorDomain{Array{TransformVariables.Infinity{false},1},Array{TransformVariables.Infinity{true},1},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},PSDDomain{Array{Float64,2}},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Float64}}}}}, ::Int64, ::QuantileRegressions.IP, ::Pumas.ContinuousVPC; dv::Symbol, stratify_by::Nothing, quantiles::Tuple{Float64,Float64,Float64}, level::Float64, ensemblealg::EnsembleThreads, bandwidth::Int64, numstrats::Nothing, idv::Symbol, count_vals::Array{Float64,1}, sim_idvs::Nothing) at C:\Users\julia\.julia\packages\Pumas\iIBBr\src\estimation\vpc.jl:280
[7] top-level scope at none:1
But i actually have TAD as covariate in my DF and passed to read_pumas . PUMAS itself also calculated “tad” from the time points i gave in data. i tried with both TAD’s both did not work.
julia> BM1DF1
Population
Subjects: 134
Covariates: WT, INITWT, DFWT, M, SCR, INITBMI, DFBMI, INITFFM, DFFFM, SCRD, GA, PMA, AGEYRS, BMI, FFM, ALBD, TAD
Observables: DV
julia> DataFrame(BM1DF1)
3310×32 DataFrame. Omitted printing of 16 columns
│ Row │ id │ time │ evid │ DV │ amt │ dose │ tad │ cmt │ rate │ duration │ ss │ ii │ base_time │ rate_dir │ route │ WT │
│ │ String? │ Float64? │ Int64? │ Float64? │ Float64? │ Float64? │ Float64? │ Int64? │ Float64? │ Float64? │ Int64? │ Float64? │ Float64? │ Int8? │ Nothing? │ Float64 │
├──────┼─────────┼──────────┼────────┼──────────┼──────────┼──────────┼──────────┼────────┼──────────┼───────────┼────────┼──────────┼───────────┼──────────┼──────────┼─────────┤
│ 1 │ 1 │ 0.0 │ 1 │ missing │ 475.0 │ 475.0 │ 0.0 │ 2 │ 2910.88 │ 0.163181 │ 0 │ 0.0 │ 0.0 │ 1 │ │ 24.257 │
│ 2 │ 1 │ 10.25 │ 1 │ missing │ 60.0 │ 60.0 │ 0.0 │ 1 │ 0.0 │ 0.0 │ 0 │ 0.0 │ 10.25 │ 1 │ │ 24.257 │
│ 3 │ 1 │ 21.28 │ 1 │ missing │ 60.0 │ 60.0 │ 0.0 │ 1 │ 0.0 │ 0.0 │ 0 │ 0.0 │ 21.28 │ 1 │ │ 24.257 │
│ 3307 │ 178 │ 102.9 │ 0 │ 1.4 │ missing │ 4.0 │ 8.08 │ 2 │ missing │ missing │ 0 │ missing │ missing │ missing │ │ 2.845 │
│ 3308 │ 178 │ 102.98 │ 1 │ missing │ 4.0 │ 4.0 │ 0.0 │ 2 │ 341.4 │ 0.0117165 │ 0 │ 0.0 │ 102.98 │ 1 │ │ 2.845 │
│ 3309 │ 178 │ 110.68 │ 1 │ missing │ 4.0 │ 4.0 │ 0.0 │ 2 │ 341.4 │ 0.0117165 │ 0 │ 0.0 │ 110.68 │ 1 │ │ 2.845 │
│ 3310 │ 178 │ 120.15 │ 1 │ missing │ 4.0 │ 4.0 │ 9.47 │ 2 │ 341.4 │ 0.0117165 │ 0 │ 0.0 │ 120.15 │ 1 │ │ 2.845 │